blosc2.compute_chunks_blocks#
- blosc2.compute_chunks_blocks(shape: tuple[int] | list, chunks: tuple | list | None = None, blocks: tuple | list | None = None, dtype: ~numpy.dtype = <class 'numpy.uint8'>, **kwargs: dict) tuple #
Compute educated guesses for chunks and blocks of a NDArray.
- Parameters:
shape¶ (tuple or list) – The shape of the array.
chunks¶ (tuple or list) – The shape of the chunk. If None, a guess is computed based on cache sizes and heuristics.
blocks¶ (tuple or list) – The shape of the block. If None, a guess is computed based on cache sizes and heuristics.
dtype¶ (np.dtype) – The dtype of the array. Default is np.uint8.
kwargs¶ (dict) – Other keyword arguments supported by the
SChunk.__init__
constructor.
- Returns:
A (chunks, blocks) tuple containing the computed chunk and block sizes.
- Return type:
tuple