Closed jalder-usgs closed 2 months ago
Thanks for the report. That warning occurs if pint
discards the unit information implicitly, and is usually (but not always) a sign that something is going wrong.
Which version of pint
do you use? pint=0.24
, which was released a coupled of days ago to PyPI (not sure about conda-forge
), should not have this issue (it has a bunch of other issues regarding unit formatters, though).
Otherwise try in an environment with python<3.12
(e.g. python=3.11
). python=3.12
changed the way attribute lookup works (if I remember correctly), which meant that pint
had to adapt.
In other words, I think this is an issue within pint
.
Thanks, it was using pint=0.23.
I followed your suggestion and started with a fresh Conda environment using python=3.11 and it is good to go now.
pint=0.24.1
is out (which fixes the issues I mentioned above), so I'll close this.
I'm relatively new to xarray and pint, but the example isn't working as on the web page:
Running this sample locally gives this warning:
Here the .mean() function is stripping the quantified pint units (unlike the example web page). The values are clearly in the degC range, so dequantify() has been called under the hood, but basic DataArray functions like mean() shouldn't be dropping the pint units.