Skip to content

spatial.reduce eagerly loads data #39

@saschahofmann

Description

@saschahofmann

Is your feature request related to a problem? Please describe.

When operating on xarray.DataArray based on DaskArray's with earthkit.transforms.aggregate.spatial.reduce the operation is performed eagerly. Scrolling a little bit through the code it seems to be like this is expected right now. Interestingly, the ALLOWED_LIBS int tools.py constant only contains numpy right now but still doesn't seem to raise an error. I assume the eagerly loading happens because the HOW_METHODS are defined via numpy functions.

Describe the solution you'd like

I think a simple solution could be to use the dask equivalents where available if the data is in dask.

Describe alternatives you've considered

A more complicated alternative would be to use xarray's apply_ufunc but I don't think that'd be necessary.

Additional context

No response

Organisation

Lobelia Earth

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions