You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, iris.analysis.cartography.area_weights always returns a numpy array. Depending on the shape of the input cube, this can use up a lot of memory. It would be really helpful to have a lazy version of it that returns a dask array.
Motivation
Using a dask distributed scheduler in ESMValTool in combination with a preprocessor that requires the calculation of area weights is currently not possible. A lazy version of iris.analysis.cartography.area_weights would solve that.
✨ Feature Request
Currently,
iris.analysis.cartography.area_weights
always returns a numpy array. Depending on the shape of the input cube, this can use up a lot of memory. It would be really helpful to have a lazy version of it that returns a dask array.Motivation
Using a dask distributed scheduler in ESMValTool in combination with a preprocessor that requires the calculation of area weights is currently not possible. A lazy version of
iris.analysis.cartography.area_weights
would solve that.Design
Solving this is probably easy since
broadcast_to_shape
that is used to broadcast the 2D weights to the cube shape now supports dask arrays. I see two options here regarding the API:iris.analysis.cartography.area_weights
(maybecompute
which isTrue
by default?).I guess option 1. is preferable since it is fully backwards-compatible.
If we can agree on an implementation, I can open a PR.
The text was updated successfully, but these errors were encountered: