blosc2.get_slice_nchunks#

blosc2.get_slice_nchunks(schunk: blosc2.SChunk, key: tuple[int, int] | int | slice | Sequence[slice]) np.ndarray#

Get the unidimensional chunk indexes needed to obtain a slice of a SChunk or a NDArray.

Parameters:
  • schunk (SChunk or NDArray) – The super-chunk or ndarray container.

  • key (tuple(int, int), int, slice or sequence of slices) – For a SChunk: a tuple with the start and stop of the slice, an integer, or a single slice. For a ndarray, sequences of slices (one per dimension) are accepted.

Returns:

out – An array with the unidimensional chunk indexes.

Return type:

np.ndarray