Skip to content

Commit

Permalink
Move conditional mode check to a variable assignement
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Apr 25, 2024
1 parent 944a072 commit e28904e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ def open(self):
# 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+']:
# 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'
self.__file = zarr.open(store=self.path,
mode=self.__mode if self.__mode != 'r-' else 'r',
mode=mode_to_use,
synchronizer=self.__synchronizer,
storage_options=self.__storage_options)
else:
Expand Down

0 comments on commit e28904e

Please sign in to comment.