Skip to content

Commit

Permalink
Fix bug in ZarrIO.__open_consolidated (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel authored Apr 26, 2024
1 parent afaab5f commit f331a2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
### Docs
* Removed `linkable` from the documentation to keep in line with `hdmf-schema-language`. @mavaylon1 [#180](https://github.com/hdmf-dev/hdmf-zarr/pull/180)

### Internal Fixes
### Bug Fixes
* Fixed bug in `ZarrIO.__open_file_consolidated` that led to remote files being opened without consolidated metadata. @oruebel [#184](https://github.com/hdmf-dev/hdmf-zarr/pull/184)
* Fixed minor bug where `ZarrIO.__open_file_consolidated` used properties of `ZarrIO` instead of the provided input parameters. @oruebel [#183](https://github.com/hdmf-dev/hdmf-zarr/pull/183)

## 0.6.0 (February 21, 2024)
Expand Down
10 changes: 2 additions & 8 deletions src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,12 @@ def __open_file_consolidated(self,
# This check is just a safeguard for possible errors in the future. But this should never happen
if mode == 'r-':
raise ValueError('Mode r- not allowed for reading with consolidated metadata')
# self.path can be both a string or a one of the `SUPPORTED_ZARR_STORES`.
if isinstance(self.path, str):
path = self.path
else:
path = self.path.path

if os.path.isfile(path+'/.zmetadata'):
try:
return zarr.open_consolidated(store=store,
mode=mode,
synchronizer=synchronizer,
storage_options=storage_options)
else:
except KeyError: # A KeyError is raised when the '/.zmetadata' does not exist
return zarr.open(store=store,
mode=mode,
synchronizer=synchronizer,
Expand Down

0 comments on commit f331a2e

Please sign in to comment.