Skip to content

Fix p48107 z3109 hierarchy mappings - #179

Draft
yrasool wants to merge 3 commits into
ReEDS-Model:mainfrom
yrasool:codex/fix-z3109-nercr-typo
Draft

Fix p48107 z3109 hierarchy mappings#179
yrasool wants to merge 3 commits into
ReEDS-Model:mainfrom
yrasool:codex/fix-z3109-nercr-typo

Conversation

@yrasool

@yrasool yrasool commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Fix the p48107 mappings in inputs/zones/z3109/hierarchy.csv:

  • transgrp: SPP to SPP_South
  • nercr: SPP_South to SPP

This aligns Crosby County with other Texas SPP counties and prevents the PRM broadcast KeyError.

Issues resolved

Closes #155.

Comparison

Main

Main z3109 hierarchy map

PR #179

PR z3109 hierarchy map

Difference

Difference map

Only p48107 changes.

Validation, testing, and comparison report(s)

  • p48107 now matches TX_PAN in inputs/zones/z90/hierarchy.csv, the only other zone set that resolves Crosby County on its own. The one-county SPP transgrp and the SPP_South nercr were unique to z3109.
  • inputs/reserves/prm_annual.csv covers exactly the 15 nercr values in z3109 after the change, so both PRM scenarios broadcast for all 3,109 regions.
  • The transgrp change alters the md5 that keys SPP_South in itl_NARIS.csv, which broke get_itls(level='transgrp') on 04cbe2e; 6864ee6 updates the z3109 interface and ITL data to match. All 233 transgrp interfaces across the nine zone sets and all 6,864 z3109 r-level interfaces resolve. Details in the comment below.

Checklist for author

  • Included comparison reports for appropriate test cases
  • Units are specified
  • If spatially resolved inputs are modified, maps of before, after, and difference are included in the PR description

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Yes. Codex and Claude Code assisted with reviewing the issue, checking the change against the other zone sets, and diagnosing the CI failure. I reviewed the diff, the figures, and the diagnosis.

@louisaserpe louisaserpe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to the repo! Although this is a very small change, it would be great if you could add a few figures comparing main to your branch in the PR text . The ReEDS documentation has some instructions on how to use a python helper script the team developed to do this.

Comment thread inputs/zones/z3109/hierarchy.csv Outdated
p48075,TX,texas,ERCOT,ERCOT,ERCOT,ERCOT
p48101,TX,texas,ERCOT,ERCOT,ERCOT,ERCOT
p48107,TX,eastern,SPP,SPP,SPP_South,SPP
p48107,TX,eastern,SPP,SPP,SPP,SPP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mention this in #155, but the transgrp column for this row also needs to be updated from SPP to SPP_South. Would you be willing to add this change to your PR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thank you for the detailed infromation. I updated p48107 to transgrp=SPP_South and nercr=SPP, and added main, branch, and difference maps to the PR description.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note on CI: the previous run failed because the Linux runner received a GAMS license with the wrong platform code, so it appears unrelated to this CSV change. The new run is marked action_required and has not started. Could you approve it and check whether the Linux GAMS license needs to be updated?

@yrasool
yrasool force-pushed the codex/fix-z3109-nercr-typo branch from acb2f66 to 04cbe2e Compare August 13, 2026 18:38
@yrasool yrasool changed the title Fix z3109 NERC region typo Fix p48107 z3109 hierarchy mappings Aug 13, 2026
Moving p48107 into the SPP_South transgrp changes the county set that
defines SPP_South, and its md5 identifier along with it, so the existing
SPP_South rows in itl_NARIS.csv no longer match. It also empties the
single-county SPP transgrp.

Drop the SPP~~SPP_South interface and re-key the four SPP_South ITLs to
the new identifier. p48107 only connects to SPP_South counties, so the
MISO and SPP_North limits are carried over unchanged.
@yrasool

yrasool commented Aug 19, 2026

Copy link
Copy Markdown
Author

The run on 04cbe2e failed for a real reason, not the license:

KeyError: 'Missing data from itl_NARIS.csv for 5 interfaces: MISO_Central~~SPP_South MISO_North~~SPP_South MISO_South~~SPP_South SPP_North~~SPP_South SPP~~SPP_South'

get_interface_data(level='transgrp') keys itl_NARIS.csv by the md5 of each transgrp's sorted county list, so moving p48107 into SPP_South changes that key (b4f55cbf... to 1960b99d...) and empties the one-county SPP transgrp. The database was built with p48107 as its own transgrp - it holds an SPP/SPP_South row of 1.6/152.4 MW keyed to the md5 of 48107 alone - so the move also drops that limit.

6864ee6 updates the data to match: removes eastern,SPP~~SPP_South from interfaces_transgrp.csv and re-keys the four SPP_South rows to 1960b99def1a13feb78f50b29ce7ca6d, MW unchanged. p48107's only AC neighbours are p48153, p48303 and p48305, all already in SPP_South, so its limits to MISO and SPP_North should be unaffected - though I can't verify that without the ITL calculation. It is a separate commit: drop it if you would rather regenerate the z3109 files and I'll rebase onto them.

All 26 z3109 transgrp interfaces and 6,864 r-level interfaces now resolve, and the other eight zone sets are unchanged. The nercr half touches no hash.

@patrickbrown4 per the transmission contact list.

Comment on lines +8271 to +8274
b58d220cfbab796fd585a74aca120d9f,1960b99def1a13feb78f50b29ce7ca6d,4049.1,3231.1
8118e512d9fd831209306eefc5413d00,1960b99def1a13feb78f50b29ce7ca6d,2720.7,2671.8
b6459abf9bf881b24677402779f56188,1960b99def1a13feb78f50b29ce7ca6d,960.0,1026.0
f274e3c309643ec75c40f961c2db5865,1960b99def1a13feb78f50b29ce7ca6d,2063.2,2131.3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be recalculated rather than duplicated. I'll rerun them and push the updated values.

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.

Typo in z3109/hierarchy.csv

3 participants