Skip to content

Commit

Permalink
fix formatting issues for three more files
Browse files Browse the repository at this point in the history
Signed-off-by: Han Wang <freddie.wanah@gmail.com>
  • Loading branch information
freddiewanah committed Apr 18, 2024
1 parent 00b1465 commit d01b61e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 42 deletions.
16 changes: 2 additions & 14 deletions tests/test_hausdorff_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,7 @@ def test_ill_opts(self):
with self.assertRaisesRegex(ValueError, ""):
HausdorffDTLoss(reduction=None)(chn_input, chn_target)

@parameterized.expand(
[
(False, False, False),
(False, True, False),
(False, False, True),
]
)
@parameterized.expand([(False, False, False), (False, True, False), (False, False, True)])
def test_input_warnings(self, include_background, softmax, to_onehot_y):
chn_input = torch.ones((1, 1, 1, 3))
chn_target = torch.ones((1, 1, 1, 3))
Expand Down Expand Up @@ -257,13 +251,7 @@ def test_ill_opts(self):
with self.assertRaisesRegex(ValueError, ""):
LogHausdorffDTLoss(reduction=None)(chn_input, chn_target)

@parameterized.expand(
[
(False, False, False),
(False, True, False),
(False, False, True),
]
)
@parameterized.expand([(False, False, False), (False, True, False), (False, False, True)])
def test_input_warnings(self, include_background, softmax, to_onehot_y):
chn_input = torch.ones((1, 1, 1, 3))
chn_target = torch.ones((1, 1, 1, 3))
Expand Down
8 changes: 1 addition & 7 deletions tests/test_tversky_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,7 @@ def test_ill_shape(self):
with self.assertRaisesRegex(ValueError, ""):
TverskyLoss(reduction=None)(chn_input, chn_target)

@parameterized.expand(
[
(False, False, False),
(False, True, False),
(False, False, True),
]
)
@parameterized.expand([(False, False, False), (False, True, False), (False, False, True)])
def test_input_warnings(self, include_background, softmax, to_onehot_y):
chn_input = torch.ones((1, 1, 3))
chn_target = torch.ones((1, 1, 3))
Expand Down
24 changes: 3 additions & 21 deletions tests/test_ultrasound_confidence_map_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,7 @@ def test_parameters(self):
UltrasoundConfidenceMapTransform(sink_mode="unknown")

@parameterized.expand(
[
("all", SINK_ALL_OUTPUT),
("mid", SINK_MID_OUTPUT),
("min", SINK_MIN_OUTPUT),
("mask", SINK_MASK_OUTPUT, True),
]
[("all", SINK_ALL_OUTPUT), ("mid", SINK_MID_OUTPUT), ("min", SINK_MIN_OUTPUT), ("mask", SINK_MASK_OUTPUT, True)]
)
def test_ultrasound_confidence_map_transform(self, sink_mode, expected_output, use_mask=False):
# RGB image
Expand Down Expand Up @@ -589,14 +584,7 @@ def test_multi_channel_2d(self, sink_mode, expected_output, use_mask=False):
self.assertIsInstance(result_np, np.ndarray)
assert_allclose(result_np, expected_output, rtol=1e-4, atol=1e-4)

@parameterized.expand(
[
("all",),
("mid",),
("min",),
("mask",),
]
)
@parameterized.expand([("all",), ("mid",), ("min",), ("mask",)])
def test_non_one_first_dim(self, sink_mode):
transform = UltrasoundConfidenceMapTransform(sink_mode=sink_mode)
input_img_rgb = np.repeat(self.input_img_np, 3, axis=0)
Expand Down Expand Up @@ -631,13 +619,7 @@ def test_no_first_dim(self, sink_mode):
with self.assertRaises(ValueError):
transform(input_img_rgb, self.input_mask_np)

@parameterized.expand(
[
("all",),
("mid",),
("min",),
]
)
@parameterized.expand([("all",), ("mid",), ("min",)])
def test_sink_mode(self, mode):
transform = UltrasoundConfidenceMapTransform(sink_mode=mode)

Expand Down

0 comments on commit d01b61e

Please sign in to comment.