Skip to content

Commit

Permalink
Explicitly allow for no-slicing operations.
Browse files Browse the repository at this point in the history
This supports `np.s_[None]` `...` `np.s_[...]` etc
  • Loading branch information
Cadair committed Feb 6, 2025
1 parent c9f7c6c commit 6cf818d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dkist/dataset/tiled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
but not representable in a single NDCube derived object as the array data are
not contiguous in the spatial dimensions (due to overlaps and offsets).
"""
import types
import warnings
from textwrap import dedent
from collections.abc import Collection
Expand Down Expand Up @@ -193,7 +194,7 @@ def plot(self, slice_index, share_zscale=False, figure=None, **kwargs):
slice_index : `int`, sequence of `int`s or `numpy.s_`
Object representing a slice which will reduce each component dataset
of the TiledDataset to a 2D image. This is passed to
``TiledDataset.slice_tiles``
``TiledDataset.slice_tiles``, if each tile is already 2D pass ``slice_index=...`.
share_zscale : `bool`
Determines whether the color scale of the plots should be calculated
independently (``False``) or shared across all plots (``True``).
Expand All @@ -202,7 +203,7 @@ def plot(self, slice_index, share_zscale=False, figure=None, **kwargs):
A figure to use for the plot. If not specified the current pyplot
figure will be used, or a new one created.
"""
if isinstance(slice_index, int):
if isinstance(slice_index, (int, slice, types.EllipsisType)):
slice_index = (slice_index,)
vmin, vmax = np.inf, 0

Expand Down

0 comments on commit 6cf818d

Please sign in to comment.