Skip to content

Commit 2107655

Browse files
committed
add .with_read_only
1 parent bbdefac commit 2107655

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/zarr/storage/_zip.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ def __init__(
9090
self.compression = compression
9191
self.allowZip64 = allowZip64
9292

93+
def with_read_only(self, read_only: bool = False) -> ZipStore:
94+
# docstring inherited
95+
return type(self)(
96+
path=self.path,
97+
mode='r',
98+
read_only=read_only,
99+
compression=self.compression,
100+
allowZip64=self.allowZip64,
101+
)
102+
93103
def _sync_open(self) -> None:
94104
if self._is_open:
95105
raise ValueError("store is already open")

0 commit comments

Comments
 (0)