Skip to content

Commit f27c627

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent dee8bef commit f27c627

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

ome_zarr/image.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ class NgffMultiscales:
136136
"""
137137

138138
image: InitVar[NgffImage]
139-
scale_factors: list[int] | list[dict[str, int]] = field(default_factory=lambda: [2, 4, 8, 16])
139+
scale_factors: list[int] | list[dict[str, int]] = field(
140+
default_factory=lambda: [2, 4, 8, 16]
141+
)
140142
method: str | Methods = Methods.RESIZE
141143
coordinateTransformations: InitVar[list[Scale | Translation | Identity] | None] = (
142144
None
@@ -266,7 +268,7 @@ def to_ome_zarr(
266268
-------
267269
list
268270
If `compute` is False, returns a list of Dask delayed objects
269-
representing the write operations.
271+
representing the write operations.
270272
"""
271273
import os
272274
import shutil
@@ -361,7 +363,7 @@ def to_ome_zarr(
361363

362364
else:
363365
raise ValueError(f"Unsupported OME-Zarr version: {version}")
364-
366+
365367
return delayed
366368

367369
@classmethod

ome_zarr/writer.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def write_image(
520520
axes: AxesType = None,
521521
coordinate_transformations: list[list[dict[str, Any]]] | None = None,
522522
storage_options: JSONDict | list[JSONDict] | None = None,
523-
compute: bool = True
523+
compute: bool = True,
524524
) -> list:
525525
"""
526526
Write an image to the zarr store according to the OME-Zarr specification, supporting multiscale pyramids.
@@ -609,8 +609,8 @@ def write_image(
609609

610610
# default settings for scale
611611
if scale is None:
612-
scale = {d: 1.0 for d in dims}
613-
612+
scale = dict.fromkeys(dims, 1.0)
613+
614614
# make sure every axis is present and order of dims is correct
615615
scale = {d: scale.get(d, 1.0) for d in dims}
616616

@@ -651,11 +651,7 @@ def write_image(
651651
method = Methods.RESIZE
652652

653653
ngff_image = NgffImage(
654-
data=image,
655-
scale=scale,
656-
dims=dims,
657-
name=name,
658-
axes_units=axes_units
654+
data=image, scale=scale, dims=dims, name=name, axes_units=axes_units
659655
)
660656
ngff_multiscales = NgffMultiscales(
661657
image=ngff_image,
@@ -978,7 +974,7 @@ def write_labels(
978974
group: zarr.Group | str,
979975
name: str,
980976
scaler: Scaler | None = Scaler(order=0),
981-
scale_factors: list[int] | list[dict[str, int]] = [2, 4, 8, 16],
977+
scale_factors: list[int] | list[dict[str, int]] = [2, 4, 8, 16],
982978
method: Methods = Methods.NEAREST,
983979
fmt: Format | None = None,
984980
axes: AxesType = None,

0 commit comments

Comments
 (0)