Skip to content

Commit 7eb6988

Browse files
committed
partition concurrency along new_array chunks
1 parent e607105 commit 7eb6988

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/zarr/core/array.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3907,15 +3907,12 @@ async def _copy_region(chunk_coords: ChunkCoords | slice, _data: Array) -> None:
39073907
arr = await _data._async_array.getitem(chunk_coords)
39083908
await new_array.setitem(chunk_coords, arr)
39093909

3910-
if new_array.chunks == data.chunks:
3911-
# Stream data from the source array to the new array
3912-
await concurrent_map(
3913-
[(region, data) for region in data._iter_chunk_regions()],
3914-
_copy_region,
3915-
zarr.core.config.config.get("async.concurrency"),
3916-
)
3917-
else:
3918-
await _copy_region(slice(None), data)
3910+
# Stream data from the source array to the new array
3911+
await concurrent_map(
3912+
[(region, data) for region in new_array._iter_chunk_regions()],
3913+
_copy_region,
3914+
zarr.core.config.config.get("async.concurrency"),
3915+
)
39193916
return new_array
39203917

39213918

0 commit comments

Comments
 (0)