Template new entrant property merges#128
Open
EllieKallmier wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds merging in of 'property' values for new entrant storage and generation tables. These are the numeric values that map to 'technology' (see the *_PROPERTY_MAP dicts in mappings for full coverage of what's getting merged in here). Still not outputting the *_new_entrant tables from templater so not 100% wired in yet - coming in next PR(s) :)
Storage gets split up into pumped hydro and battery chunks to merge in properties whose values are in different tables, then recombines to return a unified 'storage' table still. There's a bit of special handling around BOTN - Cethana, which is the only 'named' new entrant unit and has some bespoke mappings (using 'name' rather than 'technology' to key). Happy to take suggestions on this handling and have opened up #127 issue to explore this in a bit more depth.
Where things live
src/ispypsa/templater/
├── new_entrants.py ← the two orchestrators + the merge machinery + BOTN handling
├── mappings.py ← the property maps (common, battery, PHES)
├── create_template.py ← storage templater now takes the full iasr_tables dict
└── helpers.py ← incidental: _fuzzy_map_to_canonical renamed (see below)
src/ispypsa/iasr_table_caching/local_cache.py ← register battery_properties + pumped_hydro
tests/test_workbook_table_cache/7.5/*.csv ← frozen cache gains the property tables
There's also an incidental rename of
_fuzzy_map_to_canonical->_fuzzy_map_to_allowed_valuesbecause it became more useful to kind of flexibly specify which set of strings to use as the 'choices' than explicitly say one is canon.LCF values to be merged in next :)