Skip to content
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

Fix zarr>2.14 #19

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions napari_lazy_openslide/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
from openslide import OpenSlide

from zarr.storage import _path_to_prefix, attrs_key, init_array, init_group, BaseStore
from zarr.storage import _path_to_prefix, attrs_key, init_array, init_group, Store
from zarr.util import json_dumps, normalize_storage_path


Expand Down Expand Up @@ -47,7 +47,7 @@ def _parse_chunk_path(path: str):
y, x, _ = map(int, ckey.split("."))
return x, y, int(level)

class OpenSlideStore(BaseStore):
class OpenSlideStore(Store):
"""Wraps an OpenSlide object as a multiscale Zarr Store.

Parameters
Expand Down Expand Up @@ -86,6 +86,9 @@ def __getitem__(self, key: str):

return np.array(tile).tobytes()

def getitems(self, keys, *, contexts):
return {k: self[k] for k in keys}

def __contains__(self, key: str):
return key in self._store

Expand Down