Skip to content

Commit

Permalink
fix growth of zarr array
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmcreynolds committed Oct 29, 2024
1 parent 142ee50 commit 2f6254e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tiled/adapters/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ async def append_block(
-------
"""
old_shape = self._array.shape
new_shape = list(old_shape)
new_shape[axis] += list(self._array.shape)[axis] # Extend along axis

new_shape = list(self._array.shape)
new_shape[axis] += list(data.shape)[axis] # Extend along axis

# Resize the Zarr array to accommodate new data
data.resize(tuple(new_shape))
self._array.resize(tuple(new_shape))

# Append the new data to the resized array
data[-data.shape[0]:] = data # Slicing to place data at the end
self._array[-data.shape[0]:] = data # Slicing to place data at the end

if sys.version_info < (3, 9):
from typing_extensions import Mapping
Expand Down

0 comments on commit 2f6254e

Please sign in to comment.