diff --git a/src/quant_platform_kit/common/runtime_config.py b/src/quant_platform_kit/common/runtime_config.py index f149fd5..3a2d0d3 100644 --- a/src/quant_platform_kit/common/runtime_config.py +++ b/src/quant_platform_kit/common/runtime_config.py @@ -65,6 +65,7 @@ def resolve_quantity_step_env( step_env: str, fractional_env: str, fractional_default: bool, + fractional_step: float = 0.0001, ) -> float: explicit_step = resolve_optional_float_env(env, step_env) if explicit_step is not None: @@ -75,7 +76,7 @@ def resolve_quantity_step_env( if raw_enabled is None else resolve_bool_value(raw_enabled) ) - return 0.000001 if fractional_enabled else 1.0 + return float(fractional_step) if fractional_enabled else 1.0 def resolve_strategy_config_path( diff --git a/tests/test_runtime_config.py b/tests/test_runtime_config.py index dea426f..ffc5557 100644 --- a/tests/test_runtime_config.py +++ b/tests/test_runtime_config.py @@ -47,7 +47,17 @@ def test_common_runtime_config_helpers_normalize_basic_values(self) -> None: fractional_env="FRACTIONAL_ENABLED", fractional_default=False, ), - 0.000001, + 0.0001, + ) + self.assertEqual( + resolve_quantity_step_env( + env, + step_env="MISSING_STEP", + fractional_env="FRACTIONAL_ENABLED", + fractional_default=False, + fractional_step=0.001, + ), + 0.001, ) self.assertEqual( resolve_quantity_step_env(