Traceback (most recent call last):
File "tt.py", line 5, in <module>
x = multiscale(data, np.mean, (2,))
File "/usr/local/lib/python3.8/site-packages/xarray_multiscale/multiscale.py", line 131, in multiscale
downscaled = downscale(source, reduction, scale, pad_mode=pad_mode)
File "/usr/local/lib/python3.8/site-packages/xarray_multiscale/multiscale.py", line 294, in downscale
downscaled_data = downscale_dask(
File "/usr/local/lib/python3.8/site-packages/xarray_multiscale/multiscale.py", line 278, in downscale_dask
meta = reduction(
File "<__array_function__ internals>", line 5, in mean
File "/usr/local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 3440, in mean
return _methods._mean(a, axis=axis, dtype=dtype,
File "/usr/local/lib/python3.8/site-packages/numpy/core/_methods.py", line 167, in _mean
rcount = _count_reduce_items(arr, axis, keepdims=keepdims, where=where)
File "/usr/local/lib/python3.8/site-packages/numpy/core/_methods.py", line 76, in _count_reduce_items
items *= arr.shape[mu.normalize_axis_index(ax, arr.ndim)]
numpy.AxisError: axis 2 is out of bounds for array of dimension 1
Create utility functions that I rely on a daily basis!
The 0.3.0 update breaks the listed example though:
Seems like the api for the reduction function has changed.
pip dump:
dask==2021.11.2 numcodecs==0.9.1 numpy==1.21.4 s3fs==2021.11.1 xarray==0.17.0 xarray-multiscale==0.3.0 zarr==2.8.3Example still working in 0.2.0 :)
Best