convert_item_to_sequence_items

ndcube.utils.sequence.convert_item_to_sequence_items(item, n_cubes=None, cube_item=None)[source] [edit on github]
ndcube.utils.sequence.convert_item_to_sequence_items(int_item: int, n_cubes=None, cube_item=slice(None, None, None))
ndcube.utils.sequence.convert_item_to_sequence_items(slice_item: slice, n_cubes, cube_item=slice(None, None, None))
ndcube.utils.sequence.convert_item_to_sequence_items(tuple_item: tuple, n_cubes, cube_item=None)

Converts NDCubeSequence __getitem__ item to list of SequenceSlice objects.

Parameters
  • item (int, slice, or tuple of int and/or slice.) – An slice/index item compatible with input to NDCubeSequence.__getitem__.

  • n_cubes (int) – Number of cubes in NDCubeSequence being sliced. Must be supplied, but not used if item type is int or slice.

Returns

result (list of SequenceItem namedtuple.) – The slice/index items for each relevant NDCube within the NDCubeSequence which together represent the original input slice/index item.