-
I'm having difficulties with the default Here's an example: import zarr
from zarr.storage import LocalStore
# Create an array with one full chunk of shape (3,4) and one partial chunk (1,4)
shape = (4,4)
chunks = (3,4)
new_dtype = "uint8"
overwrite=True
zarr_format=3
store = LocalStore(root = ".vscode/zarr-data/example.zarr", read_only=False)
arr = zarr.create_array(
store,
name="0",
shape=shape,
chunks=chunks,
dtype=new_dtype,
zarr_format=3,
compressors=None,
filters=None,
overwrite=overwrite
)
arr[:] = 42 Inspect the size of the two chunks on disk ls -l .vscode/zarr-data/example.zarr/0/c/0/0 | awk '{print $5}'
# 12 (expected)
ls -l .vscode/zarr-data/example.zarr/0/c/1/0 | awk '{print $5}'
# 12 (I would expect 4) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
for the default chunk grid, yes to both questions. This can still work for virtualization but only if byte ranges are addressible in the virtualization scheme, and the byte range for all the boundary chunks has been calculated. |
Beta Was this translation helpful? Give feedback.
-
Note that this is the same issue as #3035. Here's the explanation for this behavior that I provided there.
For the default chunk grid, every chunk is identical in terms of how it is stored. There is nothing special about the final chunk. |
Beta Was this translation helpful? Give feedback.
for the default chunk grid, yes to both questions.
This can still work for virtualization but only if byte ranges are addressible in the virtualization scheme, and the byte range for all the boundary chunks has been calculated.