Skip to content

Commit

Permalink
(chore): remove tests from erroneous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeschamps committed Jun 6, 2024
1 parent 0a494f4 commit b43e653
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions tests/config/test_inference_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,55 +115,3 @@ def test_set_3d(minimum_inference: dict):
assert "Z" in pred.axes
assert len(pred.tile_size) == 3
assert len(pred.tile_overlap) == 3


@pytest.mark.parametrize(
"transforms",
[
[
{"name": SupportedTransform.NORMALIZE.value},
],
],
)
def test_passing_supported_transforms(minimum_inference: dict, transforms):
"""Test that list of supported transforms can be passed."""
minimum_inference["transforms"] = transforms
InferenceConfig(**minimum_inference)


def test_cannot_pass_n2v_manipulate(minimum_inference: dict):
"""Test that passing N2V pixel manipulate transform raises an error."""
minimum_inference["transforms"] = [
{"name": SupportedTransform.N2V_MANIPULATE.value},
]
with pytest.raises(ValueError):
InferenceConfig(**minimum_inference)


def test_passing_empty_transforms(minimum_inference: dict):
"""Test that empty list of transforms can be passed."""
minimum_inference["transforms"] = []
InferenceConfig(**minimum_inference)


def test_passing_incorrect_element(minimum_inference: dict):
"""Test that incorrect element in the list of transforms raises an error (
e.g. passing un object rather than a string)."""
minimum_inference["transforms"] = [
{"name": get_all_transforms()[SupportedTransform.NDFLIP.value]()},
]
with pytest.raises(ValueError):
InferenceConfig(**minimum_inference)


def test_mean_and_std_in_normalize(minimum_inference: dict):
"""Test that mean and std are added to the Normalize transform."""
minimum_inference["image_mean"] = [10.4]
minimum_inference["image_std"] = [3.2]
minimum_inference["transforms"] = [
{"name": SupportedTransform.NORMALIZE.value},
]

data = InferenceConfig(**minimum_inference)
assert data.transforms[0].image_means == [10.4]
assert data.transforms[0].image_stds == [3.2]

0 comments on commit b43e653

Please sign in to comment.