parse_array_slices#
- parse_array_slices(key: Union[tuple, slice], extent: Box, dims: int = 2) Tuple[Box, List[Optional[Any]]] [source]#
Parse multi-dim array-indexing inputs into a Box and slices.
- Parameters
- Raises
NotImplementedError – If not (1 <= dims <= 3).
TypeError – If key is not a slice or tuple.
IndexError – if not (1 <= len(key) <= dims).
TypeError – If the index for any of the dims is None.
ValueError – If more than one Ellipsis (“…”) in the input.
ValueError – If h and w indices (first 2 dims) are not slices.
NotImplementedError – If input contains negative values.
- Returns
- A Box representing the h and w slices and a list
containing slices/index-values for all the dims.
- Return type