Skip to content

Commit

Permalink
removes int_to_slice and moves logic inline
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfulton9 committed Jan 20, 2021
1 parent ec8ea71 commit 45e8c25
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions zarr/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,18 +829,14 @@ def pop_fields(selection):
return fields, selection


def int_to_slice(dim_selection):
return slice(dim_selection, dim_selection + 1, 1)


def make_slice_selection(selection):
ls = []
for dim_selection in selection:
if is_integer(dim_selection):
ls.append(int_to_slice(dim_selection))
ls.append(slice(dim_selection, dim_selection + 1, 1))
elif isinstance(dim_selection, np.ndarray):
if len(dim_selection) == 1:
ls.append(int_to_slice(dim_selection[0]))
ls.append(slice(dim_selection[0], dim_selection[0] + 1, 1))
else:
raise ArrayIndexError()
else:
Expand Down

0 comments on commit 45e8c25

Please sign in to comment.