From 37add1759a934423d6a6ffadf23b18a0bd8e2d95 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Thu, 16 May 2024 11:37:31 -0700 Subject: [PATCH] Read Only --- src/hdmf_zarr/backend.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 62834374..77c5c68a 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -160,7 +160,9 @@ def open(self): if self.__file is None: # Within zarr, open_consolidated only allows the mode to be 'r' or 'r+'. # As a result, when in other modes, the file will not use consolidated metadata. - if self.__mode not in ['r', 'r+']: + if self.__mode != 'r': + # When we consolidate metadata, we use ConsolidatedMetadataStore. This interface does not seem to allow for setting items at all. + # In the doc string, it says it is "read only". As a result, we cannot use r+ with consolidate_metadata. # r- is only an internal mode in ZarrIO to force the use of regular open. For Zarr we need to # use the regular mode r when r- is specified mode_to_use = self.__mode if self.__mode != 'r-' else 'r'