Skip to content

Commit

Permalink
Consistently use List[Union[str, dict]]
Browse files Browse the repository at this point in the history
  • Loading branch information
sbesson committed Jan 14, 2022
1 parent 01fc3c9 commit 0ed8b0b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ome_zarr/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def _validate_axes(axes: List[str], fmt: Format = CurrentFormat()) -> None:
raise ValueError("5D data must have axes ('t', 'c', 'z', 'y', 'x')")


def _validate_well_images(images: List, fmt: Format = CurrentFormat()) -> List[dict]:
def _validate_well_images(
images: List[Union[str, dict]], fmt: Format = CurrentFormat()
) -> List[dict]:

VALID_KEYS = [
"acquisition",
Expand Down Expand Up @@ -120,7 +122,9 @@ def _validate_plate_acquisitions(
return acquisitions


def _validate_plate_wells(wells: List, fmt: Format = CurrentFormat()) -> List[dict]:
def _validate_plate_wells(
wells: List[Union[str, dict]], fmt: Format = CurrentFormat()
) -> List[dict]:

VALID_KEYS = [
"path",
Expand Down Expand Up @@ -225,7 +229,7 @@ def write_plate_metadata(
group: zarr.Group,
rows: List[str],
columns: List[str],
wells: Union[List[str], List[dict]],
wells: List[Union[str, dict]],
fmt: Format = CurrentFormat(),
acquisitions: List[dict] = None,
field_count: int = None,
Expand All @@ -242,7 +246,7 @@ def write_plate_metadata(
The list of names for the plate rows
columns: list of str
The list of names for the plate columns
wells: list of str or list of dict
wells: list of str or dict
The list of paths for the well groups
fmt: Format
The format of the ome_zarr data which should be used.
Expand Down Expand Up @@ -272,7 +276,7 @@ def write_plate_metadata(

def write_well_metadata(
group: zarr.Group,
images: Union[List[str], List[dict]],
images: List[Union[str, dict]],
fmt: Format = CurrentFormat(),
) -> None:
"""
Expand All @@ -282,7 +286,7 @@ def write_well_metadata(
----------
group: zarr.Group
the group within the zarr store to write the metadata in.
image_paths: list of str
image_paths: list of str or dict
The list of paths for the well images
image_acquisitions: list of int
The list of acquisitions for the well images
Expand Down

0 comments on commit 0ed8b0b

Please sign in to comment.