Skip to content

Commit b9690e0

Browse files
committed
fix: 1024 bytes is not 1MiB!
1 parent 94d543c commit b9690e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zarr/core/chunk_grids.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def _guess_chunks(
6262
tuple[int, ...]
6363
6464
"""
65+
if min_bytes >= max_bytes:
66+
raise ValueError(f"Cannot have more min_bytes {min_bytes} than max_bytes {max_bytes}")
6567
if isinstance(shape, int):
6668
shape = (shape,)
6769

@@ -264,7 +266,7 @@ def _auto_partition(
264266
else:
265267
if chunk_shape == "auto":
266268
# aim for a 1MiB chunk
267-
_chunks_out = _guess_chunks(array_shape, item_size, max_bytes=1024)
269+
_chunks_out = _guess_chunks(array_shape, item_size, max_bytes=1049000)
268270
else:
269271
_chunks_out = chunk_shape
270272

0 commit comments

Comments
 (0)