sanitary-issues: utils.py with EU27 codes, country name mapping, README stats docs, fix copilot-instructions Code Structure#8
Merged
maxnutz merged 4 commits into5-create-minimal-set-of-variable-functions-for-final-energyfrom Mar 20, 2026
Conversation
…EADME docs, fix copilot-instructions Code Structure Co-authored-by: maxnutz <81740567+maxnutz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create utils.py and integrate EU27 country codes
sanitary-issues: utils.py with EU27 codes, country name mapping, README stats docs, fix copilot-instructions Code Structure
Mar 20, 2026
maxnutz
reviewed
Mar 20, 2026
Owner
maxnutz
left a comment
There was a problem hiding this comment.
All review changes already directly integrated in last commits.
b373eb3
into
5-create-minimal-set-of-variable-functions-for-final-energy
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.
Several housekeeping items: new
utils.pyfor shared static data, EU27 country code → full name resolution inpyam.IamDataFrame, documentation for the statistics function contract, and corrected Code Structure diagram in copilot instructions.Changes
pypsa_validation_processing/utils.py(new)EU27 member state mapping (ISO 2-letter → full name) plus
"EU27_{year}"aggregate, mirroring theeurostat-energy-balance_processingsister package.class_definitions.pyResolves the long-standing
TODO—region=self.countryis replaced with a lookup againstEU27_COUNTRY_CODES:Falls back to the raw code if not in the mapping.
README.mdNew Variable Statistics section documenting the fixed function contract:
|→__, spaces →_n: pypsa.Networkpd.Serieswith multi-level index including a"unit"levelmapping.default.yaml.github/copilot-instructions.md(Code Structure section only)utils.pynode to the class diagramstructure_pyan_from_pandas→structure_pyam_from_pandas,calculate_variable_values→calculate_variables_valuesdsd_with_values: dict→dsd_with_values: pyam.IamDataFrame | None_postprocess_statistics_result()methodtests/test_utils.py(new)Unit tests for
EU27_COUNTRY_CODEScompleteness, sample values, aggregate key, and type constraints.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.