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.
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.