diff --git a/changelog/732.feature.rst b/changelog/732.feature.rst index a172095b6..4eddebc48 100644 --- a/changelog/732.feature.rst +++ b/changelog/732.feature.rst @@ -1 +1 @@ -Add a ``keep_dims=False`` kwarg to `~ndcube.NDCube.crop` and `~ndcube.NDCube.crop_by_values` setting to true keeps size one dimensions default behavior drops. +Add a ``keepdims=False`` kwarg to `~ndcube.NDCube.crop` and `~ndcube.NDCube.crop_by_values` setting to true keeps length-1 dimensions default behavior drops these dimensions. diff --git a/ndcube/ndcube.py b/ndcube/ndcube.py index f642ff367..953f222d7 100644 --- a/ndcube/ndcube.py +++ b/ndcube/ndcube.py @@ -217,7 +217,7 @@ def crop(self, ``.extra_coords`` properties will be used. keepdims: `bool`, optional - If `True` keep size one dimensions rather than dropping. + If `True` keep lenght-1 dimensions rather than dropping. Returns ------- @@ -269,7 +269,7 @@ def crop_by_values(self, ``.extra_coords`` properties will be used. keepdims: `bool`, optional - If `True` keep size one dimensions rather than dropping. + If `True` keep lenght-1 dimensions rather than dropping. Returns ------- diff --git a/ndcube/utils/cube.py b/ndcube/utils/cube.py index 481442aa8..c4e294f1c 100644 --- a/ndcube/utils/cube.py +++ b/ndcube/utils/cube.py @@ -122,7 +122,7 @@ def get_crop_item_from_points(points, wcs, crop_by_values, keepdims): i.e. low-level objects. keep_dims : `bool` - If true keep size 1 dimensions rather than dropping + If `False`, return item that will drop length-1 dimensions otherwise, item will keep length-1 dimensions. Returns -------