pyam icon indicating copy to clipboard operation
pyam copied to clipboard

Unit-conversion on non-existing data does not raise DimensionalityError

Open danielhuppmann opened this issue 10 months ago • 0 comments

The pint-package (used by the convert_unit() method) raises a dimensionality error if the units cannot be converted.

However, if a user applies the method convert_unit("source_unit", "target_unit") and the IamDataFrame does not have any data with "source_unit" the validation is skipped.

It would be safer to check whether a unit-conversion is valid even if no data exists.

danielhuppmann avatar Aug 29 '23 06:08 danielhuppmann