-
Notifications
You must be signed in to change notification settings - Fork 12
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
sum(min_count=1) raises an exception #52
Comments
Hi @yt87, thanks for the bug report with the minimal example. I can reproduce the same TypeError on my end locally too. My initial impression is that this might require some fixes on the dask side, I see some similar issues before, e.g. dask/dask#9315, that might point to some ufunc operations not working with a CuPy backend yet. If I run the following line without dask chunks, it seems to work: ds = xr.DataArray([1, 2, cupy.nan]).as_cupy().sum(min_count=1)
print(ds)
# <xarray.DataArray ()> Size: 8B
# array(3.) Do you need to do the ds = xr.DataArray([1, 2, np.nan]).chunk(dim_0=1).as_cupy().compute()
ds.sum(min_count=1) Though that assumes that your actual array isn't too large to fit in GPU memory. If it is too large, you might need to parallelize the |
It is
My use case: I have a large TYX array ~12GB. For some time values, all the data is missing, I want the sum to return nan. When there is some data available, I do want the actual value. Maybe an option is to drop the missing time frames beforehand. |
This fix seems to work for me:
What happens is that |
We do have to handle this in xarrsy. Can you open an issue there please |
The first line works, the second raises an exception
Versions:
Same thing with numpy 2.0.0
The text was updated successfully, but these errors were encountered: