What happens
OptimizationConfig.seed is declared PositiveInt (_optimization_config.py:52), so seed=0 — a perfectly normal seed, and the first value of any seed grid — is rejected:
>>> from autointent import OptimizationConfig
>>> OptimizationConfig(seed=0, search_space=[])
ValidationError: 1 validation error for OptimizationConfig
seed
Input should be greater than 0 [type=greater_than, input_value=0, input_type=int]
It is inconsistent with the rest of the API: Pipeline(seed=...) and Pipeline.from_search_space(seed=...) take int | None (_pipeline.py:54, :111) and accept 0, while Pipeline.from_preset(name, seed=0) and Pipeline.from_optimization_config fail because they build an OptimizationConfig (:124-127).
Proposed
NonNegativeInt (or plain int, matching Pipeline). Darinochka/AutoIntent-experiments#43 works around it by building the pipeline with the default seed and setting pipeline._seed = 0 afterwards.
Follow-up from #350.
What happens
OptimizationConfig.seedis declaredPositiveInt(_optimization_config.py:52), soseed=0— a perfectly normal seed, and the first value of any seed grid — is rejected:It is inconsistent with the rest of the API:
Pipeline(seed=...)andPipeline.from_search_space(seed=...)takeint | None(_pipeline.py:54,:111) and accept 0, whilePipeline.from_preset(name, seed=0)andPipeline.from_optimization_configfail because they build anOptimizationConfig(:124-127).Proposed
NonNegativeInt(or plainint, matchingPipeline). Darinochka/AutoIntent-experiments#43 works around it by building the pipeline with the default seed and settingpipeline._seed = 0afterwards.Follow-up from #350.