feat(tasks)!: remove n2o1 task + ConfigEntsoe inherits ConfigMulti#352
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 byspotforecast2). Removes the module, the console script, then2o1_cov_df_mainexport, 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))ConfigEntsoewas an independent dataclass duplicating ConfigMulti's whole field set → every new feature flag had to be hand-mirrored (the parity gap). It now subclassesConfigMulti, declaring only its two genuine differences (index_namedefault"Time (UTC)"; the ENTSO-E-onlyretrain_max_age) and inheriting the other 73 fields + methods. The parity gap is closed structurally.ConfigEntsoe()defaults unchanged vs the standalone class (only sanctioned diffs:index_name,retrain_max_age).set(ConfigMulti._PARAM_NAMES) <= set(ConfigEntsoe._PARAM_NAMES), only extra isretrain_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