Skip to content

feat(config): maintained California configuration on SERVM demand + docs + phase-2/3 stubs (CPUC stack 4/5) - #799

Closed
ktehranchi wants to merge 3 commits into
feat/servm-demandfrom
feat/servm-california
Closed

ktehranchi wants to merge 3 commits into
feat/servm-demandfrom
feat/servm-california

Conversation

@ktehranchi

Copy link
Copy Markdown
Collaborator

Stacks on #798 and merges #797 (base is set to feat/servm-demand, so this diff also shows #797's commits until the stack merges; retarget as the stack lands).

Changes proposed in this Pull Request

  • workflow/repo_data/config/config.california.yaml — maintained CA-only model: western + model_topology.include: {reeds_state: ['CA']}, ReEDS transport network at reeds_zone (clusters 4 = p8–p11), planning_horizons: [2030, 2035, 2040, 2045], profile: servm with servm_weather_years: [2019] = renewable_weather_years, imports/exports enabled (wholesale costs, per-flowgate NARIS caps, 25 %-of-annual-load volume limit) and interface_transmission_limits: true (the feat(solve): aggregate interface transmission limits (RESOLVE CAISO import/export caps) (CPUC stack 3/5) #797 aggregate CAISO caps). A commented county-resolution block documents the finer-grained variant.
  • County resolution is tested, not just documented: the DAG dry-run harness gained override support, and a county-mode case verifies topological_boundaries: county resolves end-to-end (58 county clusters, county NARIS flowgates file).
  • config.test.california.yaml + tests/integration/test_servm_demand_artifacts.py — CA integration harness (full 8760-h year: ReadServm maps strips positionally and requires full-year snapshots; kept cheap via simpl 20 / clusters 4m).
  • Phase-2 stub: conventional.ambient_derate config block (default off) with a NotImplementedError guard in add_electricity.py — reserves the design for CPUC unit-level ambient-temperature derating (must replace the seasonal step derate, never stack with ucap); retrieve-rule name reserved in retrieve.smk.
  • Docs: SERVM section in data-demand.md (region mapping, weather-year semantics, PST timezone, both calendar caveats, VEA note); interface-limit constraint section in model-constraints.md + data note in data-transmission.md (incl. the p8 links-only gap); config-spatial.md CA example extended; configtables rows corrected (transmission_interface_limits is no longer "reserved/unused"); release-notes entry.

Testing

  • Tier A pytest -m fast: 195 passed, 1 pre-existing skip (combined stack).
  • tests/static tests/docs: 117 passed including 3 new CA dry-run cases (reeds_zone cluster/solve + county mode).
  • tests/integration --collect-only: 32 collected (+14 new). Tier B was not executed in this session — the first real run downloads a 118 MB CPUC CSV and builds a full-year CA network; flagging per the larger-change rule. No equivalence run for this branch (new config; shipped defaults unchanged except additive keys).

Checklist

  • I tested my contribution locally and it seems to work fine.
  • pre-commit and pytest -m fast pass locally.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to workflow/envs/environment.yaml (no dependency changes).
  • Changes in configuration options are added in workflow/repo_data/config/config.default.yaml.
  • Changes in configuration options are also documented in docs/source/configtables/*.csv.

🤖 Generated with Claude Code

ktehranchi and others added 3 commits August 29, 2026 15:10
…p, PR 3)

Rewires the two dead config keys `model_topology.interface_transmission_limits`
and `electricity.transmission_interface_limits`: the RESOLVE interface table is
now applied as a per-snapshot MW cap on the aggregate flow across each
interface.

Scope is the electricity import/export Links added by add_extra_components, so
the constraint is inert when trade is disabled. Region_2 entries that are inside
the network contribute no trade links, so internal AC lines escape the cap; that
understatement is documented in the module, not corrected here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ubs (PR 4)

Ties the SERVM demand profile (PR 2) and the aggregate interface transmission
limits (PR 3) together into a runnable, maintained California entry point.

New `workflow/repo_data/config/config.california.yaml`: CA-only Western model
on CPUC SERVM 2026 demand, at REeDS-zone resolution (clusters must be 4 — the
ReEDS backbone cannot cluster below the four CA zones p8/p9/p10/p11), with
planning horizons restricted to SERVM forecast years (2030/2035/2040/2045),
the RESOLVE CAISO interface caps switched on, and imports/exports enabled at a
25%-of-demand annual volume limit. A clearly-marked commented alternative
carries the county-resolution variant (clusters: 58, simpl: 'county'); the
county NARIS flowgate file is selected automatically by
`add_extra_components` from `topological_boundaries`.

Phase-2 hook `conventional.ambient_derate` is stubbed in both the California
and default configs and guarded in `add_electricity`: enabling it raises
NotImplementedError rather than silently doing nothing. The comments record
that when implemented it REPLACES the EIA-860 seasonal derate and must never
stack with it or with a UCAP-derated capacity credit. `retrieve.smk` reserves
`retrieve_cpuc_thermal_derate` for the profiles it will need.

Tests: `config.test.california.yaml` is a SERVM variant of the CA test harness
config. It keeps a full 8760-hour snapshot year — `ReadServm._assign_snapshots`
maps its hourly strips positionally onto the network's own per-period snapshots
and raises unless the horizon carries exactly 8760, so a truncated window
cannot build SERVM demand. Three dry-run cases are added (california ->
cluster_network, california -> solve_network, and a county-mode case driven by
`--config` overrides), and `tests/integration/test_servm_demand_artifacts.py`
asserts weight conservation, demand/network alignment, and the PST->UTC roll
against a `--until add_demand` build.

Docs: a SERVM section in data-demand.md (source URL pattern, the nine forecast
years, the six regions and their balancing-area mapping including the CISO-VEA
exclusion, Net-Load-only dispatch with the component-resolved zonal artifact,
weather-year semantics, fixed PST, and both calendar caveats); the interface
constraint documented in model-constraints.md and data-transmission.md
including the p8 gap; the `transmission_interface_limits` config row corrected
from "not currently consumed"; a California example in config-spatial.md; and a
release-notes entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ktehranchi

Copy link
Copy Markdown
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 feat/cpuc-servm-california.

@ktehranchi ktehranchi closed this Aug 30, 2026
@ktehranchi
ktehranchi deleted the feat/servm-california branch August 30, 2026 01:44
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.

1 participant