Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ torchvision>=0.15.0
tqdm>=4.64.1
umap-learn>=0.5.3
wsidicom>=0.18.0
zarr>=2.13.3, <3.0.0
zarr>=2.13.3
11 changes: 6 additions & 5 deletions tiatoolbox/wsicore/wsireader.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def is_ngff( # noqa: PLR0911
store = zarr.SQLiteStore(str(path)) if path.is_file() and is_sqlite3(path) else path
try:
zarr_group = zarr.open(store, mode="r")
except (zarr.errors.FSPathExistNotDir, zarr.errors.PathNotFoundError):
except Exception: # skipcq: PYL-W0703 # noqa: BLE001
return False
if not isinstance(zarr_group, zarr.hierarchy.Group):
if not isinstance(zarr_group, zarr.Group):
return False
group_attrs = zarr_group.attrs.asdict()
try:
Expand Down Expand Up @@ -3527,8 +3527,9 @@ def page_area(page: tifffile.TiffPage) -> float:
)
self._zarr_lru_cache = zarr.LRUStoreCache(self._zarr_store, max_size=cache_size)
self._zarr_group = zarr.open(self._zarr_lru_cache)
if not isinstance(self._zarr_group, zarr.hierarchy.Group): # pragma: no cover
group = zarr.hierarchy.group()

if not isinstance(self._zarr_group, zarr.Group):
group = zarr.open_group()
group[0] = self._zarr_group
self._zarr_group = group
self.level_arrays = {
Expand Down Expand Up @@ -5081,7 +5082,7 @@ def __init__(self: NGFFWSIReader, path: str | Path, **kwargs: dict) -> None:

numcodecs.register_codecs()
store = zarr.SQLiteStore(path) if is_sqlite3(path) else path
self._zarr_group: zarr.hierarchy.Group = zarr.open(store, mode="r")
self._zarr_group: zarr.Group = zarr.open(store, mode="r")
attrs = self._zarr_group.attrs
multiscales = attrs["multiscales"][0]
axes = multiscales["axes"]
Expand Down
Loading