-
So I need to re-open a import zarr
import numpy as np
g = zarr.open('test.zarr')
g['foo'] = np.arange(0, 10)
foo_from_store = zarr.open(store=g['foo'].store, path='foo')
foo_from_store[...] # correct, arange-d
zarr.consolidate_metadata('test.zarr')
g_consolidated = zarr.open_consolidated('test.zarr')
foo_from_store_consolidated = zarr.open(store=g_consolidated['foo'].store, path='foo')
foo_from_store_consolidated[...] # incorrect, all zeros
g_consolidated['foo'][...] # correct, arange-d I must be doing something wrong, but cannot say for sure. Any help appreciated! Happy to provide a PR if that's needed! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone interested, the answer is to do the following: foo_from_store_consolidated = zarr.open(store=g_consolidated['foo'].store, path='foo', chunk_store=g_consolidated.chunk_store)
foo_from_store_consolidated[...] # correct, arange-d I don't think this is a bug, but I wonder if the behavior should be clarified in that you can't actually read chunks from a consolidated metadata store: https://zarr.readthedocs.io/en/stable/api/storage.html#zarr.storage.ConsolidatedMetadataStore. |
Beta Was this translation helpful? Give feedback.
For anyone interested, the answer is to do the following:
I don't think this is a bug, but I wonder if the behavior should be clarified in that you can't actually read chunks from a consolidated metadata store: https://zarr.readthedocs.io/en/stable/api/storage.html#zarr.storage.ConsolidatedMetadataStore.