Skip to content

xr.map_blocks vs dask.array.map_blocks wrapping numpy function #6482

Answered by dcherian
aaronspring asked this question in Q&A
Discussion options

You must be logged in to vote

Please see https://docs.xarray.dev/en/stable/user-guide/dask.html#automatic-parallelization-with-apply-ufunc-and-map-blocks

xr.map_blocks does not wrap dask.array.map_blocks. xr.apply_ufunc(..., dask="parallelized") wraps dask.array.apply_gufunc which ends up being equivalent to dask.array.map_blocks.

The underlying function you're using is designed to work with numpy arrays. Notice np.array(mem)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@aaronspring
Comment options

@dcherian
Comment options

@aaronspring
Comment options

@aaronspring
Comment options

Answer selected by aaronspring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants