Skip to content

Template new entrant regional granularity - #134

Open
EllieKallmier wants to merge 1 commit into
mainfrom
template-new-entrant-regional-granularity
Open

Template new entrant regional granularity#134
EllieKallmier wants to merge 1 commit into
mainfrom
template-new-entrant-regional-granularity

Conversation

@EllieKallmier

Copy link
Copy Markdown
Member

Adds functionality to collapse (aggregate) new entrant technologies to the model config's regional_granularity.

Changes live here:

src/ispypsa/templater/
├── new_entrants.py              ← _collapse_geo_id_to_granularity + orchestrators calling it as their final step
├── create_template.py           ← generators/storage_new_entrant + costs_connection now real template outputs
├── geography.py                 ← _build_geo_region_lookup, deduplicated here
└── transmission.py              ← ...(from here), now imports from geography.py

src/ispypsa/validation/schemas/
├── generators_new_entrant.yaml  ← drops fuel_price_mapping (see below) + LCF source table fix
└── storage_new_entrant.yaml     ← same LCF source table fix

src/ispypsa/iasr_table_caching/local_cache.py
                                 ← registers technology_specific_lcfs/locational_cost_factors (missed in prev PR)

Notes

  • The "WOO" duplicate sub-region option is an explicit named case. Real 7.5 data has one duplicate build option per sub-region for four gas technologies (e.g. "WOO OCGT Small" alongside "CNSW OCGT Small"). Rather than a
    weighted average that implicitly compensates for this, it drops the known rows by name and _assert_no_unexpected_duplicate_options raises on any other repeat (unexpected). Documented in comments on new_entrants_summary v7.5/7.8: NSA pumped-hydro rows have mismatched Regional build cost zone (CSA instead of NSA) [+workbook weirdness] #131.
  • fuel_price_mapping dropped from generators_new_entrant entirely, rather than carried through the collapse. It's not needed until fuel price templating exists - plan is to match fuel prices via geo_id +technology against a redesigned costs_fuel_prices table, now made easier/a more viable option with the planned wild-card schema thing. Two schemas will need matching updates when that happens: costs_fuel_prices.yaml and generators_existing_planned.yaml.
  • Merged rows are named "{geo_id} {technology}", except BOTN - Cethana, which keeps its real name.

Follow-ups for later

@EllieKallmier EllieKallmier added the module: templater Covers contents of `templater` module label Jul 23, 2026
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/ispypsa/templater/create_template.py 93.02% <100.00%> (ø)
src/ispypsa/templater/geography.py 94.73% <100.00%> (+0.79%) ⬆️
src/ispypsa/templater/new_entrants.py 100.00% <100.00%> (ø)
src/ispypsa/templater/transmission.py 98.80% <100.00%> (-0.03%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EllieKallmier
EllieKallmier force-pushed the template-new-entrant-regional-granularity branch from 9d72ba2 to 84f4039 Compare August 10, 2026 06:57
@EllieKallmier
EllieKallmier marked this pull request as ready for review August 10, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: templater Covers contents of `templater` module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant