From 95c59027a66102ad52a80baee9c9a402cae7ad9b Mon Sep 17 00:00:00 2001 From: Daniel Huppmann Date: Mon, 19 Feb 2024 12:31:43 +0100 Subject: [PATCH] Add mappings and scenario validation to workflow (#2) --- definitions/scenario/scenarios.yaml | 186 ++++++++++++++++++++++++++++ nomenclature.yaml | 2 + workflow.py | 8 +- 3 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 definitions/scenario/scenarios.yaml diff --git a/definitions/scenario/scenarios.yaml b/definitions/scenario/scenarios.yaml new file mode 100644 index 0000000..c929171 --- /dev/null +++ b/definitions/scenario/scenarios.yaml @@ -0,0 +1,186 @@ +# Valid scenario names for the ECEMF project + +# ECEMF - Diagnostic scenarios + +# Baseline scenario and current policy +- DIAG-Base +- DIAG-NPI + +# Pure carbon pricing/GHG target scenarios +- DIAG-C80-gr5 +- DIAG-C0to80-gr5 +- DIAG-C400-lin +- DIAG-NZero + +# Technology Constraint scenarios +- DIAG-C400-lin-LimBio +- DIAG-C400-lin-LimCCS +- DIAG-C400-lin-LimNuclear + +# Paradigm Shift scenarios +- DIAG-C400-lin-HighVRE +- DIAG-C400-lin-HighElectrification +- DIAG-C400-lin-HighElec-Supply +- DIAG-C400-lin-HighH2 +- DIAG-C400-lin-ResidualFossil +- DIAG-C400-lin-HighEff + +# ECEMF - Work package 1 Net-zero scenarios +- WP1 NPI +- WP1 NetZero +- WP1 NetZero-LimBio +- WP1 NetZero-LimCCS +- WP1 NetZero-LimNuc +- WP1 NetZero-ElecPush +- WP1 NetZero-H2Push +- WP1 NetZero-SynfPush +- WP1 NetZero-HighEfficiency + +# ECEMF - Work package 2 +- WP2 Boundary Condition|Initial +- WP2 Boundary Condition|Updated|1 +- WP2 Boundary Condition|Updated|2 +- WP2 Boundary Condition|Updated|3 +- WP2 Boundary Condition|Updated|4 +- WP2 Boundary Condition|Updated|5 +- WP2 Sensitivity|High Electricity Price +- WP2 Sensitivity|Low Electricity Price +- WP2 Sensitivity|High Gas and Liquids Price +- WP2 Sensitivity|High Price +- WP2 Sensitivity|Low Price + +# ECEMF - Work package 2 main transport scenarios +- WP2 Transport|High Electrification|Efficiency Moderate +- WP2 Transport|High Electrification|Efficiency High +- WP2 Transport|High Electrification|Lifestyle and Behavioral Change +- WP2 Transport|High H2/e-fuels|Efficiency Moderate +- WP2 Transport|High H2/e-fuels|Efficiency High +- WP2 Transport|High H2/e-fuels|Lifestyle and Behavioral Change + +- WP2 Transport|High Electrification|Efficiency Moderate|v02 +- WP2 Transport|High Electrification|Efficiency High|v02 +- WP2 Transport|High Electrification|Lifestyle and Behavioral Change|v02 +- WP2 Transport|High H2/e-fuels|Efficiency Moderate|v02 +- WP2 Transport|High H2/e-fuels|Efficiency High|v02 +- WP2 Transport|High H2/e-fuels|Lifestyle and Behavioral Change|v02 + +# ECEMF - Work package 2 main industry scenarios +- WP2 Industry|High Electrification|Efficiency Moderate +- WP2 Industry|High Electrification|Efficiency High +- WP2 Industry|High Electrification|Lifestyle and Behavioral Change +- WP2 Industry|High H2/e-fuels|Efficiency Moderate +- WP2 Industry|High H2/e-fuels|Efficiency High +- WP2 Industry|High H2/e-fuels|Lifestyle and Behavioral Change + +- WP2 Industry|High Electrification|Efficiency Moderate|v02 +- WP2 Industry|High Electrification|Efficiency High|v02 +- WP2 Industry|High Electrification|Lifestyle and Behavioral Change|v02 +- WP2 Industry|High H2/e-fuels|Efficiency Moderate|v02 +- WP2 Industry|High H2/e-fuels|Efficiency High|v02 +- WP2 Industry|High H2/e-fuels|Lifestyle and Behavioral Change|v02 + +# ECEMF - Work package 2 main buildings scenarios +- WP2 Building|High Electrification|Efficiency Moderate +- WP2 Building|High Electrification|Efficiency High +- WP2 Building|High Electrification|Lifestyle and Behavioral Change +- WP2 Building|High H2/e-fuels|Efficiency Moderate +- WP2 Building|High H2/e-fuels|Efficiency High +- WP2 Building|High District Heating|Efficiency Moderate +- WP2 Building|High District Heating|Efficiency High + +- WP2 Building|High Electrification|Efficiency Moderate|v02 +- WP2 Building|High Electrification|Efficiency High|v02 +- WP2 Building|High Electrification|Lifestyle and Behavioral Change|v02 +- WP2 Building|High H2/e-fuels|Efficiency Moderate|v02 +- WP2 Building|High H2/e-fuels|Efficiency High|v02 +- WP2 Building|High District Heating|Efficiency Moderate|v02 +- WP2 Building|High District Heating|Efficiency High|v02 + +# ECEMF - Work package 2 main transport scenarios with updated prices +- WP2 Transport|High Electrification|Efficiency Moderate|Prices 2023_10 +- WP2 Transport|High Electrification|Efficiency High|Prices 2023_10 +- WP2 Transport|High Electrification|Lifestyle and Behavioral Change|Prices 2023_10 +- WP2 Transport|High H2/e-fuels|Efficiency Moderate|Prices 2023_10 +- WP2 Transport|High H2/e-fuels|Efficiency High|Prices 2023_10 +- WP2 Transport|High H2/e-fuels|Lifestyle and Behavioral Change|Prices 2023_10 + +# ECEMF - Work package 2 main industry scenarios with updated prices +- WP2 Industry|High Electrification|Efficiency Moderate|Prices 2023_10 +- WP2 Industry|High Electrification|Efficiency High|Prices 2023_10 +- WP2 Industry|High Electrification|Lifestyle and Behavioral Change|Prices 2023_10 +- WP2 Industry|High H2/e-fuels|Efficiency Moderate|Prices 2023_10 +- WP2 Industry|High H2/e-fuels|Efficiency High|Prices 2023_10 +- WP2 Industry|High H2/e-fuels|Lifestyle and Behavioral Change|Prices 2023_10 + +# ECEMF - Work package 2 main buildings scenarios with updated prices +- WP2 Building|High Electrification|Efficiency Moderate|Prices 2023_10 +- WP2 Building|High Electrification|Efficiency High|Prices 2023_10 +- WP2 Building|High Electrification|Lifestyle and Behavioral Change|Prices 2023_10 +- WP2 Building|High H2/e-fuels|Efficiency Moderate|Prices 2023_10 +- WP2 Building|High H2/e-fuels|Efficiency High|Prices 2023_10 +- WP2 Building|High District Heating|Efficiency Moderate|Prices 2023_10 +- WP2 Building|High District Heating|Efficiency High|Prices 2023_10 + +# EMF-ECEMF collaboration scenarios +- EMFECEMF_NZero +- EMFECEMF_NPI + +# ECEMF - Work package 3 task 3.2 scenarios +- WP3_Task3.2|Infrastructures|Medium EV flexibility +- WP3_Task3.2|Infrastructures|High EV flexibility +- WP3_Task3.2|Infrastructures|Conservative EV flexibility + +# ECEMF - Work package 5 task 5.1 trade limitation scenarios (<= initial scenario names, deprecated) +- WP5 Default-2C +- WP5 Default-15C +- WP5 Short-OECD-2C +- WP5 Short-OECD-15C +- WP5 Long-OECD-2C +- WP5 Long-OECD-15C +- WP5 Short-Groups-2C +- WP5 Short-Groups-15C +- WP5 Long-Groups-2C +- WP5 Long-Groups-15C + +# ECEMF - Work package 5 task 5.1 trade limitation scenarios (<= new scenario names) +- WP5 Default-650 +- WP5 Default-1150 +- WP5 Russia-650 +- WP5 Russia-1150 +- WP5 EastWest-650 +- WP5 EastWest-1150 +- WP5 EastWestTech-650 +- WP5 EastWestTech-1150 + +# ECEMF - Work package 5 task 5.3 +- WP5 Base +- WP5 OPT-MIX +- WP5 RAP-MIX +- WP5 OPT-CP +- WP5 RAP-CP +- WP5 OPT-REG +- WP5 RAP-REG +- WP5 OPT-MIX-LimBio +- WP5 RAP-MIX-LimBio +- WP5 OPT-CP-LimBio +- WP5 RAP-CP-LimBio +- WP5 OPT-REG-LimBio +- WP5 RAP-REG-LimBio +- WP5 OPT-MIX-LimCCS +- WP5 RAP-MIX-LimCCS +- WP5 OPT-CP-LimCCS +- WP5 RAP-CP-LimCCS +- WP5 OPT-REG-LimCCS +- WP5 RAP-REG-LimCCS +- WP5 OPT-MIX-LimNuc +- WP5 RAP-MIX-LimNuc +- WP5 OPT-CP-LimNuc +- WP5 RAP-CP-LimNuc +- WP5 OPT-REG-LimNuc +- WP5 RAP-REG-LimNuc +- WP5 OPT-MIX-LimRES +- WP5 RAP-MIX-LimRES +- WP5 OPT-CP-LimRES +- WP5 RAP-CP-LimRES +- WP5 OPT-REG-LimRES +- WP5 RAP-REG-LimRES diff --git a/nomenclature.yaml b/nomenclature.yaml index 0b8e3a5..330c6e6 100644 --- a/nomenclature.yaml +++ b/nomenclature.yaml @@ -6,3 +6,5 @@ definitions: repository: openENTRANCE region: repository: openENTRANCE +mappings: + repository: openENTRANCE diff --git a/workflow.py b/workflow.py index c85f21b..3106b90 100644 --- a/workflow.py +++ b/workflow.py @@ -10,6 +10,10 @@ def main(df: pyam.IamDataFrame) -> pyam.IamDataFrame: """Project/instance-specific workflow for scenario processing""" # Run the validation and region-processing - dsd = DataStructureDefinition(here / "definitions") + dsd = DataStructureDefinition( + here / "definitions", dimensions=["scenario", "region", "variable"] + ) processor = RegionProcessor.from_directory(path=here / "mappings", dsd=dsd) - return process(df, dsd, processor=processor) + df = process(df, dsd, processor=processor) + + return df