Skip to content

Bring PR #113 (flow-path timeslice tagging) commits onto main#118

Merged
nick-gorman merged 5 commits into
mainfrom
new-manually-extracted-tables
Jun 18, 2026
Merged

Bring PR #113 (flow-path timeslice tagging) commits onto main#118
nick-gorman merged 5 commits into
mainfrom
new-manually-extracted-tables

Conversation

@nick-gorman

Copy link
Copy Markdown
Member

PR #113 ("Tag flow-path limit timeslices with their region's demand condition")
was merged into the new-manually-extracted-tables branch instead of main, so
its commits never reached main. This PR brings that already-reviewed work
across — there are no new changes beyond what was in #113.

Commits:

  • Tag flow-path limit timeslices with their region's demand condition
  • Test region prefix on a corridor injected after aggregation
  • Document PR-description style in CLAUDE.md
  • Unit test _add_region_to_timeslices directly

🤖 Generated with Claude Code

nick-gorman and others added 5 commits June 10, 2026 13:36
The custom-constraints templater emits region-tagged timeslices
(qld_peak_demand etc.) lifted from PLEXOS, but the IASR-derived flow-path
limits carried region-agnostic ones (peak_demand). For intraregional links
that's harmless, but for interregional links the two tables couldn't be lined
up — it wasn't clear which region's demand condition a cross-region limit
belonged to.

The PLEXOS model resolves it consistently: a path's forward limit is tagged
with the destination region's demand condition and its reverse limit with the
origin region's, because the receiving region's load is what tightens the
limit. This applies that rule while the sub-regional limits are built (before
any granularity aggregation, so a REZ stays symmetric even when single_region
retargets its geo_to to NEM), prefixing each timeslice with the lowercased
region id so the flow-path and custom-constraint tables share one vocabulary.

See #109.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The region->region identities in _build_geo_region_lookup were unexercised. The
documented parallel-path injection case (CNSW-SNW) is intra-region, so it drops
out at nem_regions and nothing reached _add_region_to_timeslices with endpoints
that are already NEM regions. This pins that path: a cross-region corridor whose
only base sibling is suffixed is injected at nem_regions and must still read
forward=qld, reverse=nsw — which needs the identities to resolve NSW/QLD.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Captures the conventions used for this PR so future descriptions are
consistent: lead with the story, include a directory-tree diagram, flag the
non-obvious design choices, drop sections that say nothing distinctive, and keep
the tone dry and understated rather than effusive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This helper was only exercised through the end-to-end transmission template
test, so its error branch (a path endpoint missing from the geography) and its
all-rows-collapsed early return had no coverage, and any regression in the
forward/reverse region tagging would surface as a failure of the orchestrator
rather than the helper. Add direct tests for the happy path, the all-collapsed
passthrough, and the missing-geo ValueError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tag flow-path limit timeslices with their region's demand condition
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/ispypsa/templater/transmission.py 98.83% <100.00%> (+0.12%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nick-gorman nick-gorman merged commit 67a6809 into main Jun 18, 2026
15 checks passed
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