xarray-contrib / xvec

Vector data cubes for Xarray
https://xvec.readthedocs.io
MIT License
101 stars 9 forks source link

Error in in zonal_stats.ipynb #75

Closed clausmichele closed 2 months ago

clausmichele commented 2 months ago

When running the example proposed in the Aggregation options section:

aggregated_custom = ds.xvec.zonal_stats(
    world.geometry,
    x_coords="longitude",
    y_coords="latitude",
    stats=[
        "mean",
        "sum",
        ("quantile", "quantile", dict(q=[0.1, 0.2, 0.3])),
        ("numpymean", np.nanmean),
        np.nanstd,
    ],
)
aggregated_custom

I'm getting this error: ValueError: cannot reduce over dimensions ('stacked_latitude_longitude',).

I'm using xvec==0.3.0 and xarray==2024.7.0 on Python 3.10 in a conda environment.

martinfleis commented 2 months ago

Can you show the full Traceback and full conda list? I can't reproduce that locally...

clausmichele commented 2 months ago

In a clean environment the error disappeared, thanks anyway!