We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iris.util.rolling_window
According to the docstring of iris.util.rolling_window it maintains laziness when called, but actually passing in a Dask array leads to a crash.
Steps to reproduce the behaviour:
In [1]: import dask.array as da In [2]: from iris.util import rolling_window In [3]: x = da.arange(10).reshape((2, 5)) In [4]: rolling_window(x, 3).compute() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[4], line 1 ----> 1 rolling_window(x, 3) File ~/src/scitools/iris/lib/iris/util.py:337, in rolling_window(a, window, step, axis) 334 num_windows = (a.shape[axis] - window + step) // step 335 shape = a.shape[:axis] + (num_windows, window) + a.shape[axis + 1 :] 336 strides = ( --> 337 a.strides[:axis] 338 + (step * a.strides[axis], a.strides[axis]) 339 + a.strides[axis + 1 :] 340 ) 341 rw = np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides) 342 if ma.isMaskedArray(a): AttributeError: 'Array' object has no attribute 'strides'
Instead of a crash, I would expect an output array
In [1]: import dask.array as da In [2]: from iris.util import rolling_window In [3]: x = da.arange(10).reshape((2, 5)) In [4]: rolling_window(x, 3).compute() Out[4]: array([[[0, 1, 2], [1, 2, 3], [2, 3, 4]], [[5, 6, 7], [6, 7, 8], [7, 8, 9]]])
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
🐛 Bug Report
According to the docstring of
iris.util.rolling_window
it maintains laziness when called, but actually passing in a Dask array leads to a crash.How To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Instead of a crash, I would expect an output array
Environment
The text was updated successfully, but these errors were encountered: