Closed
Description
When pint_xarray is imported it sets pint.application_registry.force_ndarray_like = True
Once this is done rounding Quantities raises an exception because ndarrays have no round method.
import pint
UREG = pint.UnitRegistry()
pint.set_application_registry(UREG)
round(UREG.Quantity('1.378533532 m'))
<Quantity(1.0, 'meter')>
import pint_xarray
round(UREG.Quantity('1.378533532 m'))
Traceback (most recent call last):
Python Shell, prompt 6, line 1
# Used internally for debug sandbox under external interpreter
File "E:\Envs\xarray311\Lib\site-packages\pint\facets\plain\quantity.py", line 1395, in __round__
return self.__class__(round(self._magnitude, ndigits=ndigits), self._units)
builtins.TypeError: type numpy.ndarray doesn't define __round__ method
Metadata
Metadata
Assignees
Labels
No labels