Skip to content

Commit 293977e

Browse files
maxrjonesdcherian
andauthored
Apply suggestion from @dcherian
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
1 parent 90da488 commit 293977e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/zarr/core/chunk_grids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def normalize_chunks(chunks: Any, shape: tuple[int, ...], typesize: int) -> tupl
128128
# handle dask-style chunks (iterable of iterables)
129129
if all(isinstance(c, (tuple, list)) for c in chunks):
130130
for i, c in enumerate(chunks):
131-
if len(set(c[:-1])) > 1 or (len(c) > 1 and c[-1] > c[0]):
131+
if itertools.pairwise(c[:-2], c[1:-1]).map(lambda x, y: x == y).any()) or (len(c) > 1 and c[-1] > c[0]):
132132
raise ValueError(
133133
f"Irregular chunk sizes in dimension {i}: {tuple(c)}. "
134134
"Only uniform chunks (with an optional smaller final chunk) are supported."

0 commit comments

Comments
 (0)