Skip to content

Commit 42d2329

Browse files
committed
Make error message more helpful when cropping to a single pixel
1 parent f823795 commit 42d2329

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ndcube/utils/cube.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_crop_item_from_points(points, wcs, crop_by_values, keepdims):
127127
Denotes whether cropping is done using high-level objects or "values",
128128
i.e. low-level objects.
129129
130-
keep_dims : `bool`
130+
keepdims : `bool`
131131
If `False`, returned item will drop length-1 dimensions otherwise, item will keep length-1 dimensions.
132132
133133
Returns
@@ -208,7 +208,7 @@ def get_crop_item_from_points(points, wcs, crop_by_values, keepdims):
208208
# If item will result in a scalar cube, raise an error as this is not currently supported.
209209
if result_is_scalar:
210210
raise ValueError("Input points causes cube to be cropped to a single pixel. "
211-
"This is not supported.")
211+
"This is not supported when keepdims=False.")
212212
return tuple(item)
213213

214214

0 commit comments

Comments
 (0)