You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missmatch of Array.store_path.store.list_prefix() and Array._iter_chunk_keys() in chunks_initialized() for an array in a group #2861
Currently, it is not possible to view how many chunks are initialized in an array inside a group.
I was able to track it down to a mismatch of the outputs of the functions z.store_path.store.list_prefix(prefix=z.store_path.path) and z._iter_chunk_keys().
Steps to reproduce
importzarr# Create a group with two arraysroot=zarr.group("reproduction.zarr")
root.create("x", shape=(1000, 1000), chunks=(100, 100), dtype="f4")
root.create("y", shape=(1000, 1000), chunks=(100, 100), dtype="uint8")
root.tree()
fromzarr.core.arrayimportchunks_initialized# Now check which chunks are initialized (should be an empty tuple)awaitchunks_initialized(root["x"])
> ()
# Now fill two chunksroot["x"][0:100, 0:100] =1.0root["x"][100:200, 0:100] =2.0# Now check which chunks are initialized (should be a tuple with two chunks)awaitchunks_initialized(root["x"])
> () # <-- This shouldn't be empty
# Further investigate what happens in "chunks_initialized()"store_contents= [xasyncforxinroot["x"].store_path.store.list_prefix(prefix=root["x"].store_path.path)]
store_contents> ['x/zarr.json', 'x/c/1/0', 'x/c/0/0']
good report, and sorry for the bug. seems like we need to relativize the output of list_prefix, or absolutifiy the values in iter_chunk_keys. Since this is so obviously wrong that I'm wondering how our tests did not catch it.
Activity
d-v-b commentedon Feb 25, 2025
good report, and sorry for the bug. seems like we need to relativize the output of
list_prefix, or absolutifiy the values initer_chunk_keys. Since this is so obviously wrong that I'm wondering how our tests did not catch it.relativityhd commentedon Feb 25, 2025
No problem, I am glad I could help. :)