feat(validate): CPUC Baseline Generator List capacity benchmark (CPUC stack 5/5) - #800
Closed
ktehranchi wants to merge 1 commit into
Closed
ktehranchi wants to merge 1 commit into
ktehranchi wants to merge 1 commit into
Conversation
Compares installed capacity between the CPUC Baseline Generator List and the model's generator fleet, aggregated by SERVM benchmark region and technology category, per planning horizon. Emits a long-format comparison CSV and a per-horizon deviation heatmap under the run's figures/benchmark/ directory. Gated by the new run.benchmark_cpuc flag (default false), which is independent of the demand profile: the fleet benchmark is useful for any California run. Region attribution: EIA reports every CAISO plant under the single BA code CISO, so powerplants.csv cannot separate PGE from SCE from SDGE. The benchmark therefore runs at the coarsest resolution both sides support — CAISO (= PGE + SCE + SDGE), LADWP (LDWP), IID, NCNC (BANC + TIDC) — with the collapse stated in repo_data/CPUC/servm_benchmark_regions.csv. The model side is restricted to state == CA so EIA's CISO code does not drag in the Nevada CISO-VEA footprint. Technology attribution: repo_data/CPUC/servm_tech_map.csv maps both SERVM tech categories and PyPSA carriers into a shared compare_category. Anything unmapped on either side becomes an explicit UNMAPPED:<name> row rather than being dropped. Vintage/retirement filtering is shared by both sides and mirrors add_electricity.load_powerplants, so the benchmark measures the fleet the model actually builds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6 tasks
Collaborator
Author
|
Superseded by #801 — the five-PR stack was collapsed into a single PR at the author's request. All commits (plus Tier B fixes) are on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #798 (base set to
feat/servm-demand; retarget after the stack lands). Gated by a newrun.benchmark_cpucflag — useful for any California run, independent of the SERVM demand profile.Changes proposed in this Pull Request
A validate-stage benchmark comparing installed capacity against the CPUC Baseline Generator List (June 2026), per planning horizon:
workflow/scripts/benchmark_cpuc_baseline.py+rule benchmark_cpuc_baseline(runs on the assembled unsolved network — no solver needed). Outputs a long-format comparison CSV and a region × technology deviation heatmap PDF, surfaced throughrule allwhenrun.benchmark_cpuc: true.CISOBA (no PGE/SCE/SDGE split), so the benchmark compares CAISO-total (CPUC PGE+SCE+SDGE, which per the CPUC dictionary is the CAISO definition) plus individual non-CAISO regions (LDWP→LADWP, IID→IID, BANC+TIDC→NCNC), declared inrepo_data/CPUC/servm_benchmark_regions.csv. Model side filtered to CA (EIA's CISO also spans the NV VEA footprint).repo_data/CPUC/servm_tech_map.csv) — SERVM's 27 tech categories are finer than PyPSA carriers. Unmapped techs on either side surface as explicitUNMAPPED:rows, never dropped; gas Cogen/CHP is kept CPUC-only (no CHP concept in the model — expect the model long in the gas buckets and short ~3.7 GW in Cogen, documented).add_electricity.load_powerplantsexactly on the model side — which makes visible (by design) that the model pins existing plants to a 2100 retirement and does not honor announced retirements. Note also a genuine boundary case in the CPUC data: both Diablo Canyon units carry RetireDates of 2029-10/2030-10 and therefore exit CPUC's own 2030 column.Real-workbook sanity (2030, CA): CAISO 103.0 GW / LADWP 10.3 / NCNC 6.7 / IID 2.9; e.g. Battery 25.0 GW, Solar 30.8 GW, Gas CC 23.1 GW totals — table in the script's tests/docstring lineage.
Testing
pytest -m fast: 195 passed, 1 pre-existing skip (combined stack).test_benchmark_cpuc_baseline.py— 22 passed (header layout, vintage boundary cases, unmapped-tech reporting, CAISO roll-up; plus a guard asserting the tech map covers every carrier inconstants.EIA_TECH_MAPso new carriers can't silently vanish).--until benchmark_cpuc_baselinepulls the workbook retrieve rule.Checklist
pre-commitandpytest -m fastpass locally.workflow/envs/environment.yaml(no dependency changes).workflow/repo_data/config/config.default.yaml.docs/source/configtables/*.csv.🤖 Generated with Claude Code