diff --git a/ndcube/tests/test_ndcube.py b/ndcube/tests/test_ndcube.py index 1eb7f4988..d6b6d931d 100644 --- a/ndcube/tests/test_ndcube.py +++ b/ndcube/tests/test_ndcube.py @@ -663,6 +663,8 @@ def test_slicing_error(test_input): test_input[None] with pytest.raises(IndexError): test_input[0, None] + with pytest.raises(NotImplementedError): + test_input[[0, 1]] @pytest.mark.parametrize("test_input,expected", [ diff --git a/ndcube/utils/wcs.py b/ndcube/utils/wcs.py index d48ebaeaa..ed4973f8e 100644 --- a/ndcube/utils/wcs.py +++ b/ndcube/utils/wcs.py @@ -206,6 +206,8 @@ def _wcs_slicer(wcs, missing_axis, item): for i, it in enumerate(item_checked): if isinstance(it, int): missing_axis[i] = True + else: + raise NotImplementedError("Slicing FITS-WCS by {0} not supported.".format(type(item))) # returning the reverse list of missing axis as in the item here was reverse of # what was inputed so we had a reverse missing_axis. return new_wcs, missing_axis[::-1]