Skip to content

Aggregation 'first' is only implemented for dask arrays when method='blockwise' but I can't change the method #227

Closed
@iuryt

Description

@iuryt

Hi,

Awesome package.
Maybe I didn't understand all the details about the different parallel algorithms, but I am trying to use func="first" with ,method="map-reduce" as in the following code

import xarray as xr
import numpy as np
from flox.xarray import xarray_reduce

n = int(10000)
dsi = xr.Dataset(
    dict(
        x = ("obs",np.random.randn(n)),
        y = ("obs",np.random.randint(1,20+1,n))
    )
).chunk(obs=100)

expected = np.unique(dsi.y)
group_min = xarray_reduce(dsi,dsi.y,expected_groups=expected,func="first",method="map-reduce").load()

And it returns:

NotImplementedError: Aggregation 'first' is only implemented for dask arrays when method='blockwise'.

Is this the expected behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions