Skip to content

Commit 098daf3

Browse files
committed
Fix: 2940
1 parent 5aaa654 commit 098daf3

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

doc/whats-new.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ Enhancements
2727
- Character arrays' character dimension name decoding and encoding handled by
2828
``var.encoding['char_dim_name']`` (:issue:`2895`)
2929
By `James McCreight <https://github.com/jmccreight>`_.
30-
30+
3131
Bug fixes
3232
~~~~~~~~~
3333

34+
- a bug fix in rolling with dask and bottleneck
35+
(:issue:`2940`)
36+
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
3437
- indexing with an empty list creates an object with zero-length axis (:issue:`2882`)
3538
By `Mayeul d'Avezac <https://github.com/mdavezac>`_.
3639
- Return correct count for scalar datetime64 arrays (:issue:`2770`)
@@ -147,9 +150,9 @@ Other enhancements
147150
By `Keisuke Fujii <https://github.com/fujiisoup>`_.
148151
- Added :py:meth:`~xarray.Dataset.drop_dims` (:issue:`1949`).
149152
By `Kevin Squire <https://github.com/kmsquire>`_.
150-
- ``xr.open_zarr`` now accepts manually specified chunks with the ``chunks=``
151-
parameter. ``auto_chunk=True`` is equivalent to ``chunks='auto'`` for
152-
backwards compatibility. The ``overwrite_encoded_chunks`` parameter is
153+
- ``xr.open_zarr`` now accepts manually specified chunks with the ``chunks=``
154+
parameter. ``auto_chunk=True`` is equivalent to ``chunks='auto'`` for
155+
backwards compatibility. The ``overwrite_encoded_chunks`` parameter is
153156
added to remove the original zarr chunk encoding.
154157
By `Lily Wang <https://github.com/lilyminium>`_.
155158

xarray/core/rolling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def wrapped_func(self, **kwargs):
275275
if isinstance(padded.data, dask_array_type):
276276
# Workaround to make the padded chunk size is larger than
277277
# self.window-1
278-
shift = - (self.window + 1) // 2
278+
shift = - (self.window - 1)
279279
offset = (self.window - 1) // 2
280280
valid = (slice(None), ) * axis + (
281281
slice(offset, offset + self.obj.shape[axis]), )
@@ -285,7 +285,7 @@ def wrapped_func(self, **kwargs):
285285
padded = padded.pad_with_fill_value({self.dim: (0, -shift)})
286286

287287
if isinstance(padded.data, dask_array_type):
288-
values = dask_rolling_wrapper(func, padded,
288+
values = dask_rolling_wrapper(func, padded.data,
289289
window=self.window,
290290
min_count=min_count,
291291
axis=axis)

0 commit comments

Comments
 (0)