Skip to content

Commit

Permalink
Fix to Data.flip to provide correct indices for flip operation
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Feb 24, 2022
1 parent 2671c96 commit 53b4a44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cf/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10945,7 +10945,7 @@ def flip(self, axes=None, inplace=False, i=False):
"""
d = _inplace_enabled_define_and_cleanup(self)

if axes is not None and not axes and axes != 0:
if axes is not None and not axes and axes != 0: # i.e. empty sequence
return d

if axes is None:
Expand All @@ -10957,7 +10957,8 @@ def flip(self, axes=None, inplace=False, i=False):
return d

index = [
slice(None, None, -1) if i in iaxes else slice(None) for i in iaxes
slice(None, None, -1) if i in iaxes else slice(None)
for i in range(len(d._axes))
]

dx = d._get_dask()
Expand Down

0 comments on commit 53b4a44

Please sign in to comment.