From 1813631ca2a87f0dc809cc5ae981b239737e83f6 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 18 Dec 2024 09:55:46 +0100 Subject: [PATCH 01/10] Remove 'scale' in RST to pass validation --- README.rst | 2 -- 1 file changed, 2 deletions(-) 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 From 9d9229b620dec9d5844d0ea44f369900702a74c6 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 18 Dec 2024 09:55:55 +0100 Subject: [PATCH 02/10] =?UTF-8?q?Bump=20version:=200.10.2.dev0=20=E2=86=92?= =?UTF-8?q?=200.10.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6fbe6308..98c0a081 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.10.2.dev0 +current_version = 0.10.2 commit = True tag = True sign_tags = True diff --git a/setup.py b/setup.py index b01a8454..ab4517e7 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def read(fname): setup( name="ome-zarr", - version="0.10.2.dev0", + version="0.10.2", author="The Open Microscopy Team", url="https://github.com/ome/ome-zarr-py", description="Implementation of images in Zarr files.", From ff45c62837fe3cff5a6b2c70f1b98317858126c1 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 19 Dec 2024 22:10:08 +0000 Subject: [PATCH 03/10] Ignore DS_Store --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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* From 5253426c5416809f1a31cce6ca2372002ff883e5 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 19 Dec 2024 22:10:31 +0000 Subject: [PATCH 04/10] Bump sphinx-rtd-theme to 3.0.2 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 76aa0da8..ee42174a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ sphinx==7.1.2 -sphinx-rtd-theme==1.3.0 +sphinx-rtd-theme==3.0.2 fsspec==2023.6.0 zarr dask From 7472b9931862f18768f4271fd93b8ac11b9a2ff4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 19 Dec 2024 22:11:05 +0000 Subject: [PATCH 05/10] Point to config file --- .readthedocs.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index aba49f64..7f120630 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,17 +10,11 @@ build: os: ubuntu-22.04 tools: python: "3.10" - # 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: From 9ac61eaa94216c0d005120ad2587a833ab8c44c6 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 28 Dec 2024 08:58:16 +0000 Subject: [PATCH 06/10] Add regression test for files created when downloading --- tests/test_cli.py | 211 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index cd60e6cf..59c4650f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -40,6 +40,217 @@ def test_astronaut_download(self, tmpdir): main(["download", filename, f"--output={out}"]) main(["info", f"{out}/{basename}"]) + out_path = Path(out) / "data-3" + paths = [p.relative_to(out_path) for p in out_path.glob("*")] + assert sorted(paths) == [ + Path(".zattrs"), + Path(".zgroup"), + Path("0"), + Path("1"), + Path("2"), + Path("3"), + Path("4"), + Path("labels"), + ] + + data_path = Path(out) / "data-3" / "1" + paths = [p.relative_to(data_path) for p in data_path.glob("*")] + assert sorted(paths) == [ + Path(".zarray"), + Path("0.0.0"), + Path("0.0.1"), + Path("0.0.2"), + Path("0.0.3"), + Path("0.0.4"), + Path("0.0.5"), + Path("0.0.6"), + Path("0.0.7"), + Path("0.1.0"), + Path("0.1.1"), + Path("0.1.2"), + Path("0.1.3"), + Path("0.1.4"), + Path("0.1.5"), + Path("0.1.6"), + Path("0.1.7"), + Path("0.2.0"), + Path("0.2.1"), + Path("0.2.2"), + Path("0.2.3"), + Path("0.2.4"), + Path("0.2.5"), + Path("0.2.6"), + Path("0.2.7"), + Path("0.3.0"), + Path("0.3.1"), + Path("0.3.2"), + Path("0.3.3"), + Path("0.3.4"), + Path("0.3.5"), + Path("0.3.6"), + Path("0.3.7"), + Path("0.4.0"), + Path("0.4.1"), + Path("0.4.2"), + Path("0.4.3"), + Path("0.4.4"), + Path("0.4.5"), + Path("0.4.6"), + Path("0.4.7"), + Path("0.5.0"), + Path("0.5.1"), + Path("0.5.2"), + Path("0.5.3"), + Path("0.5.4"), + Path("0.5.5"), + Path("0.5.6"), + Path("0.5.7"), + Path("0.6.0"), + Path("0.6.1"), + Path("0.6.2"), + Path("0.6.3"), + Path("0.6.4"), + Path("0.6.5"), + Path("0.6.6"), + Path("0.6.7"), + Path("0.7.0"), + Path("0.7.1"), + Path("0.7.2"), + Path("0.7.3"), + Path("0.7.4"), + Path("0.7.5"), + Path("0.7.6"), + Path("0.7.7"), + Path("1.0.0"), + Path("1.0.1"), + Path("1.0.2"), + Path("1.0.3"), + Path("1.0.4"), + Path("1.0.5"), + Path("1.0.6"), + Path("1.0.7"), + Path("1.1.0"), + Path("1.1.1"), + Path("1.1.2"), + Path("1.1.3"), + Path("1.1.4"), + Path("1.1.5"), + Path("1.1.6"), + Path("1.1.7"), + Path("1.2.0"), + Path("1.2.1"), + Path("1.2.2"), + Path("1.2.3"), + Path("1.2.4"), + Path("1.2.5"), + Path("1.2.6"), + Path("1.2.7"), + Path("1.3.0"), + Path("1.3.1"), + Path("1.3.2"), + Path("1.3.3"), + Path("1.3.4"), + Path("1.3.5"), + Path("1.3.6"), + Path("1.3.7"), + Path("1.4.0"), + Path("1.4.1"), + Path("1.4.2"), + Path("1.4.3"), + Path("1.4.4"), + Path("1.4.5"), + Path("1.4.6"), + Path("1.4.7"), + Path("1.5.0"), + Path("1.5.1"), + Path("1.5.2"), + Path("1.5.3"), + Path("1.5.4"), + Path("1.5.5"), + Path("1.5.6"), + Path("1.5.7"), + Path("1.6.0"), + Path("1.6.1"), + Path("1.6.2"), + Path("1.6.3"), + Path("1.6.4"), + Path("1.6.5"), + Path("1.6.6"), + Path("1.6.7"), + Path("1.7.0"), + Path("1.7.1"), + Path("1.7.2"), + Path("1.7.3"), + Path("1.7.4"), + Path("1.7.5"), + Path("1.7.6"), + Path("1.7.7"), + Path("2.0.0"), + Path("2.0.1"), + Path("2.0.2"), + Path("2.0.3"), + Path("2.0.4"), + Path("2.0.5"), + Path("2.0.6"), + Path("2.0.7"), + Path("2.1.0"), + Path("2.1.1"), + Path("2.1.2"), + Path("2.1.3"), + Path("2.1.4"), + Path("2.1.5"), + Path("2.1.6"), + Path("2.1.7"), + Path("2.2.0"), + Path("2.2.1"), + Path("2.2.2"), + Path("2.2.3"), + Path("2.2.4"), + Path("2.2.5"), + Path("2.2.6"), + Path("2.2.7"), + Path("2.3.0"), + Path("2.3.1"), + Path("2.3.2"), + Path("2.3.3"), + Path("2.3.4"), + Path("2.3.5"), + Path("2.3.6"), + Path("2.3.7"), + Path("2.4.0"), + Path("2.4.1"), + Path("2.4.2"), + Path("2.4.3"), + Path("2.4.4"), + Path("2.4.5"), + Path("2.4.6"), + Path("2.4.7"), + Path("2.5.0"), + Path("2.5.1"), + Path("2.5.2"), + Path("2.5.3"), + Path("2.5.4"), + Path("2.5.5"), + Path("2.5.6"), + Path("2.5.7"), + Path("2.6.0"), + Path("2.6.1"), + Path("2.6.2"), + Path("2.6.3"), + Path("2.6.4"), + Path("2.6.5"), + Path("2.6.6"), + Path("2.6.7"), + Path("2.7.0"), + Path("2.7.1"), + Path("2.7.2"), + Path("2.7.3"), + Path("2.7.4"), + Path("2.7.5"), + Path("2.7.6"), + Path("2.7.7"), + ] + def test_s3_info(self, s3_address): main(["info", s3_address]) From 4e319db9afba58d8b6c32b58cadb629f899b5514 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 28 Dec 2024 09:07:13 +0000 Subject: [PATCH 07/10] Document Scaler attributes --- ome_zarr/scale.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ome_zarr/scale.py b/ome_zarr/scale.py index 2ed3b658..deac331c 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() From d6a822bbda2664137d701f49b6c038b48371db18 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 28 Dec 2024 09:13:17 +0000 Subject: [PATCH 08/10] Fix download separator --- ome_zarr/utils.py | 4 +- tests/test_cli.py | 213 ++++------------------------------------------ 2 files changed, 18 insertions(+), 199 deletions(-) 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/tests/test_cli.py b/tests/test_cli.py index 59c4650f..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,9 +50,7 @@ def test_astronaut_download(self, tmpdir): main(["download", filename, f"--output={out}"]) main(["info", f"{out}/{basename}"]) - out_path = Path(out) / "data-3" - paths = [p.relative_to(out_path) for p in out_path.glob("*")] - assert sorted(paths) == [ + assert directory_items(Path(out) / "data-3") == [ Path(".zattrs"), Path(".zgroup"), Path("0"), @@ -53,202 +61,11 @@ def test_astronaut_download(self, tmpdir): Path("labels"), ] - data_path = Path(out) / "data-3" / "1" - paths = [p.relative_to(data_path) for p in data_path.glob("*")] - assert sorted(paths) == [ + assert directory_items(Path(out) / "data-3" / "1") == [ Path(".zarray"), - Path("0.0.0"), - Path("0.0.1"), - Path("0.0.2"), - Path("0.0.3"), - Path("0.0.4"), - Path("0.0.5"), - Path("0.0.6"), - Path("0.0.7"), - Path("0.1.0"), - Path("0.1.1"), - Path("0.1.2"), - Path("0.1.3"), - Path("0.1.4"), - Path("0.1.5"), - Path("0.1.6"), - Path("0.1.7"), - Path("0.2.0"), - Path("0.2.1"), - Path("0.2.2"), - Path("0.2.3"), - Path("0.2.4"), - Path("0.2.5"), - Path("0.2.6"), - Path("0.2.7"), - Path("0.3.0"), - Path("0.3.1"), - Path("0.3.2"), - Path("0.3.3"), - Path("0.3.4"), - Path("0.3.5"), - Path("0.3.6"), - Path("0.3.7"), - Path("0.4.0"), - Path("0.4.1"), - Path("0.4.2"), - Path("0.4.3"), - Path("0.4.4"), - Path("0.4.5"), - Path("0.4.6"), - Path("0.4.7"), - Path("0.5.0"), - Path("0.5.1"), - Path("0.5.2"), - Path("0.5.3"), - Path("0.5.4"), - Path("0.5.5"), - Path("0.5.6"), - Path("0.5.7"), - Path("0.6.0"), - Path("0.6.1"), - Path("0.6.2"), - Path("0.6.3"), - Path("0.6.4"), - Path("0.6.5"), - Path("0.6.6"), - Path("0.6.7"), - Path("0.7.0"), - Path("0.7.1"), - Path("0.7.2"), - Path("0.7.3"), - Path("0.7.4"), - Path("0.7.5"), - Path("0.7.6"), - Path("0.7.7"), - Path("1.0.0"), - Path("1.0.1"), - Path("1.0.2"), - Path("1.0.3"), - Path("1.0.4"), - Path("1.0.5"), - Path("1.0.6"), - Path("1.0.7"), - Path("1.1.0"), - Path("1.1.1"), - Path("1.1.2"), - Path("1.1.3"), - Path("1.1.4"), - Path("1.1.5"), - Path("1.1.6"), - Path("1.1.7"), - Path("1.2.0"), - Path("1.2.1"), - Path("1.2.2"), - Path("1.2.3"), - Path("1.2.4"), - Path("1.2.5"), - Path("1.2.6"), - Path("1.2.7"), - Path("1.3.0"), - Path("1.3.1"), - Path("1.3.2"), - Path("1.3.3"), - Path("1.3.4"), - Path("1.3.5"), - Path("1.3.6"), - Path("1.3.7"), - Path("1.4.0"), - Path("1.4.1"), - Path("1.4.2"), - Path("1.4.3"), - Path("1.4.4"), - Path("1.4.5"), - Path("1.4.6"), - Path("1.4.7"), - Path("1.5.0"), - Path("1.5.1"), - Path("1.5.2"), - Path("1.5.3"), - Path("1.5.4"), - Path("1.5.5"), - Path("1.5.6"), - Path("1.5.7"), - Path("1.6.0"), - Path("1.6.1"), - Path("1.6.2"), - Path("1.6.3"), - Path("1.6.4"), - Path("1.6.5"), - Path("1.6.6"), - Path("1.6.7"), - Path("1.7.0"), - Path("1.7.1"), - Path("1.7.2"), - Path("1.7.3"), - Path("1.7.4"), - Path("1.7.5"), - Path("1.7.6"), - Path("1.7.7"), - Path("2.0.0"), - Path("2.0.1"), - Path("2.0.2"), - Path("2.0.3"), - Path("2.0.4"), - Path("2.0.5"), - Path("2.0.6"), - Path("2.0.7"), - Path("2.1.0"), - Path("2.1.1"), - Path("2.1.2"), - Path("2.1.3"), - Path("2.1.4"), - Path("2.1.5"), - Path("2.1.6"), - Path("2.1.7"), - Path("2.2.0"), - Path("2.2.1"), - Path("2.2.2"), - Path("2.2.3"), - Path("2.2.4"), - Path("2.2.5"), - Path("2.2.6"), - Path("2.2.7"), - Path("2.3.0"), - Path("2.3.1"), - Path("2.3.2"), - Path("2.3.3"), - Path("2.3.4"), - Path("2.3.5"), - Path("2.3.6"), - Path("2.3.7"), - Path("2.4.0"), - Path("2.4.1"), - Path("2.4.2"), - Path("2.4.3"), - Path("2.4.4"), - Path("2.4.5"), - Path("2.4.6"), - Path("2.4.7"), - Path("2.5.0"), - Path("2.5.1"), - Path("2.5.2"), - Path("2.5.3"), - Path("2.5.4"), - Path("2.5.5"), - Path("2.5.6"), - Path("2.5.7"), - Path("2.6.0"), - Path("2.6.1"), - Path("2.6.2"), - Path("2.6.3"), - Path("2.6.4"), - Path("2.6.5"), - Path("2.6.6"), - Path("2.6.7"), - Path("2.7.0"), - Path("2.7.1"), - Path("2.7.2"), - Path("2.7.3"), - Path("2.7.4"), - Path("2.7.5"), - Path("2.7.6"), - Path("2.7.7"), + Path("0"), + Path("1"), + Path("2"), ] def test_s3_info(self, s3_address): From aeefc1edd28a9c73f65ccd98a5438c6f7ad4acb2 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 28 Dec 2024 09:18:00 +0000 Subject: [PATCH 09/10] Pin bad version of fsspec --- docs/requirements.txt | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index ee42174a..43edcccf 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ sphinx==7.1.2 sphinx-rtd-theme==3.0.2 -fsspec==2023.6.0 +fsspec zarr dask numpy diff --git a/pyproject.toml b/pyproject.toml index 2327a521..975bf5c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "dask", "distributed", "zarr>=2.8.1,<3", - "fsspec[s3]>=0.8,!=2021.07.0", + "fsspec[s3]>=0.8,!=2021.07.0,!=2023.9.0", # See https://github.com/fsspec/filesystem_spec/issues/819 "aiohttp<4", "requests", From 1e3e3e22f63533ef8c89b2c874450f18f2ed8a37 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 8 Jan 2025 19:44:08 +0100 Subject: [PATCH 10/10] v0.10.3 changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) 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.