Skip to content

feat(configurator): convert ConfigMulti and ConfigEntsoe to dataclasses#342

Merged
bartzbeielstein merged 1 commit into
developfrom
feat/configurator-dataclass
Jun 7, 2026
Merged

feat(configurator): convert ConfigMulti and ConfigEntsoe to dataclasses#342
bartzbeielstein merged 1 commit into
developfrom
feat/configurator-dataclass

Conversation

@bartzbeielstein
Copy link
Copy Markdown
Collaborator

Summary

Step 4 / final item of the RunState migration ADR (GitLab #4, Option 3): convert ConfigMulti and ConfigEntsoe to @dataclasses, removing the hand-maintained _PARAM_NAMES drift hazard.

  • @dataclass auto-generates __init__/__repr__/__eq__; the 66/67 params become field declarations in the same order (preserves get_params key order).
  • The 4 mutable defaults (periods, lags_consider, train_size, delta_val; +retrain_max_age for ENTSO-E) use field(default_factory=...).
  • validate_config(self) moved into __post_init__.
  • _PARAM_NAMES is now derived from dataclasses.fields() (kept as a class attribute for the ~15 tests that read it) — it can no longer drift from the fields.
  • Regenerated the two config reference pages.

Non-breaking → minor bump

Public surface unchanged: keyword constructor, all defaults, get_params/set_params incl. periods__* deep notation (15 keys), ValueError on unknown params. Only __eq__/__repr__ become value-based (auto-generated) — nothing hashes a config or relies on identity equality. feat: → 19.1.0.

Verification

  • ruff check + format: clean
  • config gates: 369 passed; full suite: 2354 passed, 1 skipped
  • quartodoc build + config reference render: green ({python} cells execute)

Refs: GitLab #4 / Option 3 (RunState migration ADR)

@DataClass with field(default_factory=...) for the mutable/Timedelta
defaults and __post_init__ -> validate_config(). _PARAM_NAMES is now
derived from dataclasses.fields() instead of a hand-maintained tuple,
removing the field-vs-param drift hazard. get_params()/set_params()
surface (periods__* deep notation, ValueError on unknown params,
round-trip stability) unchanged; only __eq__/__repr__ are newly
auto-generated -> minor bump. Regenerated config reference pages.

Refs: GitLab #4 / Option 3 (RunState migration ADR)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bartzbeielstein bartzbeielstein merged commit 2bff0f8 into develop Jun 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant