deeppavlov / deeppavlov/AutoIntent

`OptimizationConfig.seed` is `PositiveInt` — `seed=0` is rejected while `Pipeline(seed=0)` accepts it

Open Beginner friendly
#352 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Python
Stars
54
Forks
16
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/autointent/_optimization_config.py at line 52 and compare its seed type with the seed parameters in src/autointent/_pipeline/_pipeline.py at lines 54, 111, and 124-127. Verify the public constructors accept seed=0 consistently, including OptimizationConfig, Pipeline.from_preset, and Pipeline.from_optimization_config.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.