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
Since zarr v2.15.0, the tifffile.ZarrTiffStore fails to read any chunks when wrapping the store in zarr.LRUStoreCache. The chunks returned by LRUStoreCache are always zeroed.
I don't understand yet what change in v2.15 causes the failure. It may be related to ZarrTiffStore not returning all chunk keys from the keys method because there may be many million keys and it would take significant resources to parse the TIFF file(s) for all keys upfront. Instead, the store relies on the __contains__ method.
The following patch fixes the issue for me:
diff --git a/zarr/storage.py b/zarr/storage.py
index 4f7b9905..c3260638 100644
--- a/zarr/storage.py+++ b/zarr/storage.py@@ -2436,7 +2436,7 @@ class LRUStoreCache(Store):
with self._mutex:
if self._contains_cache is None:
self._contains_cache = set(self._keys())
- return key in self._contains_cache+ return key in self._contains_cache or key in self._store
def clear(self):
self._store.clear()
Zarr version
2.16.0
Numcodecs version
0.11.0
Python Version
3.11.4
Operating System
Windows
Installation
py -m pip install -U zarr
Description
Since zarr v2.15.0, the
tifffile.ZarrTiffStore
fails to read any chunks when wrapping the store inzarr.LRUStoreCache
. The chunks returned byLRUStoreCache
are always zeroed.I don't understand yet what change in v2.15 causes the failure. It may be related to
ZarrTiffStore
not returning all chunk keys from thekeys
method because there may be many million keys and it would take significant resources to parse the TIFF file(s) for all keys upfront. Instead, the store relies on the__contains__
method.The following patch fixes the issue for me:
Steps to reproduce
Additional output
The text was updated successfully, but these errors were encountered: