-
-
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
Support cupy in as_shared_dtype #4232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was working on adding pint support, I was also thinking about that (but I can't seem to find the exact issue). In the end, we implemented option , since it normally doesn't matter which unit 0
and nan
have. However, this doesn't work with numpy.nanprod
where _replace_nan
is called with 1
. In the end I didn't try to implement this because I didn't want to add code that special-cases pint
(that is why e.g. DataArray.prod
is not supported with pint
arrays, yet).
With you also running into this issue it might make sense to generalize this: maybe get as_shared_dtype
to cast to a common type instead of always casting to numpy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one minor comment
…ay into as_shared_dtype_cupy
* upstream/master: Added xarrays-spatial and updated geoviews link (pydata#4262) update docs to point to xarray-contrib and xarray-tutorial (pydata#4252) Add release summary, some touch-ups (pydata#4217) CFTimeIndex calendar in repr (pydata#4092) fix the RTD timeouts (pydata#4254) update isort CI and pre-commit hook (pydata#4204)
Failed test is #4265 I'm merging so things can keep moving. |
This implements solution 2 for #4231.
cc @quasiben
isort -rc . && black . && mypy . && flake8