Skip to content

Commit

Permalink
patch zarr to avoid decoding tiles in duplicate
Browse files Browse the repository at this point in the history
This implements the change proposed in
zarr-developers/zarr-python#1454
  • Loading branch information
kaczmarj committed Jul 10, 2023
1 parent 03e15f4 commit 5138727
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wsinfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,18 @@
__version__ = _version.get_versions()["version"]

del _version


# Patch Zarr. See:
# https://github.com/bayer-science-for-a-better-life/tiffslide/issues/72#issuecomment-1627918238
# https://github.com/zarr-developers/zarr-python/pull/1454
def _patch_zarr_kvstore():
from zarr.storage import KVStore

def _zarr_KVStore___contains__(self, key):
return key in self._mutable_mapping

KVStore.__contains__ = _zarr_KVStore___contains__


_patch_zarr_kvstore()

0 comments on commit 5138727

Please sign in to comment.