From 8be834fd396f9cb3f289cd6554a210ed26233b5a Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Tue, 2 Jul 2024 21:40:53 -0700 Subject: [PATCH 01/35] Append References --- src/hdmf_zarr/backend.py | 33 ++++++++++++++++++++------------- src/hdmf_zarr/zarr_utils.py | 16 ++++++++++++++++ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index df95a2e6..801648a9 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -738,9 +738,10 @@ def resolve_ref(self, zarr_ref): # Return the create path return target_name, target_zarr_obj - def __get_ref(self, ref_object, export_source=None): + def __get_ref(self, ref_object, path=None, source_file=None, export_source=None): """ Create a ZarrReference object that points to the given container + If source_file is not None, use it to get the source_object_id. :param ref_object: the object to be referenced :type ref_object: Builder, Container, ReferenceBuilder @@ -757,7 +758,10 @@ def __get_ref(self, ref_object, export_source=None): builder = ref_object.builder else: builder = self.manager.build(ref_object) - path = self.__get_path(builder) + if path is None: + path = self.__get_path(builder) + else: + path = path # TODO Add to get region for region references. # Also add {'name': 'region', 'type': (slice, list, tuple), # 'doc': 'the region reference indexing object', 'default': None}, @@ -769,18 +773,21 @@ def __get_ref(self, ref_object, export_source=None): # determine the object_id of the source by following the parents of the builder until we find the root # the root builder should be the same as the source file containing the reference - curr = builder - while curr is not None and curr.name != ROOT_NAME: - curr = curr.parent - if curr: - source_object_id = curr.get('object_id', None) - # We did not find ROOT_NAME as a parent. This should only happen if we have an invalid - # file as a source, e.g., if during testing we use an arbitrary builder. We check this - # anyways to avoid potential errors just in case + if source_file is not None: + source_object_id = source_file.object_id else: - source_object_id = None - warn_msg = "Could not determine source_object_id for builder with path: %s" % path - warnings.warn(warn_msg) + curr = builder + while curr is not None and curr.name != ROOT_NAME: + curr = curr.parent + if curr: + source_object_id = curr.get('object_id', None) + # We did not find ROOT_NAME as a parent. This should only happen if we have an invalid + # file as a source, e.g., if during testing we use an arbitrary builder. We check this + # anyways to avoid potential errors just in case + else: + source_object_id = None + warn_msg = "Could not determine source_object_id for builder with path: %s" % path + warnings.warn(warn_msg) # by checking os.isdir makes sure we have a valid link path to a dir for Zarr. For conversion # between backends a user should always use export which takes care of creating a clean set of builders. diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index b9717c09..6d26b95b 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -10,6 +10,7 @@ from zarr import Array as ZarrArray from hdmf.build import DatasetBuilder +from hdmf.data_utils import append_data from hdmf.array import Array from hdmf.query import HDMFDataset, ReferenceResolver, ContainerResolver, BuilderResolver from hdmf.utils import docval, popargs, get_docval @@ -73,6 +74,21 @@ def __iter__(self): def __next__(self): return self._get_ref(super().__next__()) + def append(self, arg): + # Create Builder + builder = self.invert().io.manager.build(arg) + + # Get File/Source Object ID + f_builder = self.invert().io.read_builder() + source_file = self.invert().io.manager.construct(f_builder) + + # Get path + path = self.dataset[0]['path'] + + # Create ZarrReference + ref = self.invert().io._ZarrIO__get_ref(builder,path=path, source_file=source_file) + append_data(self.dataset, ref) + class BuilderResolverMixin(BuilderResolver): # refactor to backend/utils.py """ From cfd2eba36866f79d5f9686bdce08d5a8ad49576d Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 09:15:22 -0700 Subject: [PATCH 02/35] ruff updates --- pyproject.toml | 4 ++-- src/hdmf_zarr/backend.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 56c63b7e..2987aeb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ force-exclude = ''' ''' [tool.ruff] -select = ["E", "F", "T100", "T201", "T203"] +lint.select = ["E", "F", "T100", "T201", "T203"] exclude = [ ".git", ".tox", @@ -128,5 +128,5 @@ line-length = 120 "src/*/__init__.py" = ["F401"] "test_gallery.py" = ["T201"] -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 17 diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 801648a9..463dbb63 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype == object: + if dtype is object: for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype == object: + if dtype is object: io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) From c17445acd6852083f0217734a7199b4548fedee3 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 09:19:20 -0700 Subject: [PATCH 03/35] ruff updates --- src/hdmf_zarr/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 463dbb63..801648a9 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype is object: + if dtype == object: for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype is object: + if dtype == object: io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) From cafc657a63f00eb54422733962645c00d9f7c021 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 09:24:29 -0700 Subject: [PATCH 04/35] ruff updates --- src/hdmf_zarr/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 801648a9..66197c35 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype == object: + if dtype == object: # noqa: F401 for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype == object: + if dtype == object: # noqa: F401 io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) From 1fa504b9560579b1590c479ac9b723472b1a11d1 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 11:19:18 -0700 Subject: [PATCH 05/35] test --- src/hdmf_zarr/backend.py | 4 +- test.nwb/.zgroup | 3 + test_DoR.hdmf/.zattrs | 6 + test_DoR.hdmf/.zgroup | 3 + test_DoR.hdmf/.zmetadata | 127 ++++++++++++++++++ test_DoR.hdmf/baz_data/.zarray | 25 ++++ test_DoR.hdmf/baz_data/.zattrs | 6 + test_DoR.hdmf/baz_data/0 | Bin 0 -> 828 bytes test_DoR.hdmf/bazs/.zgroup | 3 + test_DoR.hdmf/bazs/baz0/.zattrs | 5 + test_DoR.hdmf/bazs/baz0/.zgroup | 3 + test_DoR.hdmf/bazs/baz1/.zattrs | 5 + test_DoR.hdmf/bazs/baz1/.zgroup | 3 + test_DoR.hdmf/bazs/baz2/.zattrs | 5 + test_DoR.hdmf/bazs/baz2/.zgroup | 3 + test_DoR.hdmf/bazs/baz3/.zattrs | 5 + test_DoR.hdmf/bazs/baz3/.zgroup | 3 + test_DoR.hdmf/bazs/baz4/.zattrs | 5 + test_DoR.hdmf/bazs/baz4/.zgroup | 3 + test_DoR.hdmf/bazs/baz5/.zattrs | 5 + test_DoR.hdmf/bazs/baz5/.zgroup | 3 + test_DoR.hdmf/bazs/baz6/.zattrs | 5 + test_DoR.hdmf/bazs/baz6/.zgroup | 3 + test_DoR.hdmf/bazs/baz7/.zattrs | 5 + test_DoR.hdmf/bazs/baz7/.zgroup | 3 + test_DoR.hdmf/bazs/baz8/.zattrs | 5 + test_DoR.hdmf/bazs/baz8/.zgroup | 3 + test_DoR.hdmf/bazs/baz9/.zattrs | 5 + test_DoR.hdmf/bazs/baz9/.zgroup | 3 + test_DoR.hdmf/specifications/.zgroup | 3 + .../specifications/test_core/.zgroup | 3 + .../specifications/test_core/0.1.0/.zgroup | 3 + .../test_core/0.1.0/namespace/.zarray | 30 +++++ .../test_core/0.1.0/namespace/.zattrs | 3 + .../test_core/0.1.0/namespace/0 | 1 + .../test_core/0.1.0/test/.zarray | 30 +++++ .../test_core/0.1.0/test/.zattrs | 3 + .../specifications/test_core/0.1.0/test/0 | 1 + test_io.zarr/.zattrs | 6 + test_io.zarr/.zgroup | 3 + test_io.zarr/.zmetadata | 127 ++++++++++++++++++ test_io.zarr/baz_data/.zarray | 25 ++++ test_io.zarr/baz_data/.zattrs | 6 + test_io.zarr/baz_data/0 | Bin 0 -> 831 bytes test_io.zarr/bazs/.zgroup | 3 + test_io.zarr/bazs/baz0/.zattrs | 5 + test_io.zarr/bazs/baz0/.zgroup | 3 + test_io.zarr/bazs/baz1/.zattrs | 5 + test_io.zarr/bazs/baz1/.zgroup | 3 + test_io.zarr/bazs/baz2/.zattrs | 5 + test_io.zarr/bazs/baz2/.zgroup | 3 + test_io.zarr/bazs/baz3/.zattrs | 5 + test_io.zarr/bazs/baz3/.zgroup | 3 + test_io.zarr/bazs/baz4/.zattrs | 5 + test_io.zarr/bazs/baz4/.zgroup | 3 + test_io.zarr/bazs/baz5/.zattrs | 5 + test_io.zarr/bazs/baz5/.zgroup | 3 + test_io.zarr/bazs/baz6/.zattrs | 5 + test_io.zarr/bazs/baz6/.zgroup | 3 + test_io.zarr/bazs/baz7/.zattrs | 5 + test_io.zarr/bazs/baz7/.zgroup | 3 + test_io.zarr/bazs/baz8/.zattrs | 5 + test_io.zarr/bazs/baz8/.zgroup | 3 + test_io.zarr/bazs/baz9/.zattrs | 5 + test_io.zarr/bazs/baz9/.zgroup | 3 + test_io.zarr/specifications/.zgroup | 3 + test_io.zarr/specifications/test_core/.zgroup | 3 + .../specifications/test_core/0.1.0/.zgroup | 3 + .../test_core/0.1.0/namespace/.zarray | 30 +++++ .../test_core/0.1.0/namespace/.zattrs | 3 + .../test_core/0.1.0/namespace/0 | 1 + .../test_core/0.1.0/test/.zarray | 30 +++++ .../test_core/0.1.0/test/.zattrs | 3 + .../specifications/test_core/0.1.0/test/0 | 1 + tests/unit/test_zarrio.py | 42 ++++++ 75 files changed, 701 insertions(+), 2 deletions(-) create mode 100644 test.nwb/.zgroup create mode 100644 test_DoR.hdmf/.zattrs create mode 100644 test_DoR.hdmf/.zgroup create mode 100644 test_DoR.hdmf/.zmetadata create mode 100644 test_DoR.hdmf/baz_data/.zarray create mode 100644 test_DoR.hdmf/baz_data/.zattrs create mode 100644 test_DoR.hdmf/baz_data/0 create mode 100644 test_DoR.hdmf/bazs/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz0/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz0/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz1/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz1/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz2/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz2/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz3/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz3/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz4/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz4/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz5/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz5/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz6/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz6/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz7/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz7/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz8/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz8/.zgroup create mode 100644 test_DoR.hdmf/bazs/baz9/.zattrs create mode 100644 test_DoR.hdmf/bazs/baz9/.zgroup create mode 100644 test_DoR.hdmf/specifications/.zgroup create mode 100644 test_DoR.hdmf/specifications/test_core/.zgroup create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs create mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/0 create mode 100644 test_io.zarr/.zattrs create mode 100644 test_io.zarr/.zgroup create mode 100644 test_io.zarr/.zmetadata create mode 100644 test_io.zarr/baz_data/.zarray create mode 100644 test_io.zarr/baz_data/.zattrs create mode 100644 test_io.zarr/baz_data/0 create mode 100644 test_io.zarr/bazs/.zgroup create mode 100644 test_io.zarr/bazs/baz0/.zattrs create mode 100644 test_io.zarr/bazs/baz0/.zgroup create mode 100644 test_io.zarr/bazs/baz1/.zattrs create mode 100644 test_io.zarr/bazs/baz1/.zgroup create mode 100644 test_io.zarr/bazs/baz2/.zattrs create mode 100644 test_io.zarr/bazs/baz2/.zgroup create mode 100644 test_io.zarr/bazs/baz3/.zattrs create mode 100644 test_io.zarr/bazs/baz3/.zgroup create mode 100644 test_io.zarr/bazs/baz4/.zattrs create mode 100644 test_io.zarr/bazs/baz4/.zgroup create mode 100644 test_io.zarr/bazs/baz5/.zattrs create mode 100644 test_io.zarr/bazs/baz5/.zgroup create mode 100644 test_io.zarr/bazs/baz6/.zattrs create mode 100644 test_io.zarr/bazs/baz6/.zgroup create mode 100644 test_io.zarr/bazs/baz7/.zattrs create mode 100644 test_io.zarr/bazs/baz7/.zgroup create mode 100644 test_io.zarr/bazs/baz8/.zattrs create mode 100644 test_io.zarr/bazs/baz8/.zgroup create mode 100644 test_io.zarr/bazs/baz9/.zattrs create mode 100644 test_io.zarr/bazs/baz9/.zgroup create mode 100644 test_io.zarr/specifications/.zgroup create mode 100644 test_io.zarr/specifications/test_core/.zgroup create mode 100644 test_io.zarr/specifications/test_core/0.1.0/.zgroup create mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray create mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs create mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/0 create mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/.zarray create mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/.zattrs create mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/0 diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 66197c35..2596c402 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype == object: # noqa: F401 + if dtype == object: # noqa: E721 for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype == object: # noqa: F401 + if dtype == object: # noqa: E721 io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) diff --git a/test.nwb/.zgroup b/test.nwb/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test.nwb/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/.zattrs b/test_DoR.hdmf/.zattrs new file mode 100644 index 00000000..84c77bc0 --- /dev/null +++ b/test_DoR.hdmf/.zattrs @@ -0,0 +1,6 @@ +{ + ".specloc": "specifications", + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "17e61e59-537d-4ce0-9f45-dbb60872f8d8" +} \ No newline at end of file diff --git a/test_DoR.hdmf/.zgroup b/test_DoR.hdmf/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/.zmetadata b/test_DoR.hdmf/.zmetadata new file mode 100644 index 00000000..6fce1878 --- /dev/null +++ b/test_DoR.hdmf/.zmetadata @@ -0,0 +1,127 @@ +{ + "metadata": { + ".zattrs": { + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "17e61e59-537d-4ce0-9f45-dbb60872f8d8" + }, + ".zgroup": { + "zarr_format": 2 + }, + "baz_data/.zarray": { + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 10 + ], + "zarr_format": 2 + }, + "baz_data/.zattrs": { + "data_type": "BazData", + "namespace": "test_core", + "object_id": "26a8db2e-458a-4745-a563-cd989f455912", + "zarr_dtype": "object" + }, + "bazs/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz0/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "6a9c2dac-986a-42bb-b16f-1f8866d446f6" + }, + "bazs/baz0/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz1/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "97bc85bf-87d9-4508-ac6d-cd5d6afd0ea2" + }, + "bazs/baz1/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz2/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a28eeb0b-78a4-4220-a3fb-9e8e5d65b288" + }, + "bazs/baz2/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz3/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "c8e2ffdf-fc44-455b-b24f-72c61c184752" + }, + "bazs/baz3/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz4/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "5d5fe1f3-ed02-4342-8641-bb9b381a1d79" + }, + "bazs/baz4/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz5/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "af1b374d-02ba-465e-a76a-692317f146ee" + }, + "bazs/baz5/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz6/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "98fcd76a-faf7-49ff-812c-9cd9baee9074" + }, + "bazs/baz6/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz7/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "16dcdf9a-2718-4cb4-993a-1e282104b62e" + }, + "bazs/baz7/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz8/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5371e81-55a5-4b70-8f25-cb97b0ccd5f5" + }, + "bazs/baz8/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz9/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "72b357da-b96a-490f-b709-caf9ee538d75" + }, + "bazs/baz9/.zgroup": { + "zarr_format": 2 + } + }, + "zarr_consolidated_format": 1 +} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/.zarray b/test_DoR.hdmf/baz_data/.zarray new file mode 100644 index 00000000..d8d43ec0 --- /dev/null +++ b/test_DoR.hdmf/baz_data/.zarray @@ -0,0 +1,25 @@ +{ + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 10 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/.zattrs b/test_DoR.hdmf/baz_data/.zattrs new file mode 100644 index 00000000..170bdd97 --- /dev/null +++ b/test_DoR.hdmf/baz_data/.zattrs @@ -0,0 +1,6 @@ +{ + "data_type": "BazData", + "namespace": "test_core", + "object_id": "26a8db2e-458a-4745-a563-cd989f455912", + "zarr_dtype": "object" +} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/0 b/test_DoR.hdmf/baz_data/0 new file mode 100644 index 0000000000000000000000000000000000000000..3dbf3387f7099b13d0f757330d3817e2efc7c2d9 GIT binary patch literal 828 zcmZ{iJ!@1!6o&66uHvF-AVEb83Mpc7);n|O69fy3fC~{)3bM?{8Ez!m4ZC-X1Pd)f z3=B3Ie~-P5eX`qVz1jZvza+e@z!{TZaSHFvxV!@S&IEjFvS}ae}$Z-QFWYN_G~&y zJ85&&8x4+AyBzzzJ3PP=vh-S|(@*QwukXvT_dacJZ@;?8?Q$5s=#o8sn>OQ}*6)Y$ zQ5GF8y4}5binrh7%?<{f;lvfCrynzSeLh{x@;3H{DPB7;U7Os%CMX|t-&kN!3bEZZKH@GUg`q#tqhw$Y$KV6n%Zow z;0Q)$lZB=Yk%2IQSYT0Lt%CFAG?*ZP>5#o4G?&GBZ4IKXB`dHjFcIGQpbbz-RJPtS z(7G`|kSa=QW(B=eRt2`XJ_Hp3&J71Q!u8w)1@761SM literal 0 HcmV?d00001 diff --git a/test_DoR.hdmf/bazs/.zgroup b/test_DoR.hdmf/bazs/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz0/.zattrs b/test_DoR.hdmf/bazs/baz0/.zattrs new file mode 100644 index 00000000..8fdd2b28 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz0/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "6a9c2dac-986a-42bb-b16f-1f8866d446f6" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz0/.zgroup b/test_DoR.hdmf/bazs/baz0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz1/.zattrs b/test_DoR.hdmf/bazs/baz1/.zattrs new file mode 100644 index 00000000..5fa14c26 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz1/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "97bc85bf-87d9-4508-ac6d-cd5d6afd0ea2" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz1/.zgroup b/test_DoR.hdmf/bazs/baz1/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz1/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz2/.zattrs b/test_DoR.hdmf/bazs/baz2/.zattrs new file mode 100644 index 00000000..5062f55c --- /dev/null +++ b/test_DoR.hdmf/bazs/baz2/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a28eeb0b-78a4-4220-a3fb-9e8e5d65b288" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz2/.zgroup b/test_DoR.hdmf/bazs/baz2/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz2/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz3/.zattrs b/test_DoR.hdmf/bazs/baz3/.zattrs new file mode 100644 index 00000000..1a36d6da --- /dev/null +++ b/test_DoR.hdmf/bazs/baz3/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "c8e2ffdf-fc44-455b-b24f-72c61c184752" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz3/.zgroup b/test_DoR.hdmf/bazs/baz3/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz3/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz4/.zattrs b/test_DoR.hdmf/bazs/baz4/.zattrs new file mode 100644 index 00000000..2b281476 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz4/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "5d5fe1f3-ed02-4342-8641-bb9b381a1d79" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz4/.zgroup b/test_DoR.hdmf/bazs/baz4/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz4/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz5/.zattrs b/test_DoR.hdmf/bazs/baz5/.zattrs new file mode 100644 index 00000000..f2630eb9 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz5/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "af1b374d-02ba-465e-a76a-692317f146ee" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz5/.zgroup b/test_DoR.hdmf/bazs/baz5/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz5/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz6/.zattrs b/test_DoR.hdmf/bazs/baz6/.zattrs new file mode 100644 index 00000000..54d05304 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz6/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "98fcd76a-faf7-49ff-812c-9cd9baee9074" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz6/.zgroup b/test_DoR.hdmf/bazs/baz6/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz6/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz7/.zattrs b/test_DoR.hdmf/bazs/baz7/.zattrs new file mode 100644 index 00000000..4269a620 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz7/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "16dcdf9a-2718-4cb4-993a-1e282104b62e" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz7/.zgroup b/test_DoR.hdmf/bazs/baz7/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz7/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz8/.zattrs b/test_DoR.hdmf/bazs/baz8/.zattrs new file mode 100644 index 00000000..78544f59 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz8/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5371e81-55a5-4b70-8f25-cb97b0ccd5f5" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz8/.zgroup b/test_DoR.hdmf/bazs/baz8/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz8/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz9/.zattrs b/test_DoR.hdmf/bazs/baz9/.zattrs new file mode 100644 index 00000000..d4068a11 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz9/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "72b357da-b96a-490f-b709-caf9ee538d75" +} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz9/.zgroup b/test_DoR.hdmf/bazs/baz9/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/bazs/baz9/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/.zgroup b/test_DoR.hdmf/specifications/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/specifications/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/.zgroup b/test_DoR.hdmf/specifications/test_core/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup b/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 new file mode 100644 index 00000000..357971a8 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 @@ -0,0 +1 @@ +["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 b/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 new file mode 100644 index 00000000..1f675a9b --- /dev/null +++ b/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 @@ -0,0 +1 @@ +["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_io.zarr/.zattrs b/test_io.zarr/.zattrs new file mode 100644 index 00000000..060de5e4 --- /dev/null +++ b/test_io.zarr/.zattrs @@ -0,0 +1,6 @@ +{ + ".specloc": "specifications", + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "7873102b-129e-48b3-81c0-aff14a1be118" +} \ No newline at end of file diff --git a/test_io.zarr/.zgroup b/test_io.zarr/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/.zmetadata b/test_io.zarr/.zmetadata new file mode 100644 index 00000000..279d774d --- /dev/null +++ b/test_io.zarr/.zmetadata @@ -0,0 +1,127 @@ +{ + "metadata": { + ".zattrs": { + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "7873102b-129e-48b3-81c0-aff14a1be118" + }, + ".zgroup": { + "zarr_format": 2 + }, + "baz_data/.zarray": { + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 10 + ], + "zarr_format": 2 + }, + "baz_data/.zattrs": { + "data_type": "BazData", + "namespace": "test_core", + "object_id": "e9fa51e1-858f-48b3-881f-de250293e1b1", + "zarr_dtype": "object" + }, + "bazs/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz0/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b46fe032-0a0b-4607-9d0a-ddedc98e9901" + }, + "bazs/baz0/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz1/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a83eb557-bedc-4592-9dfc-4441dde8019c" + }, + "bazs/baz1/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz2/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5d83fd0-0e59-4ac7-a35c-6f00f5d74169" + }, + "bazs/baz2/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz3/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "5e4db1a8-ed0e-44a3-b9d0-7841ded3527b" + }, + "bazs/baz3/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz4/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a44db10f-0975-4604-bd49-0c73985e4ada" + }, + "bazs/baz4/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz5/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "0e209f43-0fba-4de6-8d86-45856c28c389" + }, + "bazs/baz5/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz6/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5c36946-c2d5-4827-9814-cccf4b86cab4" + }, + "bazs/baz6/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz7/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "24e8b247-a2f1-429f-994f-9f56f14ccbb3" + }, + "bazs/baz7/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz8/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "1250e47f-fd4c-4e4c-929c-e10574698dd5" + }, + "bazs/baz8/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz9/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "ba4ce365-551a-46f1-9b57-d2ed1bf40531" + }, + "bazs/baz9/.zgroup": { + "zarr_format": 2 + } + }, + "zarr_consolidated_format": 1 +} \ No newline at end of file diff --git a/test_io.zarr/baz_data/.zarray b/test_io.zarr/baz_data/.zarray new file mode 100644 index 00000000..d8d43ec0 --- /dev/null +++ b/test_io.zarr/baz_data/.zarray @@ -0,0 +1,25 @@ +{ + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 10 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/baz_data/.zattrs b/test_io.zarr/baz_data/.zattrs new file mode 100644 index 00000000..8913ecba --- /dev/null +++ b/test_io.zarr/baz_data/.zattrs @@ -0,0 +1,6 @@ +{ + "data_type": "BazData", + "namespace": "test_core", + "object_id": "e9fa51e1-858f-48b3-881f-de250293e1b1", + "zarr_dtype": "object" +} \ No newline at end of file diff --git a/test_io.zarr/baz_data/0 b/test_io.zarr/baz_data/0 new file mode 100644 index 0000000000000000000000000000000000000000..3983a55245af983a9a8492e5e09b8d3b3b6126ef GIT binary patch literal 831 zcmZ`%O=}cE5S>X}C5xg91{F0#2pA8w_UBCZDF+V=E=0&tkflGFNcMx>*+YT{J%kt- za!LDpynFGlL@yp=P2xchHgt72yn3(dRj=gF@^7nI*6tnL_p>Z}j_1$O$Ih3pcxhL& zK3R@uhkZAlhyHkZQ16@h+#IIn_Glj5bh4=DOIN4!)O4f=)ZH;@)oRGFlCYiQAUVfpveJ)X4*lZM3$n^%6lxg+tY*W jV$&Mo0xu*;NwH>R18s3so&`^B6hv|yVmq6FU$g%ksww`; literal 0 HcmV?d00001 diff --git a/test_io.zarr/bazs/.zgroup b/test_io.zarr/bazs/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz0/.zattrs b/test_io.zarr/bazs/baz0/.zattrs new file mode 100644 index 00000000..299d4b73 --- /dev/null +++ b/test_io.zarr/bazs/baz0/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b46fe032-0a0b-4607-9d0a-ddedc98e9901" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz0/.zgroup b/test_io.zarr/bazs/baz0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz1/.zattrs b/test_io.zarr/bazs/baz1/.zattrs new file mode 100644 index 00000000..7d88dd17 --- /dev/null +++ b/test_io.zarr/bazs/baz1/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a83eb557-bedc-4592-9dfc-4441dde8019c" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz1/.zgroup b/test_io.zarr/bazs/baz1/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz1/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz2/.zattrs b/test_io.zarr/bazs/baz2/.zattrs new file mode 100644 index 00000000..de9037aa --- /dev/null +++ b/test_io.zarr/bazs/baz2/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5d83fd0-0e59-4ac7-a35c-6f00f5d74169" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz2/.zgroup b/test_io.zarr/bazs/baz2/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz2/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz3/.zattrs b/test_io.zarr/bazs/baz3/.zattrs new file mode 100644 index 00000000..44b871ec --- /dev/null +++ b/test_io.zarr/bazs/baz3/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "5e4db1a8-ed0e-44a3-b9d0-7841ded3527b" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz3/.zgroup b/test_io.zarr/bazs/baz3/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz3/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz4/.zattrs b/test_io.zarr/bazs/baz4/.zattrs new file mode 100644 index 00000000..81c5a945 --- /dev/null +++ b/test_io.zarr/bazs/baz4/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a44db10f-0975-4604-bd49-0c73985e4ada" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz4/.zgroup b/test_io.zarr/bazs/baz4/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz4/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz5/.zattrs b/test_io.zarr/bazs/baz5/.zattrs new file mode 100644 index 00000000..e15ac094 --- /dev/null +++ b/test_io.zarr/bazs/baz5/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "0e209f43-0fba-4de6-8d86-45856c28c389" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz5/.zgroup b/test_io.zarr/bazs/baz5/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz5/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz6/.zattrs b/test_io.zarr/bazs/baz6/.zattrs new file mode 100644 index 00000000..ec396aa3 --- /dev/null +++ b/test_io.zarr/bazs/baz6/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b5c36946-c2d5-4827-9814-cccf4b86cab4" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz6/.zgroup b/test_io.zarr/bazs/baz6/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz6/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz7/.zattrs b/test_io.zarr/bazs/baz7/.zattrs new file mode 100644 index 00000000..fc80a9f5 --- /dev/null +++ b/test_io.zarr/bazs/baz7/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "24e8b247-a2f1-429f-994f-9f56f14ccbb3" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz7/.zgroup b/test_io.zarr/bazs/baz7/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz7/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz8/.zattrs b/test_io.zarr/bazs/baz8/.zattrs new file mode 100644 index 00000000..64dd7ecc --- /dev/null +++ b/test_io.zarr/bazs/baz8/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "1250e47f-fd4c-4e4c-929c-e10574698dd5" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz8/.zgroup b/test_io.zarr/bazs/baz8/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz8/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz9/.zattrs b/test_io.zarr/bazs/baz9/.zattrs new file mode 100644 index 00000000..95e74f63 --- /dev/null +++ b/test_io.zarr/bazs/baz9/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "ba4ce365-551a-46f1-9b57-d2ed1bf40531" +} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz9/.zgroup b/test_io.zarr/bazs/baz9/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/bazs/baz9/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/.zgroup b/test_io.zarr/specifications/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/specifications/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/.zgroup b/test_io.zarr/specifications/test_core/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/specifications/test_core/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/.zgroup b/test_io.zarr/specifications/test_core/0.1.0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/0 b/test_io.zarr/specifications/test_core/0.1.0/namespace/0 new file mode 100644 index 00000000..357971a8 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/namespace/0 @@ -0,0 +1 @@ +["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/.zarray b/test_io.zarr/specifications/test_core/0.1.0/test/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/test/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs b/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/0 b/test_io.zarr/specifications/test_core/0.1.0/test/0 new file mode 100644 index 00000000..1f675a9b --- /dev/null +++ b/test_io.zarr/specifications/test_core/0.1.0/test/0 @@ -0,0 +1 @@ +["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index 081706a8..97321e21 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -16,6 +16,7 @@ from zarr.storage import (DirectoryStore, TempStore, NestedDirectoryStore) +from tests.unit.utils import (Baz, BazData, BazBucket, get_baz_buildmanager) import zarr from hdmf_zarr.backend import ZarrIO import os @@ -182,3 +183,44 @@ def test_force_open_without_consolidated_fails(self): except ValueError as e: self.fail("ZarrIO.__open_file_consolidated raised an unexpected ValueError: {}".format(e)) + +class TestDatasetofReferences(ZarrStoreTestCase): + def setUpContainer(self): + num_bazs = 10 + # set up dataset of references + bazs = [] + for i in range(num_bazs): + bazs.append(Baz(name='baz%d' % i)) + baz_data = BazData(name='baz_data1', data=bazs) + + bucket = BazBucket(bazs=bazs, baz_data=baz_data) + return bucket + + def get_manager(self): + return get_baz_buildmanager() + + def test_append_references_roundtrip(self): + # Setup a file container with references + num_bazs = 10 + bazs = [] # set up dataset of references + for i in range(num_bazs): + bazs.append(Baz(name='baz%d' % i)) + baz_data = BazData(name='baz_data', data=bazs) + container = BazBucket(bazs=bazs, baz_data=baz_data) + manager = get_baz_buildmanager() + # write to file + with ZarrIO(self.store, manager=manager, mode='w') as writer: + writer.write(container=container) + # read from file and validate references + with ZarrIO(self.store, manager=manager, mode='a') as reader: + read_container = reader.read() + new_baz = Baz(name='baz0') + DoR = read_container.baz_data.data + DoR.append(new_baz) + + expected = {'source': '.', 'path': '/bazs/baz0', + 'object_id': new_baz.object_id, + 'source_object_id': container.object_id} + + self.assertEqual(len(DoR), 11) + self.assertDictEqual(DoR.dataset[10], expected) From d29251f5597d686f9f074825dff5d132516bebb3 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 11:19:42 -0700 Subject: [PATCH 06/35] test --- test.nwb/.zgroup | 3 - test_DoR.hdmf/.zattrs | 6 - test_DoR.hdmf/.zgroup | 3 - test_DoR.hdmf/.zmetadata | 127 ------------------ test_DoR.hdmf/baz_data/.zarray | 25 ---- test_DoR.hdmf/baz_data/.zattrs | 6 - test_DoR.hdmf/baz_data/0 | Bin 828 -> 0 bytes test_DoR.hdmf/bazs/.zgroup | 3 - test_DoR.hdmf/bazs/baz0/.zattrs | 5 - test_DoR.hdmf/bazs/baz0/.zgroup | 3 - test_DoR.hdmf/bazs/baz1/.zattrs | 5 - test_DoR.hdmf/bazs/baz1/.zgroup | 3 - test_DoR.hdmf/bazs/baz2/.zattrs | 5 - test_DoR.hdmf/bazs/baz2/.zgroup | 3 - test_DoR.hdmf/bazs/baz3/.zattrs | 5 - test_DoR.hdmf/bazs/baz3/.zgroup | 3 - test_DoR.hdmf/bazs/baz4/.zattrs | 5 - test_DoR.hdmf/bazs/baz4/.zgroup | 3 - test_DoR.hdmf/bazs/baz5/.zattrs | 5 - test_DoR.hdmf/bazs/baz5/.zgroup | 3 - test_DoR.hdmf/bazs/baz6/.zattrs | 5 - test_DoR.hdmf/bazs/baz6/.zgroup | 3 - test_DoR.hdmf/bazs/baz7/.zattrs | 5 - test_DoR.hdmf/bazs/baz7/.zgroup | 3 - test_DoR.hdmf/bazs/baz8/.zattrs | 5 - test_DoR.hdmf/bazs/baz8/.zgroup | 3 - test_DoR.hdmf/bazs/baz9/.zattrs | 5 - test_DoR.hdmf/bazs/baz9/.zgroup | 3 - test_DoR.hdmf/specifications/.zgroup | 3 - .../specifications/test_core/.zgroup | 3 - .../specifications/test_core/0.1.0/.zgroup | 3 - .../test_core/0.1.0/namespace/.zarray | 30 ----- .../test_core/0.1.0/namespace/.zattrs | 3 - .../test_core/0.1.0/namespace/0 | 1 - .../test_core/0.1.0/test/.zarray | 30 ----- .../test_core/0.1.0/test/.zattrs | 3 - .../specifications/test_core/0.1.0/test/0 | 1 - test_io.zarr/.zattrs | 6 - test_io.zarr/.zgroup | 3 - test_io.zarr/.zmetadata | 127 ------------------ test_io.zarr/baz_data/.zarray | 25 ---- test_io.zarr/baz_data/.zattrs | 6 - test_io.zarr/baz_data/0 | Bin 831 -> 0 bytes test_io.zarr/bazs/.zgroup | 3 - test_io.zarr/bazs/baz0/.zattrs | 5 - test_io.zarr/bazs/baz0/.zgroup | 3 - test_io.zarr/bazs/baz1/.zattrs | 5 - test_io.zarr/bazs/baz1/.zgroup | 3 - test_io.zarr/bazs/baz2/.zattrs | 5 - test_io.zarr/bazs/baz2/.zgroup | 3 - test_io.zarr/bazs/baz3/.zattrs | 5 - test_io.zarr/bazs/baz3/.zgroup | 3 - test_io.zarr/bazs/baz4/.zattrs | 5 - test_io.zarr/bazs/baz4/.zgroup | 3 - test_io.zarr/bazs/baz5/.zattrs | 5 - test_io.zarr/bazs/baz5/.zgroup | 3 - test_io.zarr/bazs/baz6/.zattrs | 5 - test_io.zarr/bazs/baz6/.zgroup | 3 - test_io.zarr/bazs/baz7/.zattrs | 5 - test_io.zarr/bazs/baz7/.zgroup | 3 - test_io.zarr/bazs/baz8/.zattrs | 5 - test_io.zarr/bazs/baz8/.zgroup | 3 - test_io.zarr/bazs/baz9/.zattrs | 5 - test_io.zarr/bazs/baz9/.zgroup | 3 - test_io.zarr/specifications/.zgroup | 3 - test_io.zarr/specifications/test_core/.zgroup | 3 - .../specifications/test_core/0.1.0/.zgroup | 3 - .../test_core/0.1.0/namespace/.zarray | 30 ----- .../test_core/0.1.0/namespace/.zattrs | 3 - .../test_core/0.1.0/namespace/0 | 1 - .../test_core/0.1.0/test/.zarray | 30 ----- .../test_core/0.1.0/test/.zattrs | 3 - .../specifications/test_core/0.1.0/test/0 | 1 - 73 files changed, 657 deletions(-) delete mode 100644 test.nwb/.zgroup delete mode 100644 test_DoR.hdmf/.zattrs delete mode 100644 test_DoR.hdmf/.zgroup delete mode 100644 test_DoR.hdmf/.zmetadata delete mode 100644 test_DoR.hdmf/baz_data/.zarray delete mode 100644 test_DoR.hdmf/baz_data/.zattrs delete mode 100644 test_DoR.hdmf/baz_data/0 delete mode 100644 test_DoR.hdmf/bazs/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz0/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz0/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz1/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz1/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz2/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz2/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz3/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz3/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz4/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz4/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz5/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz5/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz6/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz6/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz7/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz7/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz8/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz8/.zgroup delete mode 100644 test_DoR.hdmf/bazs/baz9/.zattrs delete mode 100644 test_DoR.hdmf/bazs/baz9/.zgroup delete mode 100644 test_DoR.hdmf/specifications/.zgroup delete mode 100644 test_DoR.hdmf/specifications/test_core/.zgroup delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs delete mode 100644 test_DoR.hdmf/specifications/test_core/0.1.0/test/0 delete mode 100644 test_io.zarr/.zattrs delete mode 100644 test_io.zarr/.zgroup delete mode 100644 test_io.zarr/.zmetadata delete mode 100644 test_io.zarr/baz_data/.zarray delete mode 100644 test_io.zarr/baz_data/.zattrs delete mode 100644 test_io.zarr/baz_data/0 delete mode 100644 test_io.zarr/bazs/.zgroup delete mode 100644 test_io.zarr/bazs/baz0/.zattrs delete mode 100644 test_io.zarr/bazs/baz0/.zgroup delete mode 100644 test_io.zarr/bazs/baz1/.zattrs delete mode 100644 test_io.zarr/bazs/baz1/.zgroup delete mode 100644 test_io.zarr/bazs/baz2/.zattrs delete mode 100644 test_io.zarr/bazs/baz2/.zgroup delete mode 100644 test_io.zarr/bazs/baz3/.zattrs delete mode 100644 test_io.zarr/bazs/baz3/.zgroup delete mode 100644 test_io.zarr/bazs/baz4/.zattrs delete mode 100644 test_io.zarr/bazs/baz4/.zgroup delete mode 100644 test_io.zarr/bazs/baz5/.zattrs delete mode 100644 test_io.zarr/bazs/baz5/.zgroup delete mode 100644 test_io.zarr/bazs/baz6/.zattrs delete mode 100644 test_io.zarr/bazs/baz6/.zgroup delete mode 100644 test_io.zarr/bazs/baz7/.zattrs delete mode 100644 test_io.zarr/bazs/baz7/.zgroup delete mode 100644 test_io.zarr/bazs/baz8/.zattrs delete mode 100644 test_io.zarr/bazs/baz8/.zgroup delete mode 100644 test_io.zarr/bazs/baz9/.zattrs delete mode 100644 test_io.zarr/bazs/baz9/.zgroup delete mode 100644 test_io.zarr/specifications/.zgroup delete mode 100644 test_io.zarr/specifications/test_core/.zgroup delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/.zgroup delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/namespace/0 delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/.zarray delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/.zattrs delete mode 100644 test_io.zarr/specifications/test_core/0.1.0/test/0 diff --git a/test.nwb/.zgroup b/test.nwb/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test.nwb/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/.zattrs b/test_DoR.hdmf/.zattrs deleted file mode 100644 index 84c77bc0..00000000 --- a/test_DoR.hdmf/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - ".specloc": "specifications", - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "17e61e59-537d-4ce0-9f45-dbb60872f8d8" -} \ No newline at end of file diff --git a/test_DoR.hdmf/.zgroup b/test_DoR.hdmf/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/.zmetadata b/test_DoR.hdmf/.zmetadata deleted file mode 100644 index 6fce1878..00000000 --- a/test_DoR.hdmf/.zmetadata +++ /dev/null @@ -1,127 +0,0 @@ -{ - "metadata": { - ".zattrs": { - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "17e61e59-537d-4ce0-9f45-dbb60872f8d8" - }, - ".zgroup": { - "zarr_format": 2 - }, - "baz_data/.zarray": { - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 10 - ], - "zarr_format": 2 - }, - "baz_data/.zattrs": { - "data_type": "BazData", - "namespace": "test_core", - "object_id": "26a8db2e-458a-4745-a563-cd989f455912", - "zarr_dtype": "object" - }, - "bazs/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz0/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "6a9c2dac-986a-42bb-b16f-1f8866d446f6" - }, - "bazs/baz0/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz1/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "97bc85bf-87d9-4508-ac6d-cd5d6afd0ea2" - }, - "bazs/baz1/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz2/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a28eeb0b-78a4-4220-a3fb-9e8e5d65b288" - }, - "bazs/baz2/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz3/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "c8e2ffdf-fc44-455b-b24f-72c61c184752" - }, - "bazs/baz3/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz4/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "5d5fe1f3-ed02-4342-8641-bb9b381a1d79" - }, - "bazs/baz4/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz5/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "af1b374d-02ba-465e-a76a-692317f146ee" - }, - "bazs/baz5/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz6/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "98fcd76a-faf7-49ff-812c-9cd9baee9074" - }, - "bazs/baz6/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz7/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "16dcdf9a-2718-4cb4-993a-1e282104b62e" - }, - "bazs/baz7/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz8/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5371e81-55a5-4b70-8f25-cb97b0ccd5f5" - }, - "bazs/baz8/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz9/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "72b357da-b96a-490f-b709-caf9ee538d75" - }, - "bazs/baz9/.zgroup": { - "zarr_format": 2 - } - }, - "zarr_consolidated_format": 1 -} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/.zarray b/test_DoR.hdmf/baz_data/.zarray deleted file mode 100644 index d8d43ec0..00000000 --- a/test_DoR.hdmf/baz_data/.zarray +++ /dev/null @@ -1,25 +0,0 @@ -{ - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 10 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/.zattrs b/test_DoR.hdmf/baz_data/.zattrs deleted file mode 100644 index 170bdd97..00000000 --- a/test_DoR.hdmf/baz_data/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data_type": "BazData", - "namespace": "test_core", - "object_id": "26a8db2e-458a-4745-a563-cd989f455912", - "zarr_dtype": "object" -} \ No newline at end of file diff --git a/test_DoR.hdmf/baz_data/0 b/test_DoR.hdmf/baz_data/0 deleted file mode 100644 index 3dbf3387f7099b13d0f757330d3817e2efc7c2d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 828 zcmZ{iJ!@1!6o&66uHvF-AVEb83Mpc7);n|O69fy3fC~{)3bM?{8Ez!m4ZC-X1Pd)f z3=B3Ie~-P5eX`qVz1jZvza+e@z!{TZaSHFvxV!@S&IEjFvS}ae}$Z-QFWYN_G~&y zJ85&&8x4+AyBzzzJ3PP=vh-S|(@*QwukXvT_dacJZ@;?8?Q$5s=#o8sn>OQ}*6)Y$ zQ5GF8y4}5binrh7%?<{f;lvfCrynzSeLh{x@;3H{DPB7;U7Os%CMX|t-&kN!3bEZZKH@GUg`q#tqhw$Y$KV6n%Zow z;0Q)$lZB=Yk%2IQSYT0Lt%CFAG?*ZP>5#o4G?&GBZ4IKXB`dHjFcIGQpbbz-RJPtS z(7G`|kSa=QW(B=eRt2`XJ_Hp3&J71Q!u8w)1@761SM diff --git a/test_DoR.hdmf/bazs/.zgroup b/test_DoR.hdmf/bazs/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz0/.zattrs b/test_DoR.hdmf/bazs/baz0/.zattrs deleted file mode 100644 index 8fdd2b28..00000000 --- a/test_DoR.hdmf/bazs/baz0/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "6a9c2dac-986a-42bb-b16f-1f8866d446f6" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz0/.zgroup b/test_DoR.hdmf/bazs/baz0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz1/.zattrs b/test_DoR.hdmf/bazs/baz1/.zattrs deleted file mode 100644 index 5fa14c26..00000000 --- a/test_DoR.hdmf/bazs/baz1/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "97bc85bf-87d9-4508-ac6d-cd5d6afd0ea2" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz1/.zgroup b/test_DoR.hdmf/bazs/baz1/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz1/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz2/.zattrs b/test_DoR.hdmf/bazs/baz2/.zattrs deleted file mode 100644 index 5062f55c..00000000 --- a/test_DoR.hdmf/bazs/baz2/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a28eeb0b-78a4-4220-a3fb-9e8e5d65b288" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz2/.zgroup b/test_DoR.hdmf/bazs/baz2/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz2/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz3/.zattrs b/test_DoR.hdmf/bazs/baz3/.zattrs deleted file mode 100644 index 1a36d6da..00000000 --- a/test_DoR.hdmf/bazs/baz3/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "c8e2ffdf-fc44-455b-b24f-72c61c184752" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz3/.zgroup b/test_DoR.hdmf/bazs/baz3/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz3/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz4/.zattrs b/test_DoR.hdmf/bazs/baz4/.zattrs deleted file mode 100644 index 2b281476..00000000 --- a/test_DoR.hdmf/bazs/baz4/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "5d5fe1f3-ed02-4342-8641-bb9b381a1d79" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz4/.zgroup b/test_DoR.hdmf/bazs/baz4/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz4/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz5/.zattrs b/test_DoR.hdmf/bazs/baz5/.zattrs deleted file mode 100644 index f2630eb9..00000000 --- a/test_DoR.hdmf/bazs/baz5/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "af1b374d-02ba-465e-a76a-692317f146ee" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz5/.zgroup b/test_DoR.hdmf/bazs/baz5/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz5/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz6/.zattrs b/test_DoR.hdmf/bazs/baz6/.zattrs deleted file mode 100644 index 54d05304..00000000 --- a/test_DoR.hdmf/bazs/baz6/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "98fcd76a-faf7-49ff-812c-9cd9baee9074" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz6/.zgroup b/test_DoR.hdmf/bazs/baz6/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz6/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz7/.zattrs b/test_DoR.hdmf/bazs/baz7/.zattrs deleted file mode 100644 index 4269a620..00000000 --- a/test_DoR.hdmf/bazs/baz7/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "16dcdf9a-2718-4cb4-993a-1e282104b62e" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz7/.zgroup b/test_DoR.hdmf/bazs/baz7/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz7/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz8/.zattrs b/test_DoR.hdmf/bazs/baz8/.zattrs deleted file mode 100644 index 78544f59..00000000 --- a/test_DoR.hdmf/bazs/baz8/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5371e81-55a5-4b70-8f25-cb97b0ccd5f5" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz8/.zgroup b/test_DoR.hdmf/bazs/baz8/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz8/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz9/.zattrs b/test_DoR.hdmf/bazs/baz9/.zattrs deleted file mode 100644 index d4068a11..00000000 --- a/test_DoR.hdmf/bazs/baz9/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "72b357da-b96a-490f-b709-caf9ee538d75" -} \ No newline at end of file diff --git a/test_DoR.hdmf/bazs/baz9/.zgroup b/test_DoR.hdmf/bazs/baz9/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/bazs/baz9/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/.zgroup b/test_DoR.hdmf/specifications/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/specifications/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/.zgroup b/test_DoR.hdmf/specifications/test_core/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/specifications/test_core/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup b/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 b/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 deleted file mode 100644 index 357971a8..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/namespace/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs b/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/test/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 b/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 deleted file mode 100644 index 1f675a9b..00000000 --- a/test_DoR.hdmf/specifications/test_core/0.1.0/test/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_io.zarr/.zattrs b/test_io.zarr/.zattrs deleted file mode 100644 index 060de5e4..00000000 --- a/test_io.zarr/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - ".specloc": "specifications", - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "7873102b-129e-48b3-81c0-aff14a1be118" -} \ No newline at end of file diff --git a/test_io.zarr/.zgroup b/test_io.zarr/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/.zmetadata b/test_io.zarr/.zmetadata deleted file mode 100644 index 279d774d..00000000 --- a/test_io.zarr/.zmetadata +++ /dev/null @@ -1,127 +0,0 @@ -{ - "metadata": { - ".zattrs": { - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "7873102b-129e-48b3-81c0-aff14a1be118" - }, - ".zgroup": { - "zarr_format": 2 - }, - "baz_data/.zarray": { - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 10 - ], - "zarr_format": 2 - }, - "baz_data/.zattrs": { - "data_type": "BazData", - "namespace": "test_core", - "object_id": "e9fa51e1-858f-48b3-881f-de250293e1b1", - "zarr_dtype": "object" - }, - "bazs/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz0/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b46fe032-0a0b-4607-9d0a-ddedc98e9901" - }, - "bazs/baz0/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz1/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a83eb557-bedc-4592-9dfc-4441dde8019c" - }, - "bazs/baz1/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz2/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5d83fd0-0e59-4ac7-a35c-6f00f5d74169" - }, - "bazs/baz2/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz3/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "5e4db1a8-ed0e-44a3-b9d0-7841ded3527b" - }, - "bazs/baz3/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz4/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a44db10f-0975-4604-bd49-0c73985e4ada" - }, - "bazs/baz4/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz5/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "0e209f43-0fba-4de6-8d86-45856c28c389" - }, - "bazs/baz5/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz6/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5c36946-c2d5-4827-9814-cccf4b86cab4" - }, - "bazs/baz6/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz7/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "24e8b247-a2f1-429f-994f-9f56f14ccbb3" - }, - "bazs/baz7/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz8/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "1250e47f-fd4c-4e4c-929c-e10574698dd5" - }, - "bazs/baz8/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz9/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "ba4ce365-551a-46f1-9b57-d2ed1bf40531" - }, - "bazs/baz9/.zgroup": { - "zarr_format": 2 - } - }, - "zarr_consolidated_format": 1 -} \ No newline at end of file diff --git a/test_io.zarr/baz_data/.zarray b/test_io.zarr/baz_data/.zarray deleted file mode 100644 index d8d43ec0..00000000 --- a/test_io.zarr/baz_data/.zarray +++ /dev/null @@ -1,25 +0,0 @@ -{ - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 10 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/baz_data/.zattrs b/test_io.zarr/baz_data/.zattrs deleted file mode 100644 index 8913ecba..00000000 --- a/test_io.zarr/baz_data/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data_type": "BazData", - "namespace": "test_core", - "object_id": "e9fa51e1-858f-48b3-881f-de250293e1b1", - "zarr_dtype": "object" -} \ No newline at end of file diff --git a/test_io.zarr/baz_data/0 b/test_io.zarr/baz_data/0 deleted file mode 100644 index 3983a55245af983a9a8492e5e09b8d3b3b6126ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 831 zcmZ`%O=}cE5S>X}C5xg91{F0#2pA8w_UBCZDF+V=E=0&tkflGFNcMx>*+YT{J%kt- za!LDpynFGlL@yp=P2xchHgt72yn3(dRj=gF@^7nI*6tnL_p>Z}j_1$O$Ih3pcxhL& zK3R@uhkZAlhyHkZQ16@h+#IIn_Glj5bh4=DOIN4!)O4f=)ZH;@)oRGFlCYiQAUVfpveJ)X4*lZM3$n^%6lxg+tY*W jV$&Mo0xu*;NwH>R18s3so&`^B6hv|yVmq6FU$g%ksww`; diff --git a/test_io.zarr/bazs/.zgroup b/test_io.zarr/bazs/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz0/.zattrs b/test_io.zarr/bazs/baz0/.zattrs deleted file mode 100644 index 299d4b73..00000000 --- a/test_io.zarr/bazs/baz0/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b46fe032-0a0b-4607-9d0a-ddedc98e9901" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz0/.zgroup b/test_io.zarr/bazs/baz0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz1/.zattrs b/test_io.zarr/bazs/baz1/.zattrs deleted file mode 100644 index 7d88dd17..00000000 --- a/test_io.zarr/bazs/baz1/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a83eb557-bedc-4592-9dfc-4441dde8019c" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz1/.zgroup b/test_io.zarr/bazs/baz1/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz1/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz2/.zattrs b/test_io.zarr/bazs/baz2/.zattrs deleted file mode 100644 index de9037aa..00000000 --- a/test_io.zarr/bazs/baz2/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5d83fd0-0e59-4ac7-a35c-6f00f5d74169" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz2/.zgroup b/test_io.zarr/bazs/baz2/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz2/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz3/.zattrs b/test_io.zarr/bazs/baz3/.zattrs deleted file mode 100644 index 44b871ec..00000000 --- a/test_io.zarr/bazs/baz3/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "5e4db1a8-ed0e-44a3-b9d0-7841ded3527b" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz3/.zgroup b/test_io.zarr/bazs/baz3/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz3/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz4/.zattrs b/test_io.zarr/bazs/baz4/.zattrs deleted file mode 100644 index 81c5a945..00000000 --- a/test_io.zarr/bazs/baz4/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a44db10f-0975-4604-bd49-0c73985e4ada" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz4/.zgroup b/test_io.zarr/bazs/baz4/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz4/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz5/.zattrs b/test_io.zarr/bazs/baz5/.zattrs deleted file mode 100644 index e15ac094..00000000 --- a/test_io.zarr/bazs/baz5/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "0e209f43-0fba-4de6-8d86-45856c28c389" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz5/.zgroup b/test_io.zarr/bazs/baz5/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz5/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz6/.zattrs b/test_io.zarr/bazs/baz6/.zattrs deleted file mode 100644 index ec396aa3..00000000 --- a/test_io.zarr/bazs/baz6/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b5c36946-c2d5-4827-9814-cccf4b86cab4" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz6/.zgroup b/test_io.zarr/bazs/baz6/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz6/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz7/.zattrs b/test_io.zarr/bazs/baz7/.zattrs deleted file mode 100644 index fc80a9f5..00000000 --- a/test_io.zarr/bazs/baz7/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "24e8b247-a2f1-429f-994f-9f56f14ccbb3" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz7/.zgroup b/test_io.zarr/bazs/baz7/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz7/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz8/.zattrs b/test_io.zarr/bazs/baz8/.zattrs deleted file mode 100644 index 64dd7ecc..00000000 --- a/test_io.zarr/bazs/baz8/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "1250e47f-fd4c-4e4c-929c-e10574698dd5" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz8/.zgroup b/test_io.zarr/bazs/baz8/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz8/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz9/.zattrs b/test_io.zarr/bazs/baz9/.zattrs deleted file mode 100644 index 95e74f63..00000000 --- a/test_io.zarr/bazs/baz9/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "ba4ce365-551a-46f1-9b57-d2ed1bf40531" -} \ No newline at end of file diff --git a/test_io.zarr/bazs/baz9/.zgroup b/test_io.zarr/bazs/baz9/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/bazs/baz9/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/.zgroup b/test_io.zarr/specifications/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/specifications/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/.zgroup b/test_io.zarr/specifications/test_core/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/specifications/test_core/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/.zgroup b/test_io.zarr/specifications/test_core/0.1.0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs b/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/namespace/0 b/test_io.zarr/specifications/test_core/0.1.0/namespace/0 deleted file mode 100644 index 357971a8..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/namespace/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/.zarray b/test_io.zarr/specifications/test_core/0.1.0/test/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/test/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs b/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/test_io.zarr/specifications/test_core/0.1.0/test/0 b/test_io.zarr/specifications/test_core/0.1.0/test/0 deleted file mode 100644 index 1f675a9b..00000000 --- a/test_io.zarr/specifications/test_core/0.1.0/test/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file From dfde2f08c30af8e5ee4151015b566fd09e89bd28 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 3 Jul 2024 11:20:57 -0700 Subject: [PATCH 07/35] test --- tests/unit/test_zarrio.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index 97321e21..d18af742 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -185,19 +185,19 @@ def test_force_open_without_consolidated_fails(self): class TestDatasetofReferences(ZarrStoreTestCase): - def setUpContainer(self): - num_bazs = 10 - # set up dataset of references - bazs = [] - for i in range(num_bazs): - bazs.append(Baz(name='baz%d' % i)) - baz_data = BazData(name='baz_data1', data=bazs) - - bucket = BazBucket(bazs=bazs, baz_data=baz_data) - return bucket - - def get_manager(self): - return get_baz_buildmanager() + def tearDown(self): + """ + Remove all files and folders defined by self.store_path + """ + paths = self.store_path if isinstance(self.store_path, list) else [self.store_path, ] + for path in paths: + if os.path.exists(path): + if os.path.isdir(path): + shutil.rmtree(path) + elif os.path.isfile(path): + os.remove(path) + else: + warnings.warn("Could not remove: %s" % path) def test_append_references_roundtrip(self): # Setup a file container with references From d5c77a3342a30f9c9eae1dd9fc8c322251730491 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 8 Jul 2024 08:04:04 -0700 Subject: [PATCH 08/35] test --- tests/unit/test_io.zarr/.zattrs | 6 + tests/unit/test_io.zarr/.zgroup | 3 + tests/unit/test_io.zarr/.zmetadata | 127 ++++++++++++++++++ tests/unit/test_io.zarr/baz_data/.zarray | 26 ++++ tests/unit/test_io.zarr/baz_data/.zattrs | 6 + tests/unit/test_io.zarr/baz_data/0 | Bin 0 -> 828 bytes tests/unit/test_io.zarr/baz_data/1 | Bin 0 -> 365 bytes tests/unit/test_io.zarr/bazs/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz0/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz0/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz1/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz1/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz2/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz2/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz3/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz3/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz4/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz4/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz5/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz5/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz6/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz6/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz7/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz7/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz8/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz8/.zgroup | 3 + tests/unit/test_io.zarr/bazs/baz9/.zattrs | 5 + tests/unit/test_io.zarr/bazs/baz9/.zgroup | 3 + .../unit/test_io.zarr/specifications/.zgroup | 3 + .../specifications/test_core/.zgroup | 3 + .../specifications/test_core/0.1.0/.zgroup | 3 + .../test_core/0.1.0/namespace/.zarray | 30 +++++ .../test_core/0.1.0/namespace/.zattrs | 3 + .../test_core/0.1.0/namespace/0 | 1 + .../test_core/0.1.0/test/.zarray | 30 +++++ .../test_core/0.1.0/test/.zattrs | 3 + .../specifications/test_core/0.1.0/test/0 | 1 + tests/unit/test_zarrio.py | 16 ++- 38 files changed, 340 insertions(+), 4 deletions(-) create mode 100644 tests/unit/test_io.zarr/.zattrs create mode 100644 tests/unit/test_io.zarr/.zgroup create mode 100644 tests/unit/test_io.zarr/.zmetadata create mode 100644 tests/unit/test_io.zarr/baz_data/.zarray create mode 100644 tests/unit/test_io.zarr/baz_data/.zattrs create mode 100644 tests/unit/test_io.zarr/baz_data/0 create mode 100644 tests/unit/test_io.zarr/baz_data/1 create mode 100644 tests/unit/test_io.zarr/bazs/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz0/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz0/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz1/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz1/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz2/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz2/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz3/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz3/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz4/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz4/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz5/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz5/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz6/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz6/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz7/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz7/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz8/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz8/.zgroup create mode 100644 tests/unit/test_io.zarr/bazs/baz9/.zattrs create mode 100644 tests/unit/test_io.zarr/bazs/baz9/.zgroup create mode 100644 tests/unit/test_io.zarr/specifications/.zgroup create mode 100644 tests/unit/test_io.zarr/specifications/test_core/.zgroup create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs create mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 diff --git a/tests/unit/test_io.zarr/.zattrs b/tests/unit/test_io.zarr/.zattrs new file mode 100644 index 00000000..60e19004 --- /dev/null +++ b/tests/unit/test_io.zarr/.zattrs @@ -0,0 +1,6 @@ +{ + ".specloc": "specifications", + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "a5849baa-8a71-4897-a578-9f670650764c" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/.zgroup b/tests/unit/test_io.zarr/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/.zmetadata b/tests/unit/test_io.zarr/.zmetadata new file mode 100644 index 00000000..fe156b6d --- /dev/null +++ b/tests/unit/test_io.zarr/.zmetadata @@ -0,0 +1,127 @@ +{ + "metadata": { + ".zattrs": { + "data_type": "BazBucket", + "namespace": "test_core", + "object_id": "a5849baa-8a71-4897-a578-9f670650764c" + }, + ".zgroup": { + "zarr_format": 2 + }, + "baz_data/.zarray": { + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 10 + ], + "zarr_format": 2 + }, + "baz_data/.zattrs": { + "data_type": "BazData", + "namespace": "test_core", + "object_id": "a78a77e2-54ad-4fb4-bf03-7f8079e0d1e6", + "zarr_dtype": "object" + }, + "bazs/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz0/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "9f8c4a05-9aaf-4e08-8dab-7e61dc4b017a" + }, + "bazs/baz0/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz1/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "765c7685-6c71-40d0-b084-77dd687165c1" + }, + "bazs/baz1/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz2/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "8e58a564-d4f0-4d0c-aac6-108a9fa6e0e9" + }, + "bazs/baz2/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz3/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "25f36c0f-e128-497d-a9ed-c72d7ab16b9b" + }, + "bazs/baz3/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz4/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a2016c27-068b-48b8-80fa-7ac12ee98506" + }, + "bazs/baz4/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz5/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "1afedbee-0ea6-47f6-8301-1d1b01498757" + }, + "bazs/baz5/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz6/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "ebae9f41-620b-4572-b4f0-75235fc6054b" + }, + "bazs/baz6/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz7/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "d78352a7-e0d4-4b41-a75f-a675ec6d5716" + }, + "bazs/baz7/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz8/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b68b56fb-11fb-4c54-b966-f5acbb182e7c" + }, + "bazs/baz8/.zgroup": { + "zarr_format": 2 + }, + "bazs/baz9/.zattrs": { + "data_type": "Baz", + "namespace": "test_core", + "object_id": "e78ef2bd-462e-46c2-ba3b-b893dc90c15e" + }, + "bazs/baz9/.zgroup": { + "zarr_format": 2 + } + }, + "zarr_consolidated_format": 1 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/.zarray b/tests/unit/test_io.zarr/baz_data/.zarray new file mode 100644 index 00000000..87547a61 --- /dev/null +++ b/tests/unit/test_io.zarr/baz_data/.zarray @@ -0,0 +1,26 @@ +{ + "chunks": [ + 10 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dimension_separator": ".", + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "id": "pickle", + "protocol": 5 + } + ], + "order": "C", + "shape": [ + 11 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/.zattrs b/tests/unit/test_io.zarr/baz_data/.zattrs new file mode 100644 index 00000000..d72489ce --- /dev/null +++ b/tests/unit/test_io.zarr/baz_data/.zattrs @@ -0,0 +1,6 @@ +{ + "data_type": "BazData", + "namespace": "test_core", + "object_id": "a78a77e2-54ad-4fb4-bf03-7f8079e0d1e6", + "zarr_dtype": "object" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/0 b/tests/unit/test_io.zarr/baz_data/0 new file mode 100644 index 0000000000000000000000000000000000000000..14e2708e566f8daaf545008c1fef71b8919f1fb1 GIT binary patch literal 828 zcmZ{iJ!@1!6o&5_qZkwoxTuIhAw?|CI&<%Qf?#2>;6j9yf-GmgxRGQx?A|RBEVKwQ zFxX`LJ@z*Km1twR&LkFEI56klVV?KpoR_)Md(!*1QdMO?&--pwRh#+ybNpfT%h&u< zR_sp}`v->uJDvH#{$j7&#n}uGQ@lBzc{`oVyV=5a=`6+73oym&6L*Q6rBQX9UiM5n zNjqt4)EliGr*u{LD{maeDeObJyn6#Vj9VZ;;~E1MJ!q*Pa9 zL~tSnvuV-xOH=K=_I~@|q&jCbwGZQ_6x>RoI0##`#1Sw=F_6+Zp(M@M8GO`k{G*stm?IVttpG|C>VU!%um5XOvS>b6%YMy6BPWBN zU}fzj8Y+x7!)k4v6&Pzmg{>tJp-i6HOY*wm!3x6JMH^YM>^rF%UZVt090O*u z3?&bMLUM0~<2k|NtO{&$t6T&Fl;*-LXJE7t5I9<6sH(lR1=hpr{IQqHhuSz`qV~Di W+y*uVjM9y>npn#HWu`vA%fWA!b^ag# literal 0 HcmV?d00001 diff --git a/tests/unit/test_io.zarr/baz_data/1 b/tests/unit/test_io.zarr/baz_data/1 new file mode 100644 index 0000000000000000000000000000000000000000..3f40cb6c98b53bb5bc05e7604a682c44215a2009 GIT binary patch literal 365 zcmZ8c!AiqG5Y4t$u_$`+3-nMA8>2~@&B=o|0}*-@O4v;{q|zj1vpKYQsE4A3xpn+r z-Lx0+4R3~F-g_`Ta!sbhvO1QA>%sTLj1F*BwdG=Ir?rxH+0ONhE5(-xXNi(&T{T*@ zsm2|`U@t^Csj`D)hmp0xCnE3@Cpd~oG~8g(he4*73)xwEFATR|hif0mJH~PR{9~|h z(W6GOo#F^Cimc3&m5H@mJ)1WO=dWg&$XqH}rCrwThtVB3b*sz@#6~z;a9tn_?*v~p zU2_mlYw;#ioy;hmolRsa|QJ>#wnL9qz?0h>xY5sJ#d7}LuT^V$$jR9f^*7v eaBu8kK)D|<8s_7`8T(E!_EKyk>wih}ko^m;n||Z~ literal 0 HcmV?d00001 diff --git a/tests/unit/test_io.zarr/bazs/.zgroup b/tests/unit/test_io.zarr/bazs/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz0/.zattrs b/tests/unit/test_io.zarr/bazs/baz0/.zattrs new file mode 100644 index 00000000..95d1ab40 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz0/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "9f8c4a05-9aaf-4e08-8dab-7e61dc4b017a" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz0/.zgroup b/tests/unit/test_io.zarr/bazs/baz0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz1/.zattrs b/tests/unit/test_io.zarr/bazs/baz1/.zattrs new file mode 100644 index 00000000..3fc605d5 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz1/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "765c7685-6c71-40d0-b084-77dd687165c1" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz1/.zgroup b/tests/unit/test_io.zarr/bazs/baz1/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz1/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz2/.zattrs b/tests/unit/test_io.zarr/bazs/baz2/.zattrs new file mode 100644 index 00000000..cff69f82 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz2/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "8e58a564-d4f0-4d0c-aac6-108a9fa6e0e9" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz2/.zgroup b/tests/unit/test_io.zarr/bazs/baz2/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz2/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz3/.zattrs b/tests/unit/test_io.zarr/bazs/baz3/.zattrs new file mode 100644 index 00000000..a31559cf --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz3/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "25f36c0f-e128-497d-a9ed-c72d7ab16b9b" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz3/.zgroup b/tests/unit/test_io.zarr/bazs/baz3/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz3/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz4/.zattrs b/tests/unit/test_io.zarr/bazs/baz4/.zattrs new file mode 100644 index 00000000..87799e3b --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz4/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "a2016c27-068b-48b8-80fa-7ac12ee98506" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz4/.zgroup b/tests/unit/test_io.zarr/bazs/baz4/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz4/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz5/.zattrs b/tests/unit/test_io.zarr/bazs/baz5/.zattrs new file mode 100644 index 00000000..18624c16 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz5/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "1afedbee-0ea6-47f6-8301-1d1b01498757" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz5/.zgroup b/tests/unit/test_io.zarr/bazs/baz5/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz5/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz6/.zattrs b/tests/unit/test_io.zarr/bazs/baz6/.zattrs new file mode 100644 index 00000000..07c4c8ef --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz6/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "ebae9f41-620b-4572-b4f0-75235fc6054b" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz6/.zgroup b/tests/unit/test_io.zarr/bazs/baz6/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz6/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz7/.zattrs b/tests/unit/test_io.zarr/bazs/baz7/.zattrs new file mode 100644 index 00000000..4023d2b4 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz7/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "d78352a7-e0d4-4b41-a75f-a675ec6d5716" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz7/.zgroup b/tests/unit/test_io.zarr/bazs/baz7/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz7/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz8/.zattrs b/tests/unit/test_io.zarr/bazs/baz8/.zattrs new file mode 100644 index 00000000..3df65a4c --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz8/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "b68b56fb-11fb-4c54-b966-f5acbb182e7c" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz8/.zgroup b/tests/unit/test_io.zarr/bazs/baz8/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz8/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz9/.zattrs b/tests/unit/test_io.zarr/bazs/baz9/.zattrs new file mode 100644 index 00000000..c89473e8 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz9/.zattrs @@ -0,0 +1,5 @@ +{ + "data_type": "Baz", + "namespace": "test_core", + "object_id": "e78ef2bd-462e-46c2-ba3b-b893dc90c15e" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz9/.zgroup b/tests/unit/test_io.zarr/bazs/baz9/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/bazs/baz9/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/.zgroup b/tests/unit/test_io.zarr/specifications/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/.zgroup b/tests/unit/test_io.zarr/specifications/test_core/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup new file mode 100644 index 00000000..3b7daf22 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup @@ -0,0 +1,3 @@ +{ + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 new file mode 100644 index 00000000..357971a8 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 @@ -0,0 +1 @@ +["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray new file mode 100644 index 00000000..7d100603 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray @@ -0,0 +1,30 @@ +{ + "chunks": [ + 1 + ], + "compressor": null, + "dtype": "|O", + "fill_value": 0, + "filters": [ + { + "allow_nan": true, + "check_circular": true, + "encoding": "utf-8", + "ensure_ascii": true, + "id": "json2", + "indent": null, + "separators": [ + ",", + ":" + ], + "skipkeys": false, + "sort_keys": true, + "strict": true + } + ], + "order": "C", + "shape": [ + 1 + ], + "zarr_format": 2 +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs new file mode 100644 index 00000000..2592fe05 --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs @@ -0,0 +1,3 @@ +{ + "zarr_dtype": "scalar" +} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 new file mode 100644 index 00000000..1f675a9b --- /dev/null +++ b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 @@ -0,0 +1 @@ +["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index d18af742..d1b209b3 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -20,6 +20,8 @@ import zarr from hdmf_zarr.backend import ZarrIO import os +import shutil +import warnings CUR_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -185,6 +187,10 @@ def test_force_open_without_consolidated_fails(self): class TestDatasetofReferences(ZarrStoreTestCase): + def setUp(self): + self.store_path = "test_io.zarr" + self.store = DirectoryStore(self.store_path) + def tearDown(self): """ Remove all files and folders defined by self.store_path @@ -212,15 +218,17 @@ def test_append_references_roundtrip(self): with ZarrIO(self.store, manager=manager, mode='w') as writer: writer.write(container=container) # read from file and validate references - with ZarrIO(self.store, manager=manager, mode='a') as reader: - read_container = reader.read() + with ZarrIO(self.store, manager=manager, mode='a') as append_io: + read_container = append_io.read() new_baz = Baz(name='baz0') DoR = read_container.baz_data.data DoR.append(new_baz) + with ZarrIO(self.store, manager=manager, mode='a') as reader: + read_container = reader.read() expected = {'source': '.', 'path': '/bazs/baz0', 'object_id': new_baz.object_id, 'source_object_id': container.object_id} - self.assertEqual(len(DoR), 11) - self.assertDictEqual(DoR.dataset[10], expected) + self.assertEqual(len(read_container.baz_data.data), 11) + self.assertDictEqual(read_container.baz_data.data.dataset[10], expected) From 73371b9ce56509d55591fcdedebbbe26d6a8d7cb Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 8 Jul 2024 08:04:31 -0700 Subject: [PATCH 09/35] test --- tests/unit/test_io.zarr/.zattrs | 6 - tests/unit/test_io.zarr/.zgroup | 3 - tests/unit/test_io.zarr/.zmetadata | 127 ------------------ tests/unit/test_io.zarr/baz_data/.zarray | 26 ---- tests/unit/test_io.zarr/baz_data/.zattrs | 6 - tests/unit/test_io.zarr/baz_data/0 | Bin 828 -> 0 bytes tests/unit/test_io.zarr/baz_data/1 | Bin 365 -> 0 bytes tests/unit/test_io.zarr/bazs/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz0/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz0/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz1/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz1/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz2/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz2/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz3/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz3/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz4/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz4/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz5/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz5/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz6/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz6/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz7/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz7/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz8/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz8/.zgroup | 3 - tests/unit/test_io.zarr/bazs/baz9/.zattrs | 5 - tests/unit/test_io.zarr/bazs/baz9/.zgroup | 3 - .../unit/test_io.zarr/specifications/.zgroup | 3 - .../specifications/test_core/.zgroup | 3 - .../specifications/test_core/0.1.0/.zgroup | 3 - .../test_core/0.1.0/namespace/.zarray | 30 ----- .../test_core/0.1.0/namespace/.zattrs | 3 - .../test_core/0.1.0/namespace/0 | 1 - .../test_core/0.1.0/test/.zarray | 30 ----- .../test_core/0.1.0/test/.zattrs | 3 - .../specifications/test_core/0.1.0/test/0 | 1 - 37 files changed, 328 deletions(-) delete mode 100644 tests/unit/test_io.zarr/.zattrs delete mode 100644 tests/unit/test_io.zarr/.zgroup delete mode 100644 tests/unit/test_io.zarr/.zmetadata delete mode 100644 tests/unit/test_io.zarr/baz_data/.zarray delete mode 100644 tests/unit/test_io.zarr/baz_data/.zattrs delete mode 100644 tests/unit/test_io.zarr/baz_data/0 delete mode 100644 tests/unit/test_io.zarr/baz_data/1 delete mode 100644 tests/unit/test_io.zarr/bazs/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz0/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz0/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz1/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz1/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz2/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz2/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz3/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz3/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz4/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz4/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz5/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz5/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz6/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz6/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz7/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz7/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz8/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz8/.zgroup delete mode 100644 tests/unit/test_io.zarr/bazs/baz9/.zattrs delete mode 100644 tests/unit/test_io.zarr/bazs/baz9/.zgroup delete mode 100644 tests/unit/test_io.zarr/specifications/.zgroup delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/.zgroup delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs delete mode 100644 tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 diff --git a/tests/unit/test_io.zarr/.zattrs b/tests/unit/test_io.zarr/.zattrs deleted file mode 100644 index 60e19004..00000000 --- a/tests/unit/test_io.zarr/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - ".specloc": "specifications", - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "a5849baa-8a71-4897-a578-9f670650764c" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/.zgroup b/tests/unit/test_io.zarr/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/.zmetadata b/tests/unit/test_io.zarr/.zmetadata deleted file mode 100644 index fe156b6d..00000000 --- a/tests/unit/test_io.zarr/.zmetadata +++ /dev/null @@ -1,127 +0,0 @@ -{ - "metadata": { - ".zattrs": { - "data_type": "BazBucket", - "namespace": "test_core", - "object_id": "a5849baa-8a71-4897-a578-9f670650764c" - }, - ".zgroup": { - "zarr_format": 2 - }, - "baz_data/.zarray": { - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 10 - ], - "zarr_format": 2 - }, - "baz_data/.zattrs": { - "data_type": "BazData", - "namespace": "test_core", - "object_id": "a78a77e2-54ad-4fb4-bf03-7f8079e0d1e6", - "zarr_dtype": "object" - }, - "bazs/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz0/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "9f8c4a05-9aaf-4e08-8dab-7e61dc4b017a" - }, - "bazs/baz0/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz1/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "765c7685-6c71-40d0-b084-77dd687165c1" - }, - "bazs/baz1/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz2/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "8e58a564-d4f0-4d0c-aac6-108a9fa6e0e9" - }, - "bazs/baz2/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz3/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "25f36c0f-e128-497d-a9ed-c72d7ab16b9b" - }, - "bazs/baz3/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz4/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a2016c27-068b-48b8-80fa-7ac12ee98506" - }, - "bazs/baz4/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz5/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "1afedbee-0ea6-47f6-8301-1d1b01498757" - }, - "bazs/baz5/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz6/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "ebae9f41-620b-4572-b4f0-75235fc6054b" - }, - "bazs/baz6/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz7/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "d78352a7-e0d4-4b41-a75f-a675ec6d5716" - }, - "bazs/baz7/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz8/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b68b56fb-11fb-4c54-b966-f5acbb182e7c" - }, - "bazs/baz8/.zgroup": { - "zarr_format": 2 - }, - "bazs/baz9/.zattrs": { - "data_type": "Baz", - "namespace": "test_core", - "object_id": "e78ef2bd-462e-46c2-ba3b-b893dc90c15e" - }, - "bazs/baz9/.zgroup": { - "zarr_format": 2 - } - }, - "zarr_consolidated_format": 1 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/.zarray b/tests/unit/test_io.zarr/baz_data/.zarray deleted file mode 100644 index 87547a61..00000000 --- a/tests/unit/test_io.zarr/baz_data/.zarray +++ /dev/null @@ -1,26 +0,0 @@ -{ - "chunks": [ - 10 - ], - "compressor": { - "blocksize": 0, - "clevel": 5, - "cname": "lz4", - "id": "blosc", - "shuffle": 1 - }, - "dimension_separator": ".", - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "id": "pickle", - "protocol": 5 - } - ], - "order": "C", - "shape": [ - 11 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/.zattrs b/tests/unit/test_io.zarr/baz_data/.zattrs deleted file mode 100644 index d72489ce..00000000 --- a/tests/unit/test_io.zarr/baz_data/.zattrs +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data_type": "BazData", - "namespace": "test_core", - "object_id": "a78a77e2-54ad-4fb4-bf03-7f8079e0d1e6", - "zarr_dtype": "object" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/baz_data/0 b/tests/unit/test_io.zarr/baz_data/0 deleted file mode 100644 index 14e2708e566f8daaf545008c1fef71b8919f1fb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 828 zcmZ{iJ!@1!6o&5_qZkwoxTuIhAw?|CI&<%Qf?#2>;6j9yf-GmgxRGQx?A|RBEVKwQ zFxX`LJ@z*Km1twR&LkFEI56klVV?KpoR_)Md(!*1QdMO?&--pwRh#+ybNpfT%h&u< zR_sp}`v->uJDvH#{$j7&#n}uGQ@lBzc{`oVyV=5a=`6+73oym&6L*Q6rBQX9UiM5n zNjqt4)EliGr*u{LD{maeDeObJyn6#Vj9VZ;;~E1MJ!q*Pa9 zL~tSnvuV-xOH=K=_I~@|q&jCbwGZQ_6x>RoI0##`#1Sw=F_6+Zp(M@M8GO`k{G*stm?IVttpG|C>VU!%um5XOvS>b6%YMy6BPWBN zU}fzj8Y+x7!)k4v6&Pzmg{>tJp-i6HOY*wm!3x6JMH^YM>^rF%UZVt090O*u z3?&bMLUM0~<2k|NtO{&$t6T&Fl;*-LXJE7t5I9<6sH(lR1=hpr{IQqHhuSz`qV~Di W+y*uVjM9y>npn#HWu`vA%fWA!b^ag# diff --git a/tests/unit/test_io.zarr/baz_data/1 b/tests/unit/test_io.zarr/baz_data/1 deleted file mode 100644 index 3f40cb6c98b53bb5bc05e7604a682c44215a2009..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmZ8c!AiqG5Y4t$u_$`+3-nMA8>2~@&B=o|0}*-@O4v;{q|zj1vpKYQsE4A3xpn+r z-Lx0+4R3~F-g_`Ta!sbhvO1QA>%sTLj1F*BwdG=Ir?rxH+0ONhE5(-xXNi(&T{T*@ zsm2|`U@t^Csj`D)hmp0xCnE3@Cpd~oG~8g(he4*73)xwEFATR|hif0mJH~PR{9~|h z(W6GOo#F^Cimc3&m5H@mJ)1WO=dWg&$XqH}rCrwThtVB3b*sz@#6~z;a9tn_?*v~p zU2_mlYw;#ioy;hmolRsa|QJ>#wnL9qz?0h>xY5sJ#d7}LuT^V$$jR9f^*7v eaBu8kK)D|<8s_7`8T(E!_EKyk>wih}ko^m;n||Z~ diff --git a/tests/unit/test_io.zarr/bazs/.zgroup b/tests/unit/test_io.zarr/bazs/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz0/.zattrs b/tests/unit/test_io.zarr/bazs/baz0/.zattrs deleted file mode 100644 index 95d1ab40..00000000 --- a/tests/unit/test_io.zarr/bazs/baz0/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "9f8c4a05-9aaf-4e08-8dab-7e61dc4b017a" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz0/.zgroup b/tests/unit/test_io.zarr/bazs/baz0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz1/.zattrs b/tests/unit/test_io.zarr/bazs/baz1/.zattrs deleted file mode 100644 index 3fc605d5..00000000 --- a/tests/unit/test_io.zarr/bazs/baz1/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "765c7685-6c71-40d0-b084-77dd687165c1" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz1/.zgroup b/tests/unit/test_io.zarr/bazs/baz1/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz1/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz2/.zattrs b/tests/unit/test_io.zarr/bazs/baz2/.zattrs deleted file mode 100644 index cff69f82..00000000 --- a/tests/unit/test_io.zarr/bazs/baz2/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "8e58a564-d4f0-4d0c-aac6-108a9fa6e0e9" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz2/.zgroup b/tests/unit/test_io.zarr/bazs/baz2/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz2/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz3/.zattrs b/tests/unit/test_io.zarr/bazs/baz3/.zattrs deleted file mode 100644 index a31559cf..00000000 --- a/tests/unit/test_io.zarr/bazs/baz3/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "25f36c0f-e128-497d-a9ed-c72d7ab16b9b" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz3/.zgroup b/tests/unit/test_io.zarr/bazs/baz3/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz3/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz4/.zattrs b/tests/unit/test_io.zarr/bazs/baz4/.zattrs deleted file mode 100644 index 87799e3b..00000000 --- a/tests/unit/test_io.zarr/bazs/baz4/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "a2016c27-068b-48b8-80fa-7ac12ee98506" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz4/.zgroup b/tests/unit/test_io.zarr/bazs/baz4/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz4/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz5/.zattrs b/tests/unit/test_io.zarr/bazs/baz5/.zattrs deleted file mode 100644 index 18624c16..00000000 --- a/tests/unit/test_io.zarr/bazs/baz5/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "1afedbee-0ea6-47f6-8301-1d1b01498757" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz5/.zgroup b/tests/unit/test_io.zarr/bazs/baz5/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz5/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz6/.zattrs b/tests/unit/test_io.zarr/bazs/baz6/.zattrs deleted file mode 100644 index 07c4c8ef..00000000 --- a/tests/unit/test_io.zarr/bazs/baz6/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "ebae9f41-620b-4572-b4f0-75235fc6054b" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz6/.zgroup b/tests/unit/test_io.zarr/bazs/baz6/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz6/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz7/.zattrs b/tests/unit/test_io.zarr/bazs/baz7/.zattrs deleted file mode 100644 index 4023d2b4..00000000 --- a/tests/unit/test_io.zarr/bazs/baz7/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "d78352a7-e0d4-4b41-a75f-a675ec6d5716" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz7/.zgroup b/tests/unit/test_io.zarr/bazs/baz7/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz7/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz8/.zattrs b/tests/unit/test_io.zarr/bazs/baz8/.zattrs deleted file mode 100644 index 3df65a4c..00000000 --- a/tests/unit/test_io.zarr/bazs/baz8/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "b68b56fb-11fb-4c54-b966-f5acbb182e7c" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz8/.zgroup b/tests/unit/test_io.zarr/bazs/baz8/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz8/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz9/.zattrs b/tests/unit/test_io.zarr/bazs/baz9/.zattrs deleted file mode 100644 index c89473e8..00000000 --- a/tests/unit/test_io.zarr/bazs/baz9/.zattrs +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data_type": "Baz", - "namespace": "test_core", - "object_id": "e78ef2bd-462e-46c2-ba3b-b893dc90c15e" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/bazs/baz9/.zgroup b/tests/unit/test_io.zarr/bazs/baz9/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/bazs/baz9/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/.zgroup b/tests/unit/test_io.zarr/specifications/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/specifications/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/.zgroup b/tests/unit/test_io.zarr/specifications/test_core/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup deleted file mode 100644 index 3b7daf22..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/.zgroup +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 deleted file mode 100644 index 357971a8..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/namespace/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"namespaces\":[{\"doc\":\"a test namespace\",\"schema\":[{\"source\":\"test\"}],\"name\":\"test_core\",\"version\":\"0.1.0\"}]}","|O",[1]] \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray deleted file mode 100644 index 7d100603..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zarray +++ /dev/null @@ -1,30 +0,0 @@ -{ - "chunks": [ - 1 - ], - "compressor": null, - "dtype": "|O", - "fill_value": 0, - "filters": [ - { - "allow_nan": true, - "check_circular": true, - "encoding": "utf-8", - "ensure_ascii": true, - "id": "json2", - "indent": null, - "separators": [ - ",", - ":" - ], - "skipkeys": false, - "sort_keys": true, - "strict": true - } - ], - "order": "C", - "shape": [ - 1 - ], - "zarr_format": 2 -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs deleted file mode 100644 index 2592fe05..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/.zattrs +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zarr_dtype": "scalar" -} \ No newline at end of file diff --git a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 b/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 deleted file mode 100644 index 1f675a9b..00000000 --- a/tests/unit/test_io.zarr/specifications/test_core/0.1.0/test/0 +++ /dev/null @@ -1 +0,0 @@ -["{\"groups\":[{\"doc\":\"A test group specification with a data type\",\"data_type_def\":\"Baz\"},{\"groups\":[{\"groups\":[{\"doc\":\"Baz\",\"quantity\":\"+\",\"data_type_inc\":\"Baz\"}],\"doc\":\"group of bazs\",\"name\":\"bazs\"}],\"datasets\":[{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazData\"},{\"doc\":\"doc\",\"quantity\":\"?\",\"data_type_inc\":\"BazCpdData\"}],\"doc\":\"A test group specification for a data type containing data type\",\"data_type_def\":\"BazBucket\"}],\"datasets\":[{\"shape\":[null],\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"},\"doc\":\"A test dataset of references specification with a data type\",\"name\":\"baz_data\",\"data_type_def\":\"BazData\"},{\"shape\":[null],\"dtype\":[{\"doc\":\"doc\",\"name\":\"part1\",\"dtype\":\"int\"},{\"doc\":\"doc\",\"name\":\"part2\",\"dtype\":{\"target_type\":\"Baz\",\"reftype\":\"object\"}}],\"doc\":\"A test compound dataset with references specification with a data type\",\"name\":\"baz_cpd_data\",\"data_type_def\":\"BazCpdData\"}]}","|O",[1]] \ No newline at end of file From 6111b63aa06ee6a261784520a1a34a04f6aae5b4 Mon Sep 17 00:00:00 2001 From: Matthew Avaylon Date: Mon, 8 Jul 2024 08:10:54 -0700 Subject: [PATCH 10/35] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 49a32900..7c029a6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Medical Science Apps." ] dependencies = [ - 'hdmf>=3.9.0', + 'hdmf>=3.14.2', 'zarr>=2.11.0, <3.0', # pin below 3.0 until HDMF-zarr supports zarr 3.0 'numpy>=1.24, <2.0', # pin below 2.0 until HDMF supports numpy 2.0 'numcodecs>=0.9.1', From 7b15f6a35de448ec9591cdd811ea8d2eaf790c61 Mon Sep 17 00:00:00 2001 From: Matthew Avaylon Date: Mon, 8 Jul 2024 08:11:17 -0700 Subject: [PATCH 11/35] Update requirements-min.txt --- requirements-min.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-min.txt b/requirements-min.txt index b5a13e58..02f97f1d 100644 --- a/requirements-min.txt +++ b/requirements-min.txt @@ -1,4 +1,4 @@ -hdmf==3.12.0 +hdmf==3.14.2 zarr==2.11.0 numcodecs==0.9.1 pynwb==2.5.0 From 543225aad2e8579cf01a70a8880c83f06756cc3e Mon Sep 17 00:00:00 2001 From: Matthew Avaylon Date: Mon, 8 Jul 2024 08:38:45 -0700 Subject: [PATCH 12/35] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e15428bd..f188c2ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # HDMF-ZARR Changelog +## 0.9.0 (Upcoming) +### Enhancements +* Added support for appending a dataset of references. @mavaylon1 [#203]([https://github.com/hdmf-dev/hdmf-zarr/pull/172](https://github.com/hdmf-dev/hdmf-zarr/pull/203)) + ## 0.8.0 (June 4, 2024) ### Bug Fixes * Fixed bug when opening a file in with `mode=r+`. The file will open without using the consolidated metadata. @mavaylon1 [#182](https://github.com/hdmf-dev/hdmf-zarr/issues/182) From fe70acfa0ff5966fb7a82df481f6f06bb024ab03 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 8 Jul 2024 08:52:31 -0700 Subject: [PATCH 13/35] ruff check --- src/hdmf_zarr/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 2596c402..463dbb63 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype == object: # noqa: E721 + if dtype is object: for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype == object: # noqa: E721 + if dtype is object: io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) From 63e83e39686ca71b88d3f3aaf1342122e095e920 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 8 Jul 2024 08:55:50 -0700 Subject: [PATCH 14/35] ruff check --- src/hdmf_zarr/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 463dbb63..2596c402 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1286,7 +1286,7 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 dset.attrs['zarr_dtype'] = type_str # Write the data to file - if dtype is object: + if dtype == object: # noqa: E721 for c in np.ndindex(data_shape): o = data for i in c: @@ -1320,7 +1320,7 @@ def __scalar_fill__(self, parent, name, data, options=None): except Exception as exc: msg = 'cannot add %s to %s - could not determine type' % (name, parent.name) raise Exception(msg) from exc - if dtype is object: + if dtype == object: # noqa: E721 io_settings['object_codec'] = self.__codec_cls() dset = parent.require_dataset(name, shape=(1, ), dtype=dtype, **io_settings) From d5af6314ce77eae52f7595e7a59be7ba60af4aad Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Wed, 10 Jul 2024 16:34:38 -0700 Subject: [PATCH 15/35] clean up --- src/hdmf_zarr/backend.py | 9 ++++----- src/hdmf_zarr/zarr_utils.py | 5 +---- tests/unit/test_zarrio.py | 11 ++++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 2596c402..280b6adb 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -738,7 +738,7 @@ def resolve_ref(self, zarr_ref): # Return the create path return target_name, target_zarr_obj - def __get_ref(self, ref_object, path=None, source_file=None, export_source=None): + def __get_ref(self, ref_object, source_file=None, export_source=None): """ Create a ZarrReference object that points to the given container If source_file is not None, use it to get the source_object_id. @@ -758,10 +758,9 @@ def __get_ref(self, ref_object, path=None, source_file=None, export_source=None) builder = ref_object.builder else: builder = self.manager.build(ref_object) - if path is None: - path = self.__get_path(builder) - else: - path = path + + path = self.__get_path(builder) + # TODO Add to get region for region references. # Also add {'name': 'region', 'type': (slice, list, tuple), # 'doc': 'the region reference indexing object', 'default': None}, diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 6d26b95b..1bffd1cb 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -82,11 +82,8 @@ def append(self, arg): f_builder = self.invert().io.read_builder() source_file = self.invert().io.manager.construct(f_builder) - # Get path - path = self.dataset[0]['path'] - # Create ZarrReference - ref = self.invert().io._ZarrIO__get_ref(builder,path=path, source_file=source_file) + ref = self.invert().io._ZarrIO__get_ref(builder, source_file=source_file) append_data(self.dataset, ref) diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index d1b209b3..98a41c9c 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -205,7 +205,7 @@ def tearDown(self): else: warnings.warn("Could not remove: %s" % path) - def test_append_references_roundtrip(self): + def test_append_references(self): # Setup a file container with references num_bazs = 10 bazs = [] # set up dataset of references @@ -218,16 +218,13 @@ def test_append_references_roundtrip(self): with ZarrIO(self.store, manager=manager, mode='w') as writer: writer.write(container=container) # read from file and validate references - with ZarrIO(self.store, manager=manager, mode='a') as append_io: + with ZarrIO(self.store, manager=manager, mode='r+') as append_io: read_container = append_io.read() - new_baz = Baz(name='baz0') DoR = read_container.baz_data.data - DoR.append(new_baz) + DoR.append(DoR[0]) - with ZarrIO(self.store, manager=manager, mode='a') as reader: - read_container = reader.read() expected = {'source': '.', 'path': '/bazs/baz0', - 'object_id': new_baz.object_id, + 'object_id': DoR[0].object_id, 'source_object_id': container.object_id} self.assertEqual(len(read_container.baz_data.data), 11) From cc783fa9d1ee69e386fd5a91cd8eb24e1727be90 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sat, 13 Jul 2024 11:20:51 -0700 Subject: [PATCH 16/35] clear --- src/hdmf_zarr/zarr_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 1bffd1cb..d467cde1 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -76,14 +76,14 @@ def __next__(self): def append(self, arg): # Create Builder - builder = self.invert().io.manager.build(arg) + builder = self.io.manager.build(arg) # Get File/Source Object ID - f_builder = self.invert().io.read_builder() - source_file = self.invert().io.manager.construct(f_builder) + f_builder = self.io.read_builder() + source_file = self.io.manager.construct(f_builder) # Create ZarrReference - ref = self.invert().io._ZarrIO__get_ref(builder, source_file=source_file) + ref = self.io._ZarrIO__get_ref(builder, source_file=source_file) append_data(self.dataset, ref) From 686847337e12a896ee546077aba2a471a6eeaf10 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sat, 13 Jul 2024 11:31:44 -0700 Subject: [PATCH 17/35] clear --- src/hdmf_zarr/zarr_utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index d467cde1..05b31d51 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -78,12 +78,8 @@ def append(self, arg): # Create Builder builder = self.io.manager.build(arg) - # Get File/Source Object ID - f_builder = self.io.read_builder() - source_file = self.io.manager.construct(f_builder) - # Create ZarrReference - ref = self.io._ZarrIO__get_ref(builder, source_file=source_file) + ref = self.io._ZarrIO__get_ref(builder) append_data(self.dataset, ref) From f5e6d7f6b8780cf4d9a8279bd8996ab47d446369 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sat, 13 Jul 2024 11:33:55 -0700 Subject: [PATCH 18/35] clear --- src/hdmf_zarr/backend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 280b6adb..b88e2018 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -738,10 +738,9 @@ def resolve_ref(self, zarr_ref): # Return the create path return target_name, target_zarr_obj - def __get_ref(self, ref_object, source_file=None, export_source=None): + def __get_ref(self, ref_object, export_source=None): """ Create a ZarrReference object that points to the given container - If source_file is not None, use it to get the source_object_id. :param ref_object: the object to be referenced :type ref_object: Builder, Container, ReferenceBuilder From 5373c7cab844b0a7942edfdad2d814c21cc4a56a Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sat, 13 Jul 2024 11:34:39 -0700 Subject: [PATCH 19/35] clear --- src/hdmf_zarr/backend.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index b88e2018..4c02ac10 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -771,21 +771,18 @@ def __get_ref(self, ref_object, export_source=None): # determine the object_id of the source by following the parents of the builder until we find the root # the root builder should be the same as the source file containing the reference - if source_file is not None: - source_object_id = source_file.object_id + curr = builder + while curr is not None and curr.name != ROOT_NAME: + curr = curr.parent + if curr: + source_object_id = curr.get('object_id', None) + # We did not find ROOT_NAME as a parent. This should only happen if we have an invalid + # file as a source, e.g., if during testing we use an arbitrary builder. We check this + # anyways to avoid potential errors just in case else: - curr = builder - while curr is not None and curr.name != ROOT_NAME: - curr = curr.parent - if curr: - source_object_id = curr.get('object_id', None) - # We did not find ROOT_NAME as a parent. This should only happen if we have an invalid - # file as a source, e.g., if during testing we use an arbitrary builder. We check this - # anyways to avoid potential errors just in case - else: - source_object_id = None - warn_msg = "Could not determine source_object_id for builder with path: %s" % path - warnings.warn(warn_msg) + source_object_id = None + warn_msg = "Could not determine source_object_id for builder with path: %s" % path + warnings.warn(warn_msg) # by checking os.isdir makes sure we have a valid link path to a dir for Zarr. For conversion # between backends a user should always use export which takes care of creating a clean set of builders. From 13caa37df0736798b37a1692d06604bf87470342 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Sat, 13 Jul 2024 19:03:09 -0400 Subject: [PATCH 20/35] Rename ZarrIO.__get_ref to ZarrIO._create_ref --- docs/source/integrating_data_stores.rst | 2 +- docs/source/storage.rst | 6 +++--- src/hdmf_zarr/backend.py | 24 ++++++++++++------------ src/hdmf_zarr/zarr_utils.py | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/source/integrating_data_stores.rst b/docs/source/integrating_data_stores.rst index d7573e73..f5a8c481 100644 --- a/docs/source/integrating_data_stores.rst +++ b/docs/source/integrating_data_stores.rst @@ -36,7 +36,7 @@ Updating ZarrIO :py:meth:`~hdmf_zarr.backend.ZarrIO.get_builder_exists_on_disk` method may need to be updated to ensure references are opened correctly on read for files stored with your new store. The - :py:meth:`~hdmf_zarr.backend.ZarrIO.__get_ref` function may also need to be updated, in + :py:meth:`~hdmf_zarr.backend.ZarrIO._create_ref` function may also need to be updated, in particular in case the links to your store also modify the storage schema for links (e.g., if you need to store additional metadata in order to resolve links to your store). diff --git a/docs/source/storage.rst b/docs/source/storage.rst index f906f159..864fe420 100644 --- a/docs/source/storage.rst +++ b/docs/source/storage.rst @@ -217,7 +217,7 @@ For example: In :py:class:`~hdmf_zarr.backend.ZarrIO`, links are written by the :py:meth:`~hdmf_zarr.backend.ZarrIO.__write_link__` function, which also uses the helper functions - i) :py:meth:`~hdmf_zarr.backend.ZarrIO.__get_ref` to construct py:meth:`~hdmf_zarr.utils.ZarrRefernce` + i) :py:meth:`~hdmf_zarr.backend.ZarrIO._create_ref` to construct py:meth:`~hdmf_zarr.utils.ZarrRefernce` and ii) :py:meth:`~hdmf_zarr.backend.ZarrIO.__add_link__` to add a link to the Zarr file. :py:meth:`~hdmf_zarr.backend.ZarrIO.__read_links` then parses links and also uses the :py:meth:`~hdmf_zarr.backend.ZarrIO.__resolve_ref` helper function to resolve the paths stored in links. @@ -245,7 +245,7 @@ by their location (i.e., index) in the dataset. As such, object references only the relative path to the target Zarr file, and the ``path`` identifying the object within the source Zarr file. The individual object references are defined in the :py:class:`~hdmf_zarr.backend.ZarrIO` as py:class:`~hdmf_zarr.utils.ZarrReference` object created via -the :py:meth:`~hdmf_zarr.backend.ZarrIO.__get_ref` helper function. +the :py:meth:`~hdmf_zarr.backend.ZarrIO._create_ref` helper function. By default, :py:class:`~hdmf_zarr.backend.ZarrIO` uses the ``numcodecs.pickles.Pickle`` codec to encode object references defined as py:class:`~hdmf_zarr.utils.ZarrReference` dicts in datasets. @@ -297,7 +297,7 @@ store the definition of the ``region`` that is being referenced, e.g., a slice o To implement region references will require updating: 1) py:class:`~hdmf_zarr.utils.ZarrReference` to add a ``region`` key to support storing the selection for the region, - 2) :py:meth:`~hdmf_zarr.backend.ZarrIO.__get_ref` to support passing in the region definition to + 2) :py:meth:`~hdmf_zarr.backend.ZarrIO._create_ref` to support passing in the region definition to be added to the py:class:`~hdmf_zarr.utils.ZarrReference`, 3) :py:meth:`~hdmf_zarr.backend.ZarrIO.write_dataset` already partially implements the required logic for creating region references by checking for :py:class:`hdmf.build.RegionBuilder` inputs diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 4c02ac10..309ada37 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -591,13 +591,13 @@ def write_attributes(self, **kwargs): # TODO: Region References are not yet supported # if isinstance(value, RegionBuilder): # type_str = 'region' - # refs = self.__get_ref(value.builder) + # refs = self._create_ref(value.builder) if isinstance(value, (ReferenceBuilder, Container, Builder)): type_str = 'object' if isinstance(value, Builder): - refs = self.__get_ref(value, export_source) + refs = self._create_ref(value, export_source) else: - refs = self.__get_ref(value.builder, export_source) + refs = self._create_ref(value.builder, export_source) tmp = {'zarr_dtype': type_str, 'value': refs} obj.attrs[key] = tmp # Case 3: Scalar attributes @@ -738,7 +738,7 @@ def resolve_ref(self, zarr_ref): # Return the create path return target_name, target_zarr_obj - def __get_ref(self, ref_object, export_source=None): + def _create_ref(self, ref_object, export_source=None): """ Create a ZarrReference object that points to the given container @@ -836,7 +836,7 @@ def write_link(self, **kwargs): name = builder.name target_builder = builder.builder # Get the reference - zarr_ref = self.__get_ref(target_builder) + zarr_ref = self._create_ref(target_builder) # EXPORT WITH LINKS: Fix link source # if the target and source are both the same, then we need to ALWAYS use ourselves as a source # When exporting from one source to another, the LinkBuilders.source are not updated, i.e,. the @@ -980,7 +980,7 @@ def write_dataset(self, **kwargs): # noqa: C901 elif isinstance(data, HDMFDataset): # If we have a dataset of containers we need to make the references to the containers if len(data) > 0 and isinstance(data[0], Container): - ref_data = [self.__get_ref(data[i], export_source=export_source) for i in range(len(data))] + ref_data = [self._create_ref(data[i], export_source=export_source) for i in range(len(data))] shape = (len(data), ) type_str = 'object' dset = parent.require_dataset(name, @@ -1013,7 +1013,7 @@ def write_dataset(self, **kwargs): # noqa: C901 for i, dts in enumerate(options['dtype']): if self.__is_ref(dts['dtype']): refs.append(i) - ref_tmp = self.__get_ref(data[0][i], export_source=export_source) + ref_tmp = self._create_ref(data[0][i], export_source=export_source) if isinstance(ref_tmp, ZarrReference): dts_str = 'object' else: @@ -1033,7 +1033,7 @@ def write_dataset(self, **kwargs): # noqa: C901 for j, item in enumerate(data): new_item = list(item) for i in refs: - new_item[i] = self.__get_ref(item[i], export_source=export_source) + new_item[i] = self._create_ref(item[i], export_source=export_source) new_items.append(tuple(new_item)) # Create dtype for storage, replacing values to match hdmf's hdf5 behavior @@ -1078,20 +1078,20 @@ def write_dataset(self, **kwargs): # noqa: C901 # if isinstance(data, RegionBuilder): # shape = (1,) # type_str = 'region' - # refs = self.__get_ref(data.builder, data.region) + # refs = self._create_ref(data.builder, data.region) if isinstance(data, ReferenceBuilder): shape = (1,) type_str = 'object' - refs = self.__get_ref(data.builder, export_source=export_source) + refs = self._create_ref(data.builder, export_source=export_source) # TODO: Region References are not yet supported # elif options['dtype'] == 'region': # shape = (len(data), ) # type_str = 'region' - # refs = [self.__get_ref(item.builder, item.region) for item in data] + # refs = [self._create_ref(item.builder, item.region) for item in data] else: shape = (len(data), ) type_str = 'object' - refs = [self.__get_ref(item, export_source=export_source) for item in data] + refs = [self._create_ref(item, export_source=export_source) for item in data] dset = parent.require_dataset(name, shape=shape, diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 05b31d51..f3478b5a 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -79,7 +79,7 @@ def append(self, arg): builder = self.io.manager.build(arg) # Create ZarrReference - ref = self.io._ZarrIO__get_ref(builder) + ref = self.io._create_ref(builder) append_data(self.dataset, ref) From ff6e435e7c9aaa5f51d4eeb7b83f72e00f0d0f61 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 22 Jul 2024 09:25:15 -0700 Subject: [PATCH 21/35] fixed tests --- tests/unit/test_zarrio.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index 98a41c9c..b5248d94 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -220,12 +220,13 @@ def test_append_references(self): # read from file and validate references with ZarrIO(self.store, manager=manager, mode='r+') as append_io: read_container = append_io.read() + new_baz = Baz(name='new') + read_container.add_baz(new_baz) DoR = read_container.baz_data.data - DoR.append(DoR[0]) - - expected = {'source': '.', 'path': '/bazs/baz0', - 'object_id': DoR[0].object_id, - 'source_object_id': container.object_id} + DoR.append(new_baz) + append_io.write(read_container) + with ZarrIO(self.store, manager=manager, mode='r') as append_io: + read_container = append_io.read() + self.assertEqual(len(read_container.baz_data.data), 11) - self.assertDictEqual(read_container.baz_data.data.dataset[10], expected) From c646c6d54d2af03d8bd849ecd36bb95175cc46cb Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Mon, 22 Jul 2024 15:32:03 -0700 Subject: [PATCH 22/35] clean up --- tests/unit/test_zarrio.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index b5248d94..cb2987bc 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -214,19 +214,20 @@ def test_append_references(self): baz_data = BazData(name='baz_data', data=bazs) container = BazBucket(bazs=bazs, baz_data=baz_data) manager = get_baz_buildmanager() - # write to file + with ZarrIO(self.store, manager=manager, mode='w') as writer: writer.write(container=container) - # read from file and validate references - with ZarrIO(self.store, manager=manager, mode='r+') as append_io: + + with ZarrIO(self.store, manager=manager, mode='a') as append_io: read_container = append_io.read() new_baz = Baz(name='new') read_container.add_baz(new_baz) + DoR = read_container.baz_data.data DoR.append(new_baz) + append_io.write(read_container) with ZarrIO(self.store, manager=manager, mode='r') as append_io: read_container = append_io.read() - self.assertEqual(len(read_container.baz_data.data), 11) From 19470af348f64a58d76944e7d365283787fefd15 Mon Sep 17 00:00:00 2001 From: rly Date: Wed, 24 Jul 2024 17:19:08 -0700 Subject: [PATCH 23/35] Add failing check to test --- tests/unit/test_zarrio.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index cb2987bc..174effb2 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -231,3 +231,4 @@ def test_append_references(self): with ZarrIO(self.store, manager=manager, mode='r') as append_io: read_container = append_io.read() self.assertEqual(len(read_container.baz_data.data), 11) + self.assertIs(read_container.baz_data.data[10], read_container.bazs["new"]) From e8190ae89fe3e4a1855b658509b0e5db7a6b6797 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Fri, 26 Jul 2024 13:39:49 -0700 Subject: [PATCH 24/35] Fix --- src/hdmf_zarr/backend.py | 7 ++++++- src/hdmf_zarr/zarr_utils.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index c0b94eaa..052a0b63 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -440,6 +440,7 @@ def write_builder(self, **kwargs): f_builder, link_data, exhaust_dci, export_source, consolidate_metadata = getargs( 'builder', 'link_data', 'exhaust_dci', 'export_source', 'consolidate_metadata', kwargs ) + # breakpoint() for name, gbldr in f_builder.groups.items(): self.write_group( parent=self.__file, @@ -519,6 +520,7 @@ def write_group(self, **kwargs): parent, builder, link_data, exhaust_dci, export_source = getargs( 'parent', 'builder', 'link_data', 'exhaust_dci', 'export_source', kwargs ) + # breakpoint() if self.get_written(builder): group = parent[builder.name] @@ -629,6 +631,7 @@ def __get_path(self, builder): determines the path by constructing it iteratively from the parents of the builder. """ + # breakpoint() if builder.location is not None: path = os.path.normpath(os.path.join(builder.location, builder.name)).replace("\\", "/") else: @@ -734,6 +737,7 @@ def resolve_ref(self, zarr_ref): target_zarr_obj = self.__open_file_consolidated(store=source_file, mode='r', storage_options=self.__storage_options) + # breakpoint() if object_path is not None: try: target_zarr_obj = target_zarr_obj[object_path] @@ -750,6 +754,7 @@ def _create_ref(self, ref_object, export_source=None): :type ref_object: Builder, Container, ReferenceBuilder :returns: ZarrReference object """ + # breakpoint() if isinstance(ref_object, RegionBuilder): # or region is not None: TODO: Add to support regions raise NotImplementedError("Region references are currently not supported by ZarrIO") if isinstance(ref_object, Builder): @@ -763,7 +768,7 @@ def _create_ref(self, ref_object, export_source=None): builder = self.manager.build(ref_object) path = self.__get_path(builder) - + # breakpoint() # TODO Add to get region for region references. # Also add {'name': 'region', 'type': (slice, list, tuple), # 'doc': 'the region reference indexing object', 'default': None}, diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index f3478b5a..6b009fde 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -75,7 +75,9 @@ def __next__(self): return self._get_ref(super().__next__()) def append(self, arg): - # Create Builder + # Building the parent first will build the new child. + # This correctly sets the parent of the child builder, which is needed to create the reference. + self.io.manager.build(arg.parent) builder = self.io.manager.build(arg) # Create ZarrReference From 2bcc4f62f87ba2c4d4f8e595b8f9dbfbc0a642ac Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:15:09 -0700 Subject: [PATCH 25/35] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f16af2f..8769af4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.9.0 (Upcoming) ### Enhancements -* Added support for appending a dataset of references. @mavaylon1 [#203]([https://github.com/hdmf-dev/hdmf-zarr/pull/172](https://github.com/hdmf-dev/hdmf-zarr/pull/203)) +* Added support for appending a dataset of references. @mavaylon1 [#203](https://github.com/hdmf-dev/hdmf-zarr/pull/203) * NWBZarrIO load_namespaces=True by default. @mavaylon1 [#204](https://github.com/hdmf-dev/hdmf-zarr/pull/204) * Added test for opening file with consolidated metadata from DANDI. @mavaylon1 [#206](https://github.com/hdmf-dev/hdmf-zarr/pull/206) From 10f0d06e55d57bcaa9b4f263419624fe6edbf42f Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:26:29 -0700 Subject: [PATCH 26/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 052a0b63..5148c49c 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -440,7 +440,6 @@ def write_builder(self, **kwargs): f_builder, link_data, exhaust_dci, export_source, consolidate_metadata = getargs( 'builder', 'link_data', 'exhaust_dci', 'export_source', 'consolidate_metadata', kwargs ) - # breakpoint() for name, gbldr in f_builder.groups.items(): self.write_group( parent=self.__file, From 4b2d32c33626c1cb68ad897adc0c4e937acd4c76 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:26:42 -0700 Subject: [PATCH 27/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 5148c49c..67eabf12 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -519,7 +519,6 @@ def write_group(self, **kwargs): parent, builder, link_data, exhaust_dci, export_source = getargs( 'parent', 'builder', 'link_data', 'exhaust_dci', 'export_source', kwargs ) - # breakpoint() if self.get_written(builder): group = parent[builder.name] From f71691642eecab54443702fc1abb436bcc5d3066 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:26:56 -0700 Subject: [PATCH 28/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 67eabf12..a82b520d 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -629,7 +629,6 @@ def __get_path(self, builder): determines the path by constructing it iteratively from the parents of the builder. """ - # breakpoint() if builder.location is not None: path = os.path.normpath(os.path.join(builder.location, builder.name)).replace("\\", "/") else: From af72b53e223bf23fcbf228c256f71c986e1c00ed Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:27:06 -0700 Subject: [PATCH 29/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index a82b520d..2f91fdac 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -734,7 +734,6 @@ def resolve_ref(self, zarr_ref): target_zarr_obj = self.__open_file_consolidated(store=source_file, mode='r', storage_options=self.__storage_options) - # breakpoint() if object_path is not None: try: target_zarr_obj = target_zarr_obj[object_path] From 7f7bda9f4678380c813699a70144aba5cfe97f66 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:27:21 -0700 Subject: [PATCH 30/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 2f91fdac..960b0f8a 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -750,7 +750,6 @@ def _create_ref(self, ref_object, export_source=None): :type ref_object: Builder, Container, ReferenceBuilder :returns: ZarrReference object """ - # breakpoint() if isinstance(ref_object, RegionBuilder): # or region is not None: TODO: Add to support regions raise NotImplementedError("Region references are currently not supported by ZarrIO") if isinstance(ref_object, Builder): From 09098679094cc11a9ba31e48750bb033008956c4 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 26 Jul 2024 15:27:37 -0700 Subject: [PATCH 31/35] Update src/hdmf_zarr/backend.py --- src/hdmf_zarr/backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 960b0f8a..0aa33e29 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -763,7 +763,6 @@ def _create_ref(self, ref_object, export_source=None): builder = self.manager.build(ref_object) path = self.__get_path(builder) - # breakpoint() # TODO Add to get region for region references. # Also add {'name': 'region', 'type': (slice, list, tuple), # 'doc': 'the region reference indexing object', 'default': None}, From 1d073a35e0c31336a9d6f36c4a1ddf684993f294 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sun, 28 Jul 2024 06:57:17 -0700 Subject: [PATCH 32/35] root --- src/hdmf_zarr/zarr_utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 6b009fde..2e01748f 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -75,8 +75,19 @@ def __next__(self): return self._get_ref(super().__next__()) def append(self, arg): - # Building the parent first will build the new child. + # Building the root parent first. # This correctly sets the parent of the child builder, which is needed to create the reference. + # Note: If the arg is a nested child such that objB is the parent of arg and objA is the parent of objB + # (and objA is not the root), then we need to have objA already added to the root as a child. Otherwise, + # the loop will use objA as the root. This might not raise an error, but having it added to the root ensures + # correct functionality. + child = arg + while True: + if child.parent is not None: + parent = child.parent + child = parent + else: + break self.io.manager.build(arg.parent) builder = self.io.manager.build(arg) From f32632c02991693114ea6dd1ab57326d4975c5d7 Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sun, 28 Jul 2024 07:00:09 -0700 Subject: [PATCH 33/35] notes --- src/hdmf_zarr/zarr_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 2e01748f..ec15b547 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -76,11 +76,11 @@ def __next__(self): def append(self, arg): # Building the root parent first. - # This correctly sets the parent of the child builder, which is needed to create the reference. + # Doing so will correctly sets the parent of the child builder, which is needed to create the reference. # Note: If the arg is a nested child such that objB is the parent of arg and objA is the parent of objB # (and objA is not the root), then we need to have objA already added to the root as a child. Otherwise, - # the loop will use objA as the root. This might not raise an error, but having it added to the root ensures - # correct functionality. + # the loop will use objA as the root. This might not raise an error, but it could lead to having an + # incorrect path for the reference. Having objA not be an orphaned container ensures correct functionality. child = arg while True: if child.parent is not None: From 798917f40584db25365b62fa9644855fe52f03ef Mon Sep 17 00:00:00 2001 From: mavaylon1 Date: Sun, 28 Jul 2024 07:27:31 -0700 Subject: [PATCH 34/35] loop --- src/hdmf_zarr/zarr_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index ec15b547..5fe4baf3 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -87,8 +87,9 @@ def append(self, arg): parent = child.parent child = parent else: + parent = child break - self.io.manager.build(arg.parent) + self.io.manager.build(parent) builder = self.io.manager.build(arg) # Create ZarrReference From 7c5c0afc6ced1008fc59e02c6e5ff9ae82215df7 Mon Sep 17 00:00:00 2001 From: Matthew Avaylon Date: Mon, 29 Jul 2024 07:47:17 -0700 Subject: [PATCH 35/35] Update zarr_utils.py --- src/hdmf_zarr/zarr_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hdmf_zarr/zarr_utils.py b/src/hdmf_zarr/zarr_utils.py index 5fe4baf3..d1e4b117 100644 --- a/src/hdmf_zarr/zarr_utils.py +++ b/src/hdmf_zarr/zarr_utils.py @@ -76,11 +76,12 @@ def __next__(self): def append(self, arg): # Building the root parent first. - # Doing so will correctly sets the parent of the child builder, which is needed to create the reference. + # (Doing so will correctly set the parent of the child builder, which is needed to create the reference) # Note: If the arg is a nested child such that objB is the parent of arg and objA is the parent of objB # (and objA is not the root), then we need to have objA already added to the root as a child. Otherwise, - # the loop will use objA as the root. This might not raise an error, but it could lead to having an - # incorrect path for the reference. Having objA not be an orphaned container ensures correct functionality. + # the loop will use objA as the root. This might not raise an error (meaning the path could be correct), + # but it could lead to having an incorrect path for the reference. + # Having objA NOT be an orphaned container ensures correct functionality. child = arg while True: if child.parent is not None: