Skip to content

Commit

Permalink
expand tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocerrone committed Nov 13, 2024
1 parent 2479961 commit e65c5fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/core/test_image_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def test_ngff_image(self, ome_zarr_image_v04_path):

image_handler = Image(store=ome_zarr_image_v04_path, path="0")

assert image_handler.array_path == f"{ome_zarr_image_v04_path}/0"
assert image_handler.channel_labels == ["DAPI", "nanog", "Lamin B1"]
assert image_handler.get_channel_idx(label="DAPI") == 0
assert image_handler.get_channel_idx(wavelength_id="A01_C01") == 0
Expand Down
1 change: 1 addition & 0 deletions tests/core/test_image_like_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_ngff_image(self, ome_zarr_image_v04_path: Path) -> None:
store = ome_zarr_image_v04_path
image_handler = ImageLike(store=store, path="0")

assert image_handler.array_path == f"{ome_zarr_image_v04_path}/0"
assert image_handler.path == "0"
assert image_handler.pixel_size.zyx == (1.0, 0.1625, 0.1625)
assert image_handler.axes_names == ["c", "z", "y", "x"]
Expand Down
6 changes: 5 additions & 1 deletion tests/core/test_label_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from pathlib import Path


class TestLabel:
def test_label_image(self, ome_zarr_image_v04_path):
def test_label_image(self, ome_zarr_image_v04_path: Path) -> None:
import dask.array as da
import numpy as np

Expand All @@ -9,6 +12,7 @@ def test_label_image(self, ome_zarr_image_v04_path):
image_handler = ngff_image.get_image(path="0")
label_handler = ngff_image.label.derive(name="label")

assert label_handler.array_path == f"{ome_zarr_image_v04_path}/labels/label/0"
assert ngff_image.label.list() == ["label"]
assert "c" not in label_handler.axes_names
assert label_handler.shape == image_handler.shape[1:]
Expand Down

0 comments on commit e65c5fa

Please sign in to comment.