From 51a4e6c7a2129c20be9c06c6973f351814a5da76 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Fri, 3 Nov 2023 10:14:20 -0400 Subject: [PATCH] Have zarr use read-only mode --- CHANGELOG.md | 5 +++++ sources/zarr/large_image_source_zarr/__init__.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa280b4c0..f8ec40bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 1.26.1 + +### Improvements +- Have zarr use read-only mode ([#1360](../../pull/1360)) + ## 1.26.0 ### Features diff --git a/sources/zarr/large_image_source_zarr/__init__.py b/sources/zarr/large_image_source_zarr/__init__.py index 6c403bdf2..409e99ac6 100644 --- a/sources/zarr/large_image_source_zarr/__init__.py +++ b/sources/zarr/large_image_source_zarr/__init__.py @@ -57,10 +57,10 @@ def __init__(self, path, **kwargs): if not os.path.isfile(self._largeImagePath) and '//:' not in self._largeImagePath: raise TileSourceFileNotFoundError(self._largeImagePath) from None try: - self._zarr = zarr.open(zarr.SQLiteStore(self._largeImagePath)) + self._zarr = zarr.open(zarr.SQLiteStore(self._largeImagePath), mode='r') except Exception: try: - self._zarr = zarr.open(self._largeImagePath) + self._zarr = zarr.open(self._largeImagePath, mode='r') except Exception: if os.path.basename(self._largeImagePath) in {'.zgroup', '.zattrs'}: try: