Skip to content

Commit 5e07bbb

Browse files
committed
fix test
1 parent 2482fc4 commit 5e07bbb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xarray/core/dataset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def _get_breaks_cached(
293293
# Determine the stop indices of the preferred chunks, but omit the last stop
294294
# (equal to the dim size). In particular, assume that when a sequence
295295
# expresses the preferred chunks, the sequence sums to the size.
296-
preferred_stops = (
296+
preferred_stops = set(
297297
range(preferred_chunk_sizes, size, preferred_chunk_sizes)
298298
if isinstance(preferred_chunk_sizes, int)
299299
else itertools.accumulate(preferred_chunk_sizes[:-1])
@@ -303,11 +303,12 @@ def _get_breaks_cached(
303303
# of a preferred chunk. Again, omit the last stop, assuming that it equals
304304
# the dim size.
305305
actual_stops = itertools.accumulate(chunk_sizes[:-1])
306+
# This copy is required for parallel iteration
306307
actual_stops_2 = itertools.accumulate(chunk_sizes[:-1])
307308

308309
disagrees = itertools.compress(
309310
actual_stops_2,
310-
(a != b for a, b in zip(actual_stops, preferred_stops, strict=True)),
311+
(a not in preferred_stops for a in actual_stops),
311312
)
312313
try:
313314
return next(disagrees)

0 commit comments

Comments
 (0)