Skip to content

Commit

Permalink
working basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Dec 1, 2023
1 parent e7ee039 commit f7f2f37
Show file tree
Hide file tree
Showing 59 changed files with 296 additions and 751 deletions.
22 changes: 11 additions & 11 deletions src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,16 @@ def write_builder(self, **kwargs):
# Consolidate metadata for the entire file after everything has been written
zarr.consolidate_metadata(store=self.path)

def consolidate_metadata(self, store):
"""
When a file is written, the metadata within the file is consolidated automatically.
If there are any metadata changes, the user needs to consolidate the metadata again
with this method in order for the metadata to be read correctly.
Consolidate all metadata for groups and arrays within the given store into a
single resource and put it under .zmetadata.
"""
zarr.consolidate_metadata(store, metadata_key='.zmetadata')
# def consolidate_metadata(store):
# """
# When a file is written, the metadata within the file is consolidated automatically.
# If there are any metadata changes, the user needs to consolidate the metadata again
# with this method in order for the metadata to be read correctly.
#
# Consolidate all metadata for groups and arrays within the given store into a
# single resource and put it under .zmetadata.
# """
# zarr.consolidate_metadata(store, metadata_key='.zmetadata')

@staticmethod
def __get_store_path(store):
Expand All @@ -456,6 +456,7 @@ def __get_store_path(store):
retrieve the path.
"""
if isinstance(store, zarr.storage.ConsolidatedMetadataStore):
# breakpoint()
fpath = store.store.path
else:
fpath = store.path
Expand Down Expand Up @@ -1268,7 +1269,6 @@ def read_builder(self):
return f_builder

def __set_built(self, zarr_obj, builder):
# fpath = zarr_obj.store.path
fpath = self.__get_store_path(zarr_obj.store)
path = zarr_obj.path
path = os.path.join(fpath, path)
Expand Down
12 changes: 0 additions & 12 deletions tests/unit/example_consolidate.zarr/.zattrs

This file was deleted.

Loading

0 comments on commit f7f2f37

Please sign in to comment.