Skip to content

Commit

Permalink
Add RegionCode to region codelist
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Mar 1, 2024
1 parent 35bb33c commit d08cc13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path
import pyam
from nomenclature import DataStructureDefinition, RegionProcessor, process
from nomenclature.codelist import RegionCode


here = Path(__file__).absolute().parent
Expand Down Expand Up @@ -28,7 +29,7 @@ def main(df: pyam.IamDataFrame) -> pyam.IamDataFrame:
elif len(r_split) == 2:
if all([_r in dsd.region for _r in r_split]):
# add the directional-region to the codelist (without attributes)
dsd.region[r] = None
dsd.region[r] = RegionCode(name=r, hierarchy="directional")

# run the validation and region-processing
df = process(df, dsd, processor=processor)
Expand Down

0 comments on commit d08cc13

Please sign in to comment.