-
|
""" http://xarray.pydata.org/en/stable/dask.html If my function passed to xr.apply_ufunc only encompasses numpy functions (e.g. np.mean), but does not explicitly call dask.array functions (e.g. dask.array.mean), will the above still apply; i.e. should I use dask='allowed' rather than 'parallelized'? Function similar to: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Some of that advice needs to be updated. Things like |
Beta Was this translation helpful? Give feedback.
Some of that advice needs to be updated.
Things like
np.meanwill dispatch todask.array.meanwith recent enough versions of dask/numpy (see NEP-18). Sodask="allowed"will work. This is easy to check: if the call toapply_ufuncends up computing it means some function is not compatible with dask arrays. Either avoid that function or usedask="parallelized"if appropriate (the function can be applied independently on each block of the dask array, and does not need communication between blocks).