Skip to content

feat(solve): aggregate interface transmission limits (RESOLVE CAISO import/export caps) (CPUC stack 3/5) - #797

Closed
ktehranchi wants to merge 1 commit into
developfrom
feat/caiso-interface-limits
Closed

ktehranchi wants to merge 1 commit into
developfrom
feat/caiso-interface-limits

Conversation

@ktehranchi

Copy link
Copy Markdown
Collaborator

Part of the CPUC/SERVM California stack (independent of #796; consumed by the CA config in stack PR 4/5).

Changes proposed in this Pull Request

Rewires the previously-dead config pair model_topology.interface_transmission_limits (gate) and electricity.transmission_interface_limits (path to repo_data/config/policy_constraints/transmission_interface_limits.csv) into a live constraint:

  • workflow/scripts/opts/interfaces.py — per CSV row and direction, a per-snapshot cap on the sum of import/export Link flows crossing the interface: flow_21 caps imports into region_1, flow_12 caps exports out of it (orientation corroborated against known CAISO↔NW limits: CA_NW flow_12 = 3,592 MW matches the ~3.6 GW CAISO→NW export capability). Links are selected by bus membership + carrier, never by name parsing; external {zone}_imports buses are excluded from the inside-region set (they carry country=<zone>, which would otherwise leak them in via get_region_buses).
  • Gated call in solve_network.py extra_functionality; the CSV is declared as an input on solve_network and solve_network_validation.
  • Rows with no matching links log and skip, so the constraint is inert on networks without trade links or without the named zones.

Known, documented understatement: entries in region_2 that are inside the modeled network (e.g. p8 in a CA-only run) contribute no trade links, so internal AC lines (p8↔p9, ~300 MW) escape the links-only cap.

Testing

  • Tier A pytest -m fast: 195 passed, 1 pre-existing skip (combined stack).
  • New tests: test_interfaces.py6 passed (GLPK), including a binding-import-cap solve and a no-op run over the real shipped CSV.
  • Tier B not run for this PR. No equivalence run for this branch (constraint is dormant unless model_topology.interface_transmission_limits: true, which no shipped config sets until stack PR 4).

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 (keys already existed; behavior documented in stack PR 4's configtables/prose updates).
  • Changes in configuration options are also documented in docs/source/configtables/*.csv (arrives with stack PR 4).

🤖 Generated with Claude Code

…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>
@ktehranchi

Copy link
Copy Markdown
Collaborator Author

CI note: the fast-tests failures here are environmental, not from this diff — every failure is AssertionError: Solver glpk not installed (plus one downstream Optimization failed), hitting pre-existing test_policy/test_reserves cases that this PR does not touch (#796's diff is purely additive and fails identically). The CI workflow was re-enabled today after a long disabled period, and the runner environment for Tier A lacks the GLPK binary; there is no green develop baseline yet. Tier A passes locally with GLPK: 195 passed, 1 pre-existing skip. The e2e-tests failure is likewise infra ("Setup micromamba" step). Leaving the CI environment fix to the maintainers / the #794 CI work rather than folding it into this stack.

🤖 Generated with Claude Code

@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/caiso-interface-limits 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