Skip to content

Fix 2024 Interconnection Queue - #16

Open
Yunzhi-Chen wants to merge 5 commits into
mainfrom
yc/ixqueue-bugfix2024
Open

Fix 2024 Interconnection Queue#16
Yunzhi-Chen wants to merge 5 commits into
mainfrom
yc/ixqueue-bugfix2024

Conversation

@Yunzhi-Chen

@Yunzhi-Chen Yunzhi-Chen commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix two bugs in process_interconnection_queues.py that corrupted the county-level queue limits ReEDS consumes as cap_limit — one that silently dropped queues, one that double-counted capacity — and regenerate interconnection_queues_2024.csv accordingly. Also repoints the county mapping, which was broken against current ReEDS main.

Technical details

The two bugs

1 — counties matched on name instead of FIPS . Queues were matched to ReEDS counties on lowercased county name + state, with .str.lower() as the only normalisation. LBNL does not always use the ReEDS spelling — Louisiana is written Acadia Parish where ReEDS has acadia — so unmatched rows were dropped at the merge and their capacity vanished. Louisiana lost essentially its entire queue. Matching on LBNL's FIPS code fixes that, but that code is sometimes stale (Oglala Lakota SD reports 46113, current 46102) or several codes concatenated for multi-county projects (5301353023 = 53013 + 53023) — pure FIPS matching loses 99 rows / 20.2 GW that name matching had caught. So the fix is FIPS first, county name as fallback; the two methods' blind spots are complementary. Unmatched active capacity drops from 4.4% to 1.9%, the remainder being out of ReEDS scope (e.g. MX).

2 — t_2 double-counted the IA Executed queue. The final-year column was built as max(cap_t1, cap_t2) + cap_t1 rather than cap_t1 + cap_t2. The two live on separate rows and max() was being used to broadcast one onto the other, which only works when cap_t2 > cap_t1; otherwise the IA-Executed capacity was counted twice and cap_t2 disappeared (cap_t1=300, cap_t2=100 gave 600 instead of 400). The t_1 column was never affected.

How the fixes were verified

bugfix_comparison

Plot 2024 before bug fix:
image

Plot 2024 after bug fix:
image

Plot 2024 after - before bug fix:
image

LLM usage: Claude Code

Yunzhi-Chen and others added 5 commits August 26, 2026 11:25
ReEDS moved the county_name/state lookup from inputs/county2zone.csv to
inputs/zones/county_state.csv, so the script could no longer be run against a
current ReEDS checkout. Fall back to the new location, and allow the ReEDS
repo to be pointed at with REEDS_PATH instead of only the hardcoded default.

Co-Authored-By: Claude Opus 5 <[email protected]>
Same input file (lbnl_ix_queue_data_file_thru2024.xlsx) as before; only the
script changed. National 2030 cumulative queue moves 2,050 GW -> 1,976 GW
(-3.6%) and the county count rises as parishes and other counties whose LBNL
spelling did not match ReEDS are no longer silently dropped.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Yunzhi-Chen Yunzhi-Chen changed the title Fix 2024 Interconnection Queue- #15 Fix 2024 Interconnection Queue Aug 26, 2026
@Yunzhi-Chen
Yunzhi-Chen requested a review from atpham88 August 26, 2026 19:03

@atpham88 atpham88 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 fixing this Yunzhi. Just a few minor comments to clean up things and I think it's ready to merge. Can you also delete the 2023 file https://github.com/ReEDS-Model/ReEDS_Input_Processing/blob/main/interconnection_queues/inputs/queues_2023_clean_data_r1.xlsx? We don't need to keep it. It has different structure than versions 2024 and 2025 and we only need 2024 for the fix.

There are other things that I need clean up (handling of csp queues here and also I want to overhaul the plotting section to use matplotlib instead of altair but that's on me and I will open a clean up PR after both of your PRs are merged in).

queue_data = queue_data[1:]

county2zone = pd.read_csv(os.path.join(reeds_path,'inputs','county2zone.csv'))
county2zone_path = os.path.join(reeds_path,'inputs','county2zone.csv')

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 think we can just remove this and use county_state.csv in the zones folder.

active_queue_county = active_queue_county.dropna(subset=['FIPS'])
# Sum up the queue capacities by county, tech, and online year
if 'FIPS' in active_queue.columns:
fips_reported = 'p' + pd.to_numeric(active_queue['FIPS'], errors='coerce').map(

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.

Can just keep line 100-106 since it worked for both 2024 (2025 release year) and 2025 (2026 release year) versions and we only need 2024 version for the fix. I believe the count_name method was only needed for the 2023 version since there was no FIPS column in that version, but we can drop the 2023 version from this processing script anyway.

active_queue_county = active_queue_county.groupby(['FIPS','tech'])[year_range_str].sum().reset_index()

# Filter out tech to match with tg set in ReEDS
active_queue_county_filtered = active_queue_county[(active_queue_county['tech']=="battery") | (active_queue_county['tech']=="coal")

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.

this is not on you sorry but can you put all the techs in a list (`reeds_techset = ['battery','coal',....] then active_queue_county_filtered = active_queue_county[(active_queue_county['tech'].isin(reeds_techset)]' to avoid this long statement?

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.

2 participants