Skip to content

Commit

Permalink
Raise error if user slices with ellipsis.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRyanIrish committed Dec 16, 2019
1 parent 37d2db2 commit dce8a38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/224.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Raises error if NDCube is sliced with an Ellipsis.
4 changes: 4 additions & 0 deletions ndcube/utils/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def _wcs_slicer(wcs, missing_axes, item):
new_wcs = wcs.slice(item_checked)
# if it a tuple like [0:2, 0:3, 2] or [0:2, 1:3]
elif isinstance(item, tuple):
# Ellipsis slicing is currently not supported.
# Raise an error if user tries to slice by ellipsis.
if type(Ellipsis) in [type(item_i) for item_i in item]:
raise NotImplementedError("Slicing FITS-WCS by ellipsis not supported.")
# this is used to not exceed the range of the item tuple
# if the check of the missing_axes which is False if not dead
# is a success than the the item of the tuple is added one by
Expand Down

0 comments on commit dce8a38

Please sign in to comment.