Skip to content

Commit

Permalink
update tests to reflect change in type of metadata returned by reader
Browse files Browse the repository at this point in the history
  • Loading branch information
yichechang committed Sep 24, 2023
1 parent 5ca5f83 commit 8cf74ec
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions aicsimageio/tests/readers/extra_readers/test_nd2_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"expected_dtype, "
"expected_dims_order, "
"expected_channel_names, "
"expected_physical_pixel_sizes",
"expected_physical_pixel_sizes, "
"expected_metadata_type",
[
pytest.param(
"example.txt",
Expand All @@ -42,6 +43,7 @@
None,
None,
None,
None,
marks=pytest.mark.xfail(raises=exceptions.UnsupportedFileFormatError),
),
pytest.param(
Expand All @@ -53,6 +55,7 @@
"TCYX",
["20phase", "20xDiO"],
(1, 50, 50),
dict,
),
(
"ND2_jonas_header_test2.nd2",
Expand All @@ -63,6 +66,7 @@
"CTZYX",
["Jonas_DIC"],
(0.5, 0.12863494437945, 0.12863494437945),
OME,
),
(
"ND2_maxime_BF007.nd2",
Expand All @@ -73,6 +77,7 @@
"CYX",
["405/488/561/633nm"],
(1.0, 0.158389678930686, 0.158389678930686),
OME,
),
(
"ND2_dims_p4z5t3c2y32x32.nd2",
Expand All @@ -83,6 +88,7 @@
"TZCYX",
["Widefield Green", "Widefield Red"],
(1.0, 0.652452890023035, 0.652452890023035),
OME,
),
(
"ND2_dims_c2y32x32.nd2",
Expand All @@ -93,6 +99,7 @@
"CYX",
["Widefield Green", "Widefield Red"],
(1.0, 0.652452890023035, 0.652452890023035),
OME,
),
(
"ND2_dims_p1z5t3c2y32x32.nd2",
Expand All @@ -103,6 +110,7 @@
"TZCYX",
["Widefield Green", "Widefield Red"],
(1.0, 0.652452890023035, 0.652452890023035),
OME,
),
(
"ND2_dims_p2z5t3-2c4y32x32.nd2",
Expand All @@ -113,6 +121,7 @@
"TZCYX",
["Widefield Green", "Widefield Red", "Widefield Far-Red", "Brightfield"],
(1.0, 0.652452890023035, 0.652452890023035),
OME,
),
(
"ND2_dims_t3c2y32x32.nd2",
Expand All @@ -123,6 +132,7 @@
"TCYX",
["Widefield Green", "Widefield Red"],
(1.0, 0.652452890023035, 0.652452890023035),
OME,
),
(
"ND2_dims_rgb_t3p2c2z3x64y64.nd2",
Expand All @@ -133,6 +143,7 @@
"TZCYXS",
["Brightfield", "Brightfield"],
(0.01, 0.34285714285714286, 0.34285714285714286),
OME,
),
(
"ND2_dims_rgb.nd2",
Expand All @@ -143,6 +154,7 @@
"CYXS",
["Brightfield"],
(1.0, 0.34285714285714286, 0.34285714285714286),
OME,
),
],
)
Expand All @@ -156,6 +168,7 @@ def test_nd2_reader(
expected_dims_order: str,
expected_channel_names: List[str],
expected_physical_pixel_sizes: Tuple[float, float, float],
expected_metadata_type: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]],
) -> None:
# Construct full filepath
uri = get_resource_full_path(filename, host)
Expand All @@ -172,7 +185,7 @@ def test_nd2_reader(
expected_dims_order=expected_dims_order,
expected_channel_names=expected_channel_names,
expected_physical_pixel_sizes=expected_physical_pixel_sizes,
expected_metadata_type=dict,
expected_metadata_type=expected_metadata_type,
)


Expand All @@ -196,7 +209,7 @@ def test_nd2_reader(
dimensions.DEFAULT_DIMENSION_ORDER,
["Jonas_DIC"],
(0.5, 0.12863494437945, 0.12863494437945),
dict,
OME,
),
],
)
Expand Down

0 comments on commit 8cf74ec

Please sign in to comment.