Skip to content

feat(power_forecast): time-window mode for get_init_times + DE day-ahead examples#79

Merged
mroberto166 merged 4 commits into
mainfrom
preview2/init-times-time-range
Jun 4, 2026
Merged

feat(power_forecast): time-window mode for get_init_times + DE day-ahead examples#79
mroberto166 merged 4 commits into
mainfrom
preview2/init-times-time-range

Conversation

@mroberto166

Copy link
Copy Markdown
Contributor

Summary

  • Add start_time/end_time to PowerForecast.get_init_times. In this time-window mode the endpoint is queried by init_time range and limit is omitted, so the full window is returned (the legacy 1000-item count cap no longer truncates long ranges). Default count mode is unchanged.
  • Add an example (examples/power_forecast/plot_day_ahead_timeseries.py) producing two DE plots:
    • a full year of day-ahead generation from the 09:00 UTC run, and
    • the last month of DE Solar day-ahead comparing the 10 / 12 / 18 UTC init hours.

Backend dependency

Relies on the new init-times time-window filtering. Verified against the live API: a 30-day DE window returns 2880 init times (> 1000) when limit is omitted.

Test plan

  • uv run pytest tests/power_forecast/test_get_init_times.py (unit, mocked)
  • New functional test test_get_init_times_time_window asserts window bounds and >1000 results
  • Ran the example against the live API; both PNGs render as expected
  • ruff / ruff-format / mypy clean

Made with Cursor

mroberto166 and others added 2 commits June 4, 2026 11:18
Add start_time/end_time params to get_init_times. When set, the endpoint
is queried by init_time range and limit is omitted so the full window is
returned (bypassing the 1000-item count cap). Includes unit and
functional tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add an example that plots a year of DE day-ahead generation from the
09:00 UTC run, and the last month of DE Solar day-ahead comparing the
10/12/18 UTC init hours.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mroberto166 mroberto166 requested a review from a team as a code owner June 4, 2026 09:18
Generalize the day-ahead example to run for both DE and GB, pulling each
zone's available PSR types for the yearly plot.

Co-authored-by: Cursor <cursoragent@cursor.com>
The init-times endpoint may return naive datetimes; normalize to UTC
before comparing against the tz-aware window bounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mroberto166 mroberto166 merged commit 533a921 into main Jun 4, 2026
41 checks passed
@mroberto166 mroberto166 deleted the preview2/init-times-time-range branch June 4, 2026 10:23
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.

2 participants