Open keewis opened 4 years ago
I think this is probably a good idea, assuming we figure out the type casting hierarchy challenge. Right now people often check for the existence of __array_function__
to indicate NumPy duck arrays, which clearly isn't quite right.
In the
pint
integration tests I tried to also test calling numpy functions on xarray objects (we provide methods for all of them).Some of these functions, like
numpy.median
,numpy.searchsorted
andnumpy.clip
, depend on__array_function__
(i.e. not__array_ufunc__
) to dispatch. However, neitherDataset
norDataArray
(norVariable
, I think?) define these protocols (see #3643).Should we define
__array_function__
on xarray objects?