Skip to content

Upgrade zarr-python dependency to 3.0 #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
13 changes: 4 additions & 9 deletions iohub/_deprecated/zarrfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import numpy as np
import zarr
import zarr.storage

from iohub._deprecated.reader_base import ReaderBase

Expand All @@ -27,7 +28,7 @@ class ZarrReader(ReaderBase):
"""

def __init__(
self, store_path: str, version: Literal["0.1", "0.4"] = "0.1"
self, store_path: str, version: Literal["0.1", "0.4", "0.5"] = "0.1"
):
super().__init__()

Expand All @@ -43,16 +44,10 @@ def __init__(
# zarr files (.zarr) are directories
if not os.path.isdir(store_path):
raise ValueError("file does not exist")
if version == "0.4":
dimension_separator = "/"
elif version == "0.1":
dimension_separator = "."
else:
if version not in ("0.1", "0.4", "0.5"):
raise ValueError(f"Invalid NGFF version: {version}")
try:
self.store = zarr.DirectoryStore(
store_path, dimension_separator=dimension_separator
)
self.store = zarr.storage.LocalStore(store_path)
self.root = zarr.open(self.store, "r")
except Exception:
raise FileNotFoundError("Supplies path is not a valid zarr root")
Expand Down
Loading
Loading