diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f57db3ed..8d6ffb00 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,9 +6,9 @@ version: 2 build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: - python: '3.9' + python: '3.12' # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/CHANGELOG.md b/CHANGELOG.md index 537387b3..3c34edeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # HDMF-ZARR Changelog +## 1.0.0 (Upcoming) +### Enhancements +* Added support for Pathlib paths. @mavaylon1 [#212](https://github.com/hdmf-dev/hdmf-zarr/pull/212) +* Updated packages used for testing and readthedocs configuration. @mavaylon1, @rly [#214](https://github.com/hdmf-dev/hdmf-zarr/pull/214) + ## 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) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0fd19af4..047125eb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ pytest==7.4.3 pytest-cov==4.1.0 python-dateutil==2.8.2 ruff==0.1.3 -tox==4.11.3 \ No newline at end of file +tox==4.11.3 diff --git a/requirements-opt.txt b/requirements-opt.txt index 771f5d04..6fc3bcb0 100644 --- a/requirements-opt.txt +++ b/requirements-opt.txt @@ -1,3 +1,3 @@ -tqdm==4.66.4 -fsspec==2024.6.0 -s3fs==2024.6.0 +tqdm==4.67.0 +fsspec==2024.10.0 +s3fs==2024.10.0 diff --git a/requirements.txt b/requirements.txt index 338c96f2..840b4815 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # pinned dependencies to reproduce an entire development environment to use HDMF-ZARR -hdmf==3.14.2 -zarr==2.16.1 -pynwb==2.5.0 -numpy==2.0.0 -numcodecs==0.12.1 -threadpoolctl==3.2.0 +hdmf==3.14.5 +zarr==2.18.3 +pynwb==2.8.2 +numpy==2.1.3 +numcodecs==0.13.1 +threadpoolctl==3.5.0 diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index 48826583..cb0fea66 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -48,6 +48,9 @@ from hdmf.query import HDMFDataset from hdmf.container import Container +from pathlib import Path + + # Module variables ROOT_NAME = 'root' """ @@ -84,7 +87,7 @@ def can_read(path): return False @docval({'name': 'path', - 'type': (str, *SUPPORTED_ZARR_STORES), + 'type': (str, Path, *SUPPORTED_ZARR_STORES), 'doc': 'the path to the Zarr file or a supported Zarr store'}, {'name': 'manager', 'type': BuildManager, 'doc': 'the BuildManager to use for I/O', 'default': None}, {'name': 'mode', 'type': str, @@ -115,6 +118,8 @@ def __init__(self, **kwargs): else: self.__synchronizer = synchronizer self.__mode = mode + if isinstance(path, Path): + path = str(path) self.__path = path self.__file = None self.__storage_options = storage_options @@ -195,7 +200,7 @@ def is_remote(self): 'type': (NamespaceCatalog, TypeMap), 'doc': 'the NamespaceCatalog or TypeMap to load namespaces into'}, {'name': 'path', - 'type': (str, *SUPPORTED_ZARR_STORES), + 'type': (str, Path, *SUPPORTED_ZARR_STORES), 'doc': 'the path to the Zarr file or a supported Zarr store'}, {'name': 'storage_options', 'type': dict, 'doc': 'Zarr storage options to read remote folders', diff --git a/tests/unit/test_zarrio.py b/tests/unit/test_zarrio.py index 533557cd..824e5ae4 100644 --- a/tests/unit/test_zarrio.py +++ b/tests/unit/test_zarrio.py @@ -24,6 +24,7 @@ import os import shutil import warnings +import pathlib CUR_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -136,6 +137,16 @@ def setUp(self): self.store = [NestedDirectoryStore(p) for p in self.store_path] +######################################### +# Pathlib Tests +######################################### +class TestPathlib(BaseTestZarrWriter): + """Test writing of builder with Zarr using a custom DirectoryStore""" + def setUp(self): + super().setUp() + self.store = pathlib.Path(self.store_path) + + ######################################### # Consolidate Metadata tests ######################################### @@ -195,7 +206,7 @@ class TestDimensionLabels(BuildDatasetShapeMixin): Workflow: i) We need to define a `get_dataset_inc_spec` to set the dim in the spec (via BuildDatasetShapeMixin) ii) Create and write a BarDataHolder with a BarData. - iii) Read and check that the _ARRAY_DIMENSIONS attribute is set. + iii) Read and check that the _ARRAY_DIMENSIONS attribute is set. """ def tearDown(self): shutil.rmtree(self.store)