Using apply_ufunc with dask='allowed' for a function with xarray operations #6796
-
I have a function that has xarray-based operations (e.g.,
Here is the call to
|
Beta Was this translation helpful? Give feedback.
Answered by
alessioarena
Jul 17, 2022
Replies: 1 comment 1 reply
-
Hi, if you are applying an xarray operation you should not need to apply it using dummy.rolling(time=2).mean().groupby('time.year').max() Should work fine. The only change you should make to have that being a dask operation is declaring your dataset as import dask.array as da
dummy = xr.DataArray(da.random.random([nt,ny,nx]),dims=['time','y','x'],
coords=[times,range(ny),range(nx)] ) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dcherian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, if you are applying an xarray operation you should not need to apply it using
apply_ufunc
. You can assume that all xarray operations will work with dask.In that specific case:
Should work fine.
The only change you should make to have that being a dask operation is declaring your dataset as