diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 0f8d8f9b..a4a42e6d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -61,7 +61,7 @@ jobs: tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl - name: Upload distribution as a workspace artifact if: ${{ matrix.upload-wheels }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: distributions path: dist @@ -175,7 +175,7 @@ jobs: python-version: '3.11' - name: Download wheel and source distributions from artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: distributions path: dist diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a97f917..78b5742d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,16 @@ # HDMF-ZARR Changelog -## 0.9.0 (Upcoming) +## 1.0.0 (Upcoming) +### Enhancements +* Added support for Pathlib paths. @mavaylon1 [#212](https://github.com/hdmf-dev/hdmf-zarr/pull/212) + +## 0.9.0 (September 16, 2024) ### Enhancements * 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) * Add dimension labels compatible with xarray. @mavaylon1 [#207](https://github.com/hdmf-dev/hdmf-zarr/pull/207) -* Added support for Pathlib paths. @mavaylon1 [#212](https://github.com/hdmf-dev/hdmf-zarr/pull/212) +* Added link_data --> clear_cache relationship to support repacking zarr nwbfiles: [#215](https://github.com/hdmf-dev/hdmf-zarr/pull/215) ## 0.8.0 (June 4, 2024) ### Bug Fixes diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 78e2ef52..cb0fea66 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -367,6 +367,8 @@ def export(self, **kwargs): write_args['export_source'] = src_io.source # pass export_source=src_io.source to write_builder ckwargs = kwargs.copy() ckwargs['write_args'] = write_args + if not write_args.get('link_data', True): + ckwargs['clear_cache'] = True super().export(**ckwargs) if cache_spec: self.__cache_spec() @@ -1310,6 +1312,13 @@ def __list_fill__(self, parent, name, data, options=None): # noqa: C901 except ValueError: for i in range(len(data)): dset[i] = data[i] + except TypeError: # If data is an h5py.Dataset with strings, they may need to be decoded + for c in np.ndindex(data_shape): + o = data + for i in c: + o = o[i] + # bytes are not JSON serializable + dset[c] = o if not isinstance(o, (bytes, np.bytes_)) else o.decode("utf-8") return dset def __scalar_fill__(self, parent, name, data, options=None): diff --git a/test_gallery.py b/test_gallery.py index 282f2b6b..c03fa19b 100644 --- a/test_gallery.py +++ b/test_gallery.py @@ -80,6 +80,10 @@ def _import_from_file(script): _deprecation_warning_zarr_store = ( r"The NestedDirectoryStore is deprecated *" ) +_deprecation_warning_numpy = ( + "__array__ implementation doesn't accept a copy keyword, so passing copy=False failed. " + "__array__ must implement 'dtype' and 'copy' keyword arguments." +) def run_gallery_tests(): global TOTAL, FAILURES, ERRORS @@ -149,6 +153,9 @@ def run_gallery_tests(): warnings.filterwarnings( "ignore", message=_deprecation_warning_zarr_store, category=FutureWarning ) + warnings.filterwarnings( + "ignore", message=_deprecation_warning_numpy, category=DeprecationWarning + ) _import_from_file(script_abs) except Exception: print(traceback.format_exc()) diff --git a/tests/unit/test_io_convert.py b/tests/unit/test_io_convert.py index 1f756017..b023d3cd 100644 --- a/tests/unit/test_io_convert.py +++ b/tests/unit/test_io_convert.py @@ -949,7 +949,7 @@ def __get_data_array(self, foo_container): def test_maxshape(self): """test when maxshape is set for the dataset""" - data = H5DataIO(data=list(range(5)), maxshape=(None,)) + data = H5DataIO(data=list(range(5)), maxshape=(5,)) self.__roundtrip_data(data=data) self.assertContainerEqual(self.out_container, self.read_container, ignore_hdmf_attrs=True)