Skip to content

Commit

Permalink
Adjust aggregation for pyam 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
phackstock committed Feb 9, 2024
1 parent be0af46 commit e7a8a1f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nomenclature/processor/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,12 @@ def _aggregate_region(df, var, *regions, **kwargs):
try:
return df.aggregate_region(var, *regions, **kwargs)
except ValueError as error:
if str(error) == "Inconsistent index between variable and weight!":
if str(error).startswith("Missing weights for the following data"):
logger.info(
f"Could not aggregate '{var}' for region '{regions[0]}' ({kwargs})"
(
f"Could not aggregate '{var}' for region '{regions[0]}' "
f"({kwargs})\nerror: {error}"
)
)
else:
raise error
Expand Down

0 comments on commit e7a8a1f

Please sign in to comment.