Skip to content

Commit

Permalink
open update
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Dec 1, 2023
1 parent 1391ebd commit 320546b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ 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 'w' mode, the file will not use consolidated metadata.
if self.__mode == 'w':
if self.__mode not in ['r', 'r+']:
self.__file = zarr.open(store=self.path,
mode=self.__mode,
synchronizer=self.__synchronizer,
Expand Down Expand Up @@ -716,7 +716,7 @@ def resolve_ref(self, zarr_ref):
else:
target_name = ROOT_NAME

target_zarr_obj = zarr.open(source_file, mode='r', storage_options=self.__storage_options)
target_zarr_obj = self.__open_file_consolidated(source_file, mode='r', storage_options=self.__storage_options)
if object_path is not None:
try:
target_zarr_obj = target_zarr_obj[object_path]
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/test_zarrio.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,20 @@ class TestExportZarrToZarrNestedDirectoryStore(BaseTestExportZarrToZarr):
def setUp(self):
super().setUp()
self.store = [NestedDirectoryStore(p) for p in self.store_path]


#########################################
# Consolidate Metadata tests
#########################################
# class TestConsolidateMetadata(TestCase):
# """
#
# """
# def test_get_store_path(self):
# pass
#
# def test_warning_consolidate_metadata(self):
# pass
#
# def test_open_with_zmetadata(self):
# pass

0 comments on commit 320546b

Please sign in to comment.