Skip to content

Adds "open a pull request and add results of a recent run as an attachment" to batch-log checklist - #65

Open
gtosado wants to merge 5 commits into
devfrom
merge-wind-rsc-pandas3
Open

gtosado wants to merge 5 commits into
devfrom
merge-wind-rsc-pandas3

Conversation

@gtosado

@gtosado gtosado commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Adds "open a pull request and add results of a recent run as an attachment" to batch-log checklist

ty-fi and others added 5 commits September 25, 2026 21:12
`agg_supplycurve()` assigned `dfin['bin'] = []` for an empty input supply
curve, which pandas types as float64. pandas 3.0 stopped excluding empty
frames from dtype resolution in `pd.concat`, so stacking an empty offshore
curve onto a populated onshore one upcast the `bin` index level to float64.
`"wsc" + bin.astype(str)` then produced `wsc1.0` instead of `wsc1`, the
`{"wsc1": "bin1", ...}` rename matched nothing, and the downstream pivot --
which selects value columns with `startswith("bin")` -- silently dropped
every wind row.

The result was `rsc_combined.csv` containing only `cost_cap`/`cost_trans`
for `wind-ons` and no `cap`/`cost`, leaving the model with zero buildable
wind. Runs completed with no error or warning. Hit `st-AZNM` (landlocked,
so its offshore curve is header-only, but `GSw_OfsWind=1` still processes
it); coastal cases are unaffected because their offshore curves are
non-empty.

Type the empty column to the int64 that `reeds.inputs.get_bin` produces in
the non-empty branch. Fixed at the dtype source rather than at the
`.astype(str)` call: the same trap sits one line below on `class`, and
`agg_supplycurve()` also feeds the geothermal `pd.concat(geo, axis=0)`,
which is one switch change away from failing the same way. (UPV and CSP
call `agg_supplycurve()` standalone, with no populated sibling for an empty
frame to corrupt, so they cannot hit this.)

Verified against `runs/v20260924fix_st-AZNM_baseline` inputs: restores 377
`cap` and 377 `cost` rows for `wind-ons` and 920.3 GW of buildable
resource, with `cap` byte-identical to the pre-pandas-3
`v20260916v4_st-AZNM_baseline` run. UPV output unchanged.

Pre-existing upstream bug, not a regression from our pandas pin. Upstream
has the same bare `[]` at tag 2026.08.03 and on upstream/main, and has
pinned `pandas=3.0` since 2026-05-08 -- four months before this fork did --
so the bug is live there too. They have not hit it because their default
and test cases (`cendiv/Pacific`, `country/USA`) are coastal or national
and always have a populated offshore curve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two corrections to the entries added in d2af269.

Upstream is NOT on pandas 2.x. `environment.yml` on ReEDS-Model/ReEDS has
pinned `pandas=3.0` since 2026-05-08 (`2ff493b5`) -- four months before this
fork moved to it in `129ecdbc`. The bug is therefore live upstream right
now, not latent: they satisfy the pandas and code-path conditions already
and have simply not hit an empty offshore curve, because their default and
test cases (`cendiv/Pacific`, `country/USA`) are coastal or national.
Also confirmed not raised on their issue tracker as of 2026-09-25, having
searched all 86 issues plus PR history; the nearest hits (#27, #28) are
about offshore *zones*, not supply curves.

Scope was stated too loosely as "any run where a supply curve passed to
`agg_supplycurve()` is empty while its technology is enabled". That
overstates it. The bug needs four conditions at once, and in particular
needs a `pd.concat(dict, axis=0)` over sub-techs where one member is empty
and another is populated. Only wind (`ons`/`ofs`) and geothermal
(`geohydro`/`egs`) do that; UPV and CSP call `agg_supplycurve()` standalone
and cannot hit it. Verified the switch boundary against the unfixed code on
the same st-AZNM inputs: `GSw_OfsWind=1` gives 0 cap/0 cost wind rows,
`GSw_OfsWind=0` gives 1640/1640.

Records which regions are exposed, measured from existing runs: `st/AZ.NM`
and `nercr/WECC_SW` have zero offshore rows (exposed); `st/VA`,
`st/MS.AL.GA`, `transreg/SERTP` and `country/USA` do not. WECC_SW had not
been re-run since the pandas upgrade, so it was queued up to hit this next.
Also notes the geothermal site is latent only because current switches
leave `rev_geo_types` single-element.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants