We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 413a217 commit 78db27eCopy full SHA for 78db27e
src/blosc2/core.py
@@ -1562,6 +1562,11 @@ def compute_chunks_blocks( # noqa: C901
1562
if chunks is None:
1563
blocksize = math.prod(blocks) * itemsize
1564
chunksize = get_chunksize(blocksize)
1565
+ # Make chunksize to be a multiple of the blocksize. This allows for:
1566
+ # 1. Avoid unnecessary padding in chunks
1567
+ # 2. Avoid exceeding the maximum buffer size (see #392)
1568
+ if chunksize % blocksize != 0:
1569
+ chunksize = chunksize // blocksize * blocksize
1570
chunks = compute_partition(chunksize // itemsize, shape, blocks)
1571
1572
return tuple(chunks), tuple(blocks)
0 commit comments