What's the difference between dask=parallelized and dask=allowed in xarray's apply_ufunc? What's the difference between dask=parallelized and dask=allowed in xarray's apply_ufunc? numpy numpy

What's the difference between dask=parallelized and dask=allowed in xarray's apply_ufunc?


dask='allowed' means that you're applying a function that already knows how to handle dask arrays, e.g., a function written in terms of dask.array operations. In most cases, that does indeed mean that the function will operate on chunks one by one to lower memory usage, and will apply the computation in parallel.

dask='parallelized' requires more information from the user because it creates its own wrapper that allows the provided function to act on dask arrays, by using low-level dask.array functions like atop. With dask='parallelized', you can provide a function that only knows how to handle NumPy arrays, and xarray.apply_ufunc will extend it to handle dask arrays, too.