pyam
pyam copied to clipboard
Unit-conversion on non-existing data does not raise DimensionalityError
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.