Repository: ome/ome-zarr-py

Issue:
Document Scaler parameters
The [API docs for Scaler](https://ome-zarr.readthedocs.io/en/stable/api/scale.html#ome_zarr.scale.Scaler) don't have any documentation of the parameters used to create a new Scaler object. It would be nice to add some explaining what each of the options mean.

Discussion:

Solution patch:
diff --git a/ome_zarr/scale.py b/ome_zarr/scale.py
index 2ed3b65..deac331 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 086ede3..c929c28 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))


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
index cd60e6c..b38aba4 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -8,6 +8,16 @@ from ome_zarr.cli import main
 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 @@ class TestCli:
         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])