Skip to content

Commit

Permalink
Fix: 2940
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiisoup committed May 6, 2019
1 parent 5aaa654 commit 098daf3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ Enhancements
- Character arrays' character dimension name decoding and encoding handled by
``var.encoding['char_dim_name']`` (:issue:`2895`)
By `James McCreight <https://github.com/jmccreight>`_.

Bug fixes
~~~~~~~~~

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

Expand Down
4 changes: 2 additions & 2 deletions xarray/core/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def wrapped_func(self, **kwargs):
if isinstance(padded.data, dask_array_type):
# Workaround to make the padded chunk size is larger than
# self.window-1
shift = - (self.window + 1) // 2
shift = - (self.window - 1)
offset = (self.window - 1) // 2
valid = (slice(None), ) * axis + (
slice(offset, offset + self.obj.shape[axis]), )
Expand All @@ -285,7 +285,7 @@ def wrapped_func(self, **kwargs):
padded = padded.pad_with_fill_value({self.dim: (0, -shift)})

if isinstance(padded.data, dask_array_type):
values = dask_rolling_wrapper(func, padded,
values = dask_rolling_wrapper(func, padded.data,
window=self.window,
min_count=min_count,
axis=axis)
Expand Down

0 comments on commit 098daf3

Please sign in to comment.