Skip to content

Commit

Permalink
Add a quickfix for a nomenclature-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Sep 18, 2023
1 parent ff91946 commit 4712cca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def main(df: pyam.IamDataFrame, dimensions=["region", "variable"]) -> pyam.IamDa
# validate the region and variable dimensions, apply region processing
df = process(df, definition, dimensions=dimensions, processor=processor)

# this is a quick-fix for https://github.com/IAMconsortium/nomenclature/issues/283
if invalid_regions := definition.region.validate_items(df.region):
raise ValueError(f"Invalid regions: {invalid_regions}")

# convert to subannual format if data provided in datetime format
if df.time_col == "time":
logger.info('Re-casting from "time" column to categorical "subannual" format')
Expand Down

0 comments on commit 4712cca

Please sign in to comment.