From 176baa543adbc1e4925fd82e712a6ddd0d097096 Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Mon, 2 Mar 2026 08:51:02 +0100 Subject: [PATCH] flake8 + fix bug in seed type checking --- src/pg_rad/configs/defaults.py | 2 +- src/pg_rad/inputparser/parser.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pg_rad/configs/defaults.py b/src/pg_rad/configs/defaults.py index 97fae3d..2d45681 100644 --- a/src/pg_rad/configs/defaults.py +++ b/src/pg_rad/configs/defaults.py @@ -15,4 +15,4 @@ DEFAULT_MAX_TURN_ANGLE = 90. DEFAULT_FRICTION_COEFF = 0.7 # dry asphalt DEFAULT_GRAVITATIONAL_ACC = 9.81 # m/s^2 -DEFAULT_ALPHA = 100. \ No newline at end of file +DEFAULT_ALPHA = 100. diff --git a/src/pg_rad/inputparser/parser.py b/src/pg_rad/inputparser/parser.py index db1cc90..a566764 100644 --- a/src/pg_rad/inputparser/parser.py +++ b/src/pg_rad/inputparser/parser.py @@ -109,7 +109,10 @@ class ConfigParser: raise ValueError( "options.air_density must be a positive float in kg/m^3." ) - if not isinstance(seed, int) or seed < 0: + if ( + seed is not None or + (isinstance(seed, int) and seed <= 0) + ): raise ValueError("Seed must be a positive integer value.") return SimulationOptionsSpec(