Closed
Description
Context
dask.array.map_blocks
will under some circumstances pass a 0d array through the provided function when initialised, as documented in https://docs.dask.org/en/latest/generated/dask.array.map_blocks.html
In
Lines 355 to 388 in 4abaa8f
meta
, including when handing it an area weighted regridding function (and presumably other times) that won't pass through a 0d array. We do the same elsewhere in the same file too.
Issues arising
DeprecationWarning
s #4574 documents a deprecation warning seen when the Iris tests are run as the 0d array is passed in by dask and then indexed.- I don't know if we get performance or safety improvements by adding this in, it's more that we're "doing it properly" / using dask as designed. Seems like a good way to make it easier to understand the codebase though.
Suggestions
- Work out how to choose what the
meta
kwarg should be set to, and set it - Consider whether the dtype argument should also be provided