Skip to content

Commit

Permalink
Read Only
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed May 16, 2024
1 parent 72ff80f commit 37add17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 37add17

Please sign in to comment.