Skip to content

release: promote develop to main — 19.0.0 (RunState shim removal)#341

Merged
bartzbeielstein merged 4 commits into
mainfrom
develop
Jun 7, 2026
Merged

release: promote develop to main — 19.0.0 (RunState shim removal)#341
bartzbeielstein merged 4 commits into
mainfrom
develop

Conversation

@bartzbeielstein
Copy link
Copy Markdown
Collaborator

Promotes the 19.0.0 train (PR #340, tbb-skills4agents work item #2):

  • Mirror shim removed — derived pipeline fields exist only on task.run_state; config.<derived> raises AttributeError; no pipeline DeprecationWarning. RunState is now @dataclass(slots=True).
  • config.task write removed; get_target_data window keyword-only required.

Verification: full suite 2354 passed / 1 skipped, ruff clean, full quarto render green, PR CI all green. sf2 6.0.0 (pin >=19,<20 + 4 test rewrites) follows immediately — already verified against this code via overlay (131 multitask tests green).

🤖 Generated with Claude Code

github-actions Bot and others added 4 commits June 7, 2026 13:03
…indow fallback

Remove two pieces of deprecated bridging code that were retained for
backward compatibility during the RunState extraction (v18.0.0) but are
now confirmed to have zero callers:

1. `get_target_data` config-window fallback
   (`src/spotforecast2_safe/manager/features.py`): the function formerly
   tried `getattr(config, "start_train_ts"/"end_train_ts", None)` when
   the explicit parameters were `None`, emitting `DeprecationWarning`.
   The fallback blocks (~lines 825-866 pre-removal) are deleted.  When
   either explicit parameter is `None` the function now raises
   `ValueError` unconditionally.  The `warnings` import is removed as it
   is no longer used.  Docstring updated: the Args sections for
   `start_train_ts`/`end_train_ts` no longer mention the deprecated
   fallback; they state the parameter is keyword-only, required, and
   `None` → raises `ValueError`.  The paragraph mentioning the config
   fallback for backward compatibility is replaced with a note that both
   parameters are required.  The function signature now enforces this at
   the language level: everything after `config` is keyword-only (bare
   `*` separator), and `start_train_ts`/`end_train_ts` have no default.
   The runtime `if ... is None: raise ValueError` guards are kept so that
   callers who pass `None` explicitly get a clear error message rather
   than a `TypeError`.

2. `config.task` write in `MultiTaskBase.__init__`
   (`src/spotforecast2_safe/multitask/base.py`, line 361 pre-removal):
   the assignment `config.task = self.TASK` and its comment ("Propagate
   the task identifier so config-aware helpers know the mode.") are
   removed.  `ConfigMulti.task` retains the value set by the caller at
   construction or via `set_params`/direct assignment and is no longer
   mutated as a side effect of task-class instantiation.

Also: revert ruff-collapsed mi_sample_size f-string at features.py
~line 495 back to the original two-line form (cosmetic, out of scope of
the breaking change); add parametrized regression test
`test_none_window_timestamp_raises_value_error` to
`tests/test_manager_features.py` (covers both `start_train_ts` and
`end_train_ts`); update stale fixture comment in same file.

BREAKING CHANGE: `get_target_data` no longer accepts `None` for
`start_train_ts` or `end_train_ts` and will no longer fall back to
`config.start_train_ts` / `config.end_train_ts` — callers must pass
explicit `pd.Timestamp` values (e.g. from `task.run_state.start_train_ts`
/ `task.run_state.end_train_ts`).  Both parameters are now keyword-only
(bare `*` separator after `config`); positional passing of
`data_with_exog`, `exog_feature_names`, or `exo_pred` is also no longer
accepted.  Additionally, constructing any `MultiTask` subclass no longer
mutates `config.task`; code that relied on `config.task` reflecting the
active task type after task instantiation must read `task.TASK` from the
task object instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Derived pipeline fields are no longer mirrored onto the config object
after pipeline runs.  Reading `config.data_start`, `config.data_end`,
`config.cov_start`, `config.cov_end`, `config.start_download`,
`config.end_download`, `config.end_train_ts`, or `config.start_train_ts`
now raises AttributeError — these values exist only on `task.run_state`.
No DeprecationWarning is emitted by the pipeline anymore.

Changes:
- Delete `_set_derived` method and its "Derived-state helpers" banner.
- Delete `_run_state_deprecation_warned` instance flag.
- Replace all 8 `_set_derived(...)` call sites with direct
  `self.run_state.<field> = value` assignments.
- Remove `warnings.catch_warnings()`/`simplefilter("ignore", DeprecationWarning)`
  wrappers from 5 docstring `{python}` examples in `base.py` and 2 in
  `defaults.py`; dedent the wrapped statements.
- Remove dead `import warnings` (module-level) from `base.py`.
- Harden `RunState` against silent typo assignments: changed to
  `@dataclass(slots=True)` so any write to an undeclared attribute raises
  `AttributeError` immediately.
- Rewrite `TestMirrorShim` → `TestNoConfigMirror`: asserts all 8 derived
  fields (including `end_train_ts`/`start_train_ts`) are NOT set on config
  after `prepare_data()` + `_setup_training_window()`.
- Rewrite `TestDeprecationWarning` → `TestNoDeprecationWarning`: asserts
  zero DeprecationWarnings emitted during the pipeline.
- Remove `warnings.catch_warnings()` suppression wrappers from all other
  test classes in `test_run_state.py` (they existed only to silence the
  shim warning).
- Update `tests/multitask/test_prepare_data_clamp.py` and
  `tests/multitask/test_prepare_data_target_corruption.py` to read
  `task.run_state.data_end` / `task.run_state.cov_end` instead of
  `task.config.data_end` / `task.config.cov_end`.
- Fix stale "mirror" prose in `base.py` comments.

BREAKING CHANGE: The following 8 fields no longer exist on the config
object after pipeline runs and will raise AttributeError if accessed
there: `start_download`, `end_download`, `data_start`, `data_end`,
`cov_start`, `cov_end`, `end_train_ts`, `start_train_ts`.  Read all of
them from `task.run_state` instead.  `config.targets` still holds the
user-supplied input (unchanged); the resolved target list is available
as `task.run_state.targets`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…emove-config-task-write-and-window-fallback

feat(multitask)!: 19.0.0 — remove RunState mirror shim, config.task write, get_target_data config-window fallback
@bartzbeielstein bartzbeielstein merged commit 8c7b236 into main Jun 7, 2026
10 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