-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need to update AbstractArray for duck arrays? #6845
Comments
I believe so. The other ones that uses |
Not sure, but maybe Also, my impression of |
Yeah I'm not sure what the expectation is but I was calling
OK that would suggest that the current behaviour is correct |
Probably out of my depth here (so please forgive me), but one thing that might be worth looking at is Array API support, which CuPy 10+ supports and Dask is working on support for ( dask/dask#8750 ). Believe XArray is taking some initial steps in this direction recently ( #6804 ), but could easily be misunderstanding the scope/intended usage of the changes there. |
My understanding is that if Is there actually a case where we need the library-specific version of a numpy function to work too?
(Having said all that we might still want to make this change anyway, this was just an argument for the current behaviour being "good enough".) |
👍 Question is whether we are expected to also make
Someone's going to try it =) . At least we should document what's expected. |
What happened?
I'm calling
cupy.round
on a DataArray wrapping a cupy array and it raises an error here:xarray/xarray/core/common.py
Lines 155 to 156 in 3f7cc2d
Traceback below:
What did you expect to happen?
Not an error? I'm not sure what's expected
np.round(dataarray)
does actually work successfully.My question is : Do we need to update
AbstractArray.__array__
to return the underlying duck array instead of always a numpy array?Minimal Complete Verifiable Example
No response
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment
xarray v2022.6.0
cupy 10.6.0
The text was updated successfully, but these errors were encountered: