Skip to content

Commit 907585a

Browse files
committed
Add with_read_only to LocalStore
1 parent b0b5b09 commit 907585a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/zarr/storage/_local.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ def __init__(self, root: Path | str, *, read_only: bool = False) -> None:
102102
)
103103
self.root = root
104104

105+
def with_read_only(self, read_only: bool = False) -> LocalStore:
106+
# docstring inherited
107+
return type(self)(
108+
root=self.root,
109+
read_only=read_only,
110+
)
111+
105112
async def _open(self) -> None:
106113
if not self.read_only:
107114
self.root.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)