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[int, int]#

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.

  • kwargs (dict) – Other keyword arguments supported by the SChunk.__init__ constructor.

Returns:

A (chunks, blocks) tuple with the computed guesses for chunks and blocks.

Return type:

tuple