Skip to content

feat: GB transmission/embedded wind split + demand (load) MW#81

Merged
mroberto166 merged 4 commits into
mainfrom
feat/gb-wind-split-and-demand-mw
Jun 17, 2026
Merged

feat: GB transmission/embedded wind split + demand (load) MW#81
mroberto166 merged 4 commits into
mainfrom
feat/gb-wind-split-and-demand-mw

Conversation

@mroberto166

@mroberto166 mroberto166 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes SDK feature-parity gaps with the Query Engine for power data:

  • GB wind split (market_data): exposes wind_embedded and wind_transmission (and their day-ahead forecasts) from the UK-power feed, alongside the existing composite wind/wind_forecast totals. The UK-power backend now splits requests into compatible batches so a composite total and its conflicting components are never sent in the same call (works around a backend 500), then reassembles results transparently.
  • Demand / load MW (market_aggregates): compare_runs_mw(weighting="population") now returns predicted electricity demand as load_mw, and get_mw_zones reports load zones. This surfaces Jua-model demand for many zones beyond Germany, derived from population-weighted forecasts.
  • Multi-zone MW fix (market_aggregates): building the xarray Dataset for MW responses now includes market_zone in the index, fixing a "non-unique MultiIndex" error when several zones are requested.
  • PSR-type validation + demand hint (power_forecast): get_data now validates requested PSR types per zone (cached lookup). Requesting a type a zone doesn't serve (e.g. Load for FR/GB) used to fail with a cryptic "0 init time(s) available" error; it now raises a clear message listing the zone's available types, and for demand (Load) points to the complementary Jua product — market_aggregates load_mw via the population weighting. This keeps market_data (observational) cleanly separate; the only cross-reference is Jua→Jua.

Commits

  • feat(market_data): add GB transmission/embedded wind split
  • feat(market_aggregates): add demand (load) MW output
  • fix(market_aggregates): support multi-zone MW output
  • feat(power_forecast): validate PSR types with actionable demand hint

Test plan

  • Unit suite (tests/market_data) — passing
  • Functional suite (tests/functional, live API) for market_data + market_aggregates + power_forecast — passing
  • New tests: GB wind total = transmission + embedded; forecast split; multi-zone load_mw; get_mw_zones includes load; power_forecast Load→market_aggregates hint; unavailable PSR type lists available
  • pre-commit (ruff, ruff-format, isort, mypy) — passing
  • commitizen branch check — passing
  • Examples run: market_data_example.py, plot_market_data.py, market_aggregates_example.py

mroberto166 and others added 3 commits June 17, 2026 17:34
Expose GB-specific wind generation components from the UK-power feed:
wind_embedded and wind_transmission, plus their day-ahead forecasts.
The composite `wind`/`wind_forecast` totals remain available.

The UK-power backend now splits requests into compatible batches so a
composite total and its conflicting components are never sent in the
same call, working around a backend 500 on such combinations, then
reassembles the results transparently.

Adds unit, functional, and example coverage for the new variables.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire up population-weighted demand so `compare_runs_mw(weighting=
"population")` returns predicted electricity demand as `load_mw`, and
include `load` zones in `get_mw_zones` so callers can discover which
markets support demand output. This exposes Jua-model load for many
zones beyond Germany, derived from population-weighted forecasts.

Updates docstrings, the market_aggregates example, and functional tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
MW responses carry a `market_zone` column with one row per zone and
timestamp, so building the xarray Dataset on a (model_run, time) index
raised "non-unique MultiIndex" when several zones were requested.
Include `market_zone` in the index for MW responses; weather responses
(no `market_zone` column) keep the (model_run, time) index.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mroberto166 mroberto166 requested a review from a team as a code owner June 17, 2026 15:35
Requesting a PSR type a zone doesn't serve (e.g. Load for FR) previously
failed with a cryptic "0 init time(s) available" error. get_data now
validates requested PSR types per zone (cached psr-types lookup) and
raises a clear error listing what the zone does serve. For demand
(Load), the message points to the complementary Jua product:
market_aggregates load_mw via the population weighting, available for
many more zones.

Co-authored-by: Cursor <cursoragent@cursor.com>

@n-poulsen n-poulsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mroberto166 mroberto166 merged commit 3ca8e39 into main Jun 17, 2026
30 checks passed
@mroberto166 mroberto166 deleted the feat/gb-wind-split-and-demand-mw branch June 17, 2026 16:20
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