Skip to content

Commit

Permalink
Fix faulty skip MAGICC logic
Browse files Browse the repository at this point in the history
  • Loading branch information
phackstock committed Sep 12, 2024
1 parent 26ef36a commit 8a048d9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,26 @@ def main(df: pyam.IamDataFrame) -> pyam.IamDataFrame:

# Run the validation and region-processing
dsd = DataStructureDefinition(here / "definitions")
processors = [RegionProcessor.from_directory(path=here / "mappings", dsd=dsd)]
region_processor = RegionProcessor.from_directory(
path=here / "mappings",
dsd=dsd,
)
if FOUND_MAGICC:
processors.append(
MAGICCProcessor(
run_type="complete",
magicc_worker_number=8,
)
magicc_processor = MAGICCProcessor(
run_type="complete",
magicc_worker_number=8,
)
try:
return process(df, dsd, processor=processors)
return process(
df,
dsd,
processor=[region_processor, magicc_processor],
)
except Exception as e:
log.warning(
(
"Error with MAGICC processing, repeat processing without MAGICC, "
f"details: {e}"
)
)
return process(df, dsd, processor=processors)
return process(df, dsd, processor=region_processor)

0 comments on commit 8a048d9

Please sign in to comment.