Repository navigation
Make LoadML and temperature coverage follow forecast_hours - #5398
jacobidsmith wants to merge 3 commits into
Conversation
|
Added a follow-up fix so available future temperature and rate data are retained across Added regression coverage for short-history cases, including forecasts up to 412 hours, and updated the remaining fixed-48-hour documentation. LoadML rollout, training/persistence, and temperature tests passed, along with checks for the changed files. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Failed temperature refreshes can suppress usable cached data, and initial saved metadata can record the wrong horizon.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Extends LoadML and temperature coverage to follow forecast_hours while retaining existing model compatibility and blending behaviour.
Changes:
- Makes LoadML rollout length configurable.
- Extends Open-Meteo requests, cache validation, and chart coverage.
- Adds regression tests and updates documentation.
| File | Description |
|---|---|
docs/load-ml.md |
Documents configurable forecast horizons. |
docs/components.md |
Updates LoadML component documentation. |
apps/predbat/web.py |
Aligns chart temperature coverage. |
apps/predbat/tests/test_temperature.py |
Tests weather horizon and cache refresh. |
apps/predbat/tests/test_load_ml_rollout.py |
Tests configurable ML rollouts. |
apps/predbat/temperature.py |
Extends weather requests and validates caches. |
apps/predbat/load_predictor.py |
Generates variable-length forecasts. |
apps/predbat/load_ml_component.py |
Propagates horizon configuration and inputs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

LoadML currently stops at 48 hours even when the existing YAML
forecast_hourssetting requests a longer forecast. With ML selected as the load source, this leaves the later plan without ML load data.This change makes LoadML predictions and the future temperature coverage in the LoadMLPower chart follow
forecast_hours, without adding another configuration setting.Changes
forecast_hoursto calculate the number of five-minute LoadML prediction steps.The separate Plan forecast hours helper remains unchanged.
Validation
96 → 24 → 31 → 168 → 412 → 96hours. LoadML generated the expected1,152 → 288 → 372 → 2,016 → 4,944 → 1,152prediction steps.These live checks validate forecast generation and consumption, rather than long-range prediction accuracy. Exact published timestamp coverage, every later plan row, and long-run midnight behaviour were not independently verified. The remaining slow test groups (
plan_preclip,annual_integration, andml_training_perf) were not run.