Skip to content

Fix new entrant renaming - #144

Draft
EllieKallmier wants to merge 4 commits into
mainfrom
fix-new-entrant-renaming
Draft

Fix new entrant renaming#144
EllieKallmier wants to merge 4 commits into
mainfrom
fix-new-entrant-renaming

Conversation

@EllieKallmier

Copy link
Copy Markdown
Member

Reworked the new entrants' renaming after regional granularity collapse/aggregation.

Previously: was just setting the new names to a standard '{geo_id} {technology}' formula; this lost some detail for units whose pre-collapse naming convention had different structures for representing technologies. Wasn't causing bugs or issues at this stage - but for mapping against constraints from plexos files or other AEMO-sourced name-keyed values, losing the names' structure had potential to be annoying AND was an easy fix. (+ keeps consistent with non-renamed units e.g. those in REZs).

Now: the actual 'old' geo_id string in a unit name gets re-keyed to the new geo_id (collapsed), keeping the rest of the name as-is. The first 'name' value for each collapsed-group is kept upon aggregation; this is the name that gets used to re-key. This implementation does assume that the naming convention for aggregated units (grouped on technology, geo_id and optionally resource_type) is the same for all units in each group, and that the 'new' geo_id is correctly assigned regardless of the old geo_id-like string prefix in each name. Based on current 7.5 workbook data this holds. Special case 'BOTN - Cethana' doesn't get aggregated with anything else so name gets passed through unchanged.

Example to illustrate the difference:

Original name Technology New geo_id Prev version 'name' New version 'name'
CSA Biomass Biomass SA SA Biomass SA Biomass
SNW OCGT Large OCGT (large GT) NSW NSW OCGT (large GT) NSW OCGT Large
SQ Battery - 2h Battery Storage (2hrs storage) QLD QLD Battery Storage (2hrs storage) QLD Battery - 2h

Built off #143

…move some functions to helpers, pull in required tables
…tor shared helpers

Functions (and mappings) that were shared/very similar across new_entrants templater module are pulled out and gently refactored to become generic helpers.
@EllieKallmier EllieKallmier added the module: templater Covers contents of `templater` module label Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.34641% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ispypsa/templater/helpers.py 98.07% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/ispypsa/iasr_table_caching/local_cache.py 74.28% <ø> (ø)
src/ispypsa/templater/create_template.py 93.25% <100.00%> (+0.23%) ⬆️
src/ispypsa/templater/existing_planned.py 100.00% <100.00%> (ø)
src/ispypsa/templater/geography.py 93.93% <ø> (-0.80%) ⬇️
src/ispypsa/templater/mappings.py 100.00% <100.00%> (ø)
src/ispypsa/templater/new_entrants.py 100.00% <100.00%> (ø)
src/ispypsa/templater/transmission.py 98.80% <100.00%> (ø)
src/ispypsa/templater/helpers.py 99.45% <98.07%> (-0.55%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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