Skip to content

feat(tasks)!: remove n2o1 task + ConfigEntsoe inherits ConfigMulti#352

Merged
bartzbeielstein merged 2 commits into
developfrom
feat/remove-n2o1-configentsoe-inherit
Jun 8, 2026
Merged

feat(tasks)!: remove n2o1 task + ConfigEntsoe inherits ConfigMulti#352
bartzbeielstein merged 2 commits into
developfrom
feat/remove-n2o1-configentsoe-inherit

Conversation

@bartzbeielstein

Copy link
Copy Markdown
Collaborator

Two linked changes; BREAKING → 20.0.0.

1. Remove spotforecast-safe-n2o1-cov-df (feat(tasks)!)

A thin CLI wrapper whose real logic lives in spotforecast2_safe.multitask (BaseTask/MultiTask/runner.run, retained as public API and used by spotforecast2). Removes the module, the console script, the n2o1_cov_df_main export, its three test surfaces, and its docs/quartodoc entries. No downstream consumer (spotforecast2, bart26k-lecture) imports it.

Its removal also clears the lone isinstance(config, ConfigMulti) guard (line 328) that blocked #2.

2. ConfigEntsoe(ConfigMulti) (refactor(configurator))

ConfigEntsoe was an independent dataclass duplicating ConfigMulti's whole field set → every new feature flag had to be hand-mirrored (the parity gap). It now subclasses ConfigMulti, declaring only its two genuine differences (index_name default "Time (UTC)"; the ENTSO-E-only retrain_max_age) and inheriting the other 73 fields + methods. The parity gap is closed structurally.

  • Verified byte-identical: ConfigEntsoe() defaults unchanged vs the standalone class (only sanctioned diffs: index_name, retrain_max_age).
  • Hand-maintained parity test → structural invariant (set(ConfigMulti._PARAM_NAMES) <= set(ConfigEntsoe._PARAM_NAMES), only extra is retrain_max_age) + default-equality + isinstance assertions.

QC

Suite 2388 passed (n2o1 tests removed), coverage 71.8% (config_entsoe/config_multi 100%); ruff/black/isort clean; REUSE compliant; ty unchanged (same pre-existing dataclass false-positives as config_multi); docs reference regenerated (ConfigEntsoe page updated, n2o1 page removed).

🤖 Generated with Claude Code

bartzbeielstein and others added 2 commits June 8, 2026 20:41
The n-to-1-with-covariates task was a thin CLI wrapper whose real logic lives
in spotforecast2_safe.multitask (BaseTask/MultiTask/runner.run) — retained as
public API and exercised by the downstream spotforecast2 package. Removing the
wrapper drops no library capability and clears the lone isinstance(config,
ConfigMulti) guard that blocked ConfigEntsoe from inheriting ConfigMulti.

Removed: the module, the `spotforecast-safe-n2o1-cov-df` console script
(pyproject [project.scripts]), the `n2o1_cov_df_main` export from tasks/__init__,
its dedicated tests (test_cli_n2o1, test_task_safe_n_to_1_with_covariates, and
the TestTaskSafeN2O1CovDf class), and its docs/quartodoc entries.

No downstream consumer (spotforecast2, bart26k-lecture) imports the module or
calls the script.

BREAKING CHANGE: the `spotforecast-safe-n2o1-cov-df` console entry point and the
`spotforecast2_safe.tasks.task_safe_n_to_1_with_covariates_and_dataframe` module
(incl. `run_pipeline`, `main`, and the `n2o1_cov_df_main` export) are removed.
Use `spotforecast2_safe.multitask.MultiTask` / `multitask.runner.run` directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ConfigEntsoe was an independent dataclass duplicating ConfigMulti's entire field
set, so every new ConfigMulti feature flag had to be hand-mirrored or the
ENTSO-E pipeline raised TypeError (the parity gap, patched reactively in 19.4.0).

Make ConfigEntsoe a subclass: it now declares only its two genuine differences —
the index_name default override ("Time (UTC)") and the ENTSO-E-only
retrain_max_age field — and inherits all 73 shared fields plus get_params /
set_params / __post_init__(validate_config). The parity gap is closed
structurally: any flag added to ConfigMulti appears on ConfigEntsoe
automatically.

Verified byte-identical: ConfigEntsoe() defaults are unchanged vs the previous
standalone class (only sanctioned diffs: index_name default + retrain_max_age).
The hand-maintained parity test is replaced by a structural invariant
(set(ConfigMulti._PARAM_NAMES) <= set(ConfigEntsoe._PARAM_NAMES); the only extra
is retrain_max_age) plus default-equality and isinstance assertions.

Enabled by the n2o1 task removal, which dropped the isinstance(config,
ConfigMulti) guard that subclassing would otherwise have subverted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bartzbeielstein bartzbeielstein merged commit 739ca02 into develop Jun 8, 2026
10 checks passed
@bartzbeielstein bartzbeielstein deleted the feat/remove-n2o1-configentsoe-inherit branch June 8, 2026 18:43
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