Skip to content

fix: handle insufficient hourly forecast errors - #1135

Merged
egordm merged 1 commit into
mainfrom
fix/hourly-std-insufficient-samples
Oct 12, 2026
Merged

egordm merged 1 commit into
mainfrom
fix/hourly-std-insufficient-samples

Conversation

@egordm

@egordm egordm commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Prevents sparse hourly residual groups from propagating NaN standard deviations into forecasts. Under-sampled hours use pooled residual variability from the same horizon. If pooled uncertainty cannot be estimated for any horizon, the applicator warns once and passes forecasts through unchanged.

Closes: No linked issue.

Validation: The focused applicator suite passes (9 tests), as do Ruff, formatting, and ty. poe all --check reports failures in the unrelated LinearComponentSplitter and Imputer tests.

Type of change

  • Bug fix
  • New feature
  • Breaking change (see checklist below)
  • Documentation
  • Refactor / chore / CI

Breaking changes checklist

  • Public API, config schema, or serialized/pickled objects changed in a way that affects existing users
  • If yes: see the breaking changes guide for the pickle/_migrate_state migration pattern

Migration path for existing users: N/A.

AI disclosure

  • No AI assistance was used (beyond grammar/spelling)
  • AI assistance was used — tool(s): GitHub Copilot
    • I have reviewed, understand, and can explain all AI-generated code in this PR
    • This is disclosed in a commit message (e.g. Assisted-by: <tool name>)

Checklist

  • poe all --check passes locally
  • Tests added/updated for the change
  • Documentation updated (docstrings, user guide, examples) if needed
  • Commits are signed off per our DCO (git commit -s)
  • PR title follows Conventional Commits (e.g. feat: ..., fix: ..., feat!: ... for breaking changes)

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
@egordm
egordm requested a review from a team October 12, 2026 07:31
@github-actions github-actions Bot added the fix Something isn't working label Oct 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@egordm egordm mentioned this pull request Oct 12, 2026
8 of 16 tasks
@egordm
egordm added this pull request to stack #1137 October 12, 2026 08:04
@egordm
egordm merged commit 9627740 into main Oct 12, 2026
7 checks passed
@egordm
egordm deleted the fix/hourly-std-insufficient-samples branch October 12, 2026 08:50
egordm added a commit that referenced this pull request Oct 12, 2026
## What does this PR do?

Resolves scikit-learn warning failures that prevented the full local
quality gate from passing:

- Migrates the bundled splitter artifact by loading and reserializing it
with the locked scikit-learn 1.9.1. The old and migrated artifacts
produced bit-identical predictions on 260 deterministic inputs; the
migrated artifact reloads without version warnings. The loading doctest
and unit tests now exercise that clean load directly.
- Remove fractional bootstrap sampling from the tiny imputer test and
example datasets, avoiding scikit-learn small-sample warnings.
- Keep the logistic-regression default as sklearn default rather than
explicitly passing deprecated `penalty="l2"`; non-default penalties
remain configurable without duplicating constructor setup.

This PR is stacked on #1135 and should be merged after it.

No linked issue.

Validation: `uv run poe all --check` passes locally. The focused
splitter/doctest/logistic checks also pass (7 tests).

## Type of change

- [x] Bug fix
- [ ] New feature
- [ ] Breaking change (see checklist below)
- [ ] Documentation
- [ ] Refactor / chore / CI

## Breaking changes checklist

- [ ] Public API, config schema, or serialized/pickled objects changed
in a way that affects existing users
- [ ] If yes: see the [breaking changes
guide](https://openstef.github.io/openstef/contribute/development_workflow.html#breaking-changes)
for the pickle/`_migrate_state` migration pattern

Migration path for existing users: N/A.

## AI disclosure

- [ ] No AI assistance was used (beyond grammar/spelling)
- [x] AI assistance was used — tool(s): GitHub Copilot
- [x] I have reviewed, understand, and can explain all AI-generated code
in this PR
- [ ] This is disclosed in a commit message (e.g. `Assisted-by: <tool
name>`)

## Checklist

- [x] `poe all --check` passes locally
- [x] Tests added/updated for the change
- [x] Documentation updated (docstrings, user guide, examples) if needed
- [x] Commits are signed off per our
[DCO](https://openstef.github.io/openstef/contribute/contributing_guide.html#signing-the-developer-certificate-of-origin-dco)
(`git commit -s`)
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/) (e.g. `feat: ...`, `fix:
...`, `feat!: ...` for breaking changes)

---------

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants