blosc2.compute_chunks_blocks#

blosc2.compute_chunks_blocks(shape, chunks: tuple | list | None = None, blocks: tuple | list | None = None, dtype=<class 'numpy.uint8'>, **kwargs)#

Compute educated guesses for chunks and blocks of a NDArray.

Parameters:
  • shape (tuple) – The shape of the array.

  • chunks (tuple) – The shape of the chunk. If None, a guess is computed based on cache sizes and heuristics.

  • blocks (tuple) – 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