You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just gave it a trial by fire on my actual data, and found a bug. My data already has units stored in the attributes, written like 'm^2' and so on.
But the quantify method fails with ValueError: Integers to negative integer powers are not allowed when I try to convert something like m^-1. Turns out this is pint, not pint-xarray:
@jthielen maybe you know a good reason why it does this? I can't see one...
But it seems it can be solved just by using parse_units instead of parse_expression in _decide_units. I think that's the more appropriate choice of method to call anyway - if we're parsing the str attribute of a DataArray we expect to be parsing a unit, not a mathematical expression.
The text was updated successfully, but these errors were encountered:
Well done on releasing this guys!
I just gave it a trial by fire on my actual data, and found a bug. My data already has units stored in the attributes, written like
'm^2'
and so on.But the
quantify
method fails withValueError: Integers to negative integer powers are not allowed
when I try to convert something likem^-1
. Turns out this is pint, not pint-xarray:@jthielen maybe you know a good reason why it does this? I can't see one...
But it seems it can be solved just by using
parse_units
instead ofparse_expression
in_decide_units
. I think that's the more appropriate choice of method to call anyway - if we're parsing the str attribute of a DataArray we expect to be parsing a unit, not a mathematical expression.The text was updated successfully, but these errors were encountered: