Closed danielhuppmann closed 4 years ago
Following the refactoring of the convert_unit() function for GWP (see #361), converting the physical unit of a species (without changing the species) does not work any more unless also providing a GWP-context.
convert_unit()
TEST_DF = pd.DataFrame([ ['model_a', 'scen_a', 'World', 'Primary Energy', 'Mt CO2/yr', 1, 6.], ], columns=pyam.IAMC_IDX + [2005, 2010], ) pyam.IamDataFrame(TEST_DF).convert_unit('Mt CO2/yr', 'Gt CO2/yr')
raises an UndefinedUnitError.
UndefinedUnitError
This seems like a bug, because a context is shouldn't be necessary from first principles.
Good catch. It looks like this wasn't covered by any existing test, so the first step will be to add one. Will open a PR.
closing as implemented
Following the refactoring of the
convert_unit()
function for GWP (see #361), converting the physical unit of a species (without changing the species) does not work any more unless also providing a GWP-context.raises an
UndefinedUnitError
.This seems like a bug, because a context is shouldn't be necessary from first principles.