Skip to content

Commit

Permalink
Use getattr() per suggestion by @phackstock
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Feb 22, 2024
1 parent afc3574 commit 0da2f88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyam/ixmp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def write_to_ixmp4(platform: ixmp4.Platform | str, df):
("regions", df.region, RegionModel),
("units", df.unit, UnitModel),
]:
platform_values = platform.__getattribute__(dimension).tabulate().name.values
platform_values = getattr(platform, dimension).tabulate().name.values
if missing := set(values).difference(platform_values):
raise model.NotFound(
", ".join(missing)
Expand Down

0 comments on commit 0da2f88

Please sign in to comment.