diff --git a/.gitignore b/.gitignore index 2381e93c..ed29c569 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ build dist/ target/ docs/build/ - +*.DS_Store # Testing files .tox* .coverage* diff --git a/.readthedocs.yml b/.readthedocs.yml index af42c27c..ecef8025 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,17 +10,11 @@ build: os: ubuntu-22.04 tools: python: "3.12" - # You can also specify other tool versions: - # nodejs: "16" - # rust: "1.55" - # golang: "1.17" +# Build documentation in the docs/ directory with Sphinx sphinx: fail_on_warning: true - -# Build documentation in the docs/ directory with Sphinx -# sphinx: -# configuration: docs/conf.py + configuration: docs/source/conf.py # If using Sphinx, optionally build your docs in additional formats such as PDF # formats: diff --git a/CHANGELOG.md b/CHANGELOG.md index f11484c6..eb30b69b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.10.3 (Janbuary 2025) + +- Document Scaler attributes ([#418](https://github.com/ome/ome-zarr-py/pull/418)) +- Fix dimension separator when downloading files ([#419](https://github.com/ome/ome-zarr-py/pull/419)) +- Exclude bad version of fsspec in deps ([#420](https://github.com/ome/ome-zarr-py/pull/420)) + # 0.10.2 (November 2024) - Drop support for Python 3.8. diff --git a/README.rst b/README.rst index e4362fff..30c90bf6 100644 --- a/README.rst +++ b/README.rst @@ -64,10 +64,8 @@ Distributed under the terms of the `BSD`_ license, .. |docs| image:: https://readthedocs.org/projects/ome-zarr/badge/?version=stable :alt: Documentation Status - :scale: 100% :target: https://ome-zarr.readthedocs.io/en/stable/?badge=stable .. |coverage| image:: https://codecov.io/gh/ome/ome-zarr-py/branch/master/graph/badge.svg :alt: Test coverage - :scale: 100% :target: https://codecov.io/gh/ome/ome-zarr-py diff --git a/docs/requirements.txt b/docs/requirements.txt index bc6529a2..15541c48 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ sphinx==8.1.3 sphinx-rtd-theme==3.0.2 -fsspec==2023.6.0 -zarr==v3.0.0-beta.3 +fsspec +zarr>=v3.0.0 dask numpy scipy diff --git a/ome_zarr/scale.py b/ome_zarr/scale.py index be5248da..02242e92 100644 --- a/ome_zarr/scale.py +++ b/ome_zarr/scale.py @@ -39,6 +39,21 @@ class Scaler: choices. These values can be returned by the :func:`~ome_zarr.scale.Scaler.methods` method. + Attributes: + copy_metadata: + If `True`, copy Zarr attributes from the input array to the new group. + downscale: + Downscaling factor. + in_place: + Does not do anything. + labeled: + If `True`, check that the values in the downsampled levels are a subset + of the values found in the input array. + max_layer: + The maximum number of downsampled layers to create. + method: + Downsampling method + >>> import numpy as np >>> data = np.zeros((1, 1, 1, 64, 64)) >>> scaler = Scaler() diff --git a/ome_zarr/utils.py b/ome_zarr/utils.py index 086ede3d..c929c283 100644 --- a/ome_zarr/utils.py +++ b/ome_zarr/utils.py @@ -129,7 +129,9 @@ def download(input_path: str, output_dir: str = ".") -> None: for dataset, data in reversed(list(zip(datasets, resolutions))): LOGGER.info("resolution %s...", dataset) with pbar: - data.to_zarr(str(target_path / dataset)) + data.to_zarr( + str(target_path / dataset), dimension_separator="/" + ) else: # Assume a group that needs metadata, like labels zarr.group(str(target_path)) diff --git a/pyproject.toml b/pyproject.toml index 37b001cf..8b3815fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,8 +20,8 @@ dependencies = [ "numpy", "dask", "distributed", - "zarr==v3.0.0-beta.3", - "fsspec[s3]>=0.8,!=2021.07.0", + "zarr>=v3.0.0", + "fsspec[s3]>=0.8,!=2021.07.0,!=2023.9.0", # See https://github.com/fsspec/filesystem_spec/issues/819 "aiohttp<4", "requests", diff --git a/tests/test_cli.py b/tests/test_cli.py index cd60e6cf..b38aba46 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -8,6 +8,16 @@ from ome_zarr.utils import strip_common_prefix +def directory_items(directory: Path): + """ + Get all items (files and folders) in a directory, relative to that directory. + """ + if not directory.is_dir(): + raise ValueError(f"{directory} is not a directory") + + return sorted([p.relative_to(directory) for p in directory.glob("*")]) + + class TestCli: @pytest.fixture(autouse=True) def initdir(self, tmpdir): @@ -40,6 +50,24 @@ def test_astronaut_download(self, tmpdir): main(["download", filename, f"--output={out}"]) main(["info", f"{out}/{basename}"]) + assert directory_items(Path(out) / "data-3") == [ + Path(".zattrs"), + Path(".zgroup"), + Path("0"), + Path("1"), + Path("2"), + Path("3"), + Path("4"), + Path("labels"), + ] + + assert directory_items(Path(out) / "data-3" / "1") == [ + Path(".zarray"), + Path("0"), + Path("1"), + Path("2"), + ] + def test_s3_info(self, s3_address): main(["info", s3_address])