Skip to content

Commit 0030a7c

Browse files
authored
Fixing SSIM Test Method Names (#8746)
### Description This fixes erroneous test names flagged elsewhere by coderabbit. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent b887eae commit 0030a7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/metrics/test_compute_multiscalessim_metric.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class TestMultiScaleSSIMMetric(unittest.TestCase):
2323

24-
def test2d_gaussian(self):
24+
def test_2d_gaussian(self):
2525
set_determinism(0)
2626
preds = torch.abs(torch.randn(1, 1, 64, 64))
2727
target = torch.abs(torch.randn(1, 1, 64, 64))
@@ -34,7 +34,7 @@ def test2d_gaussian(self):
3434
expected_value = 0.023176
3535
self.assertAlmostEqual(expected_value, result.item(), 4)
3636

37-
def test2d_uniform(self):
37+
def test_2d_uniform(self):
3838
set_determinism(0)
3939
preds = torch.abs(torch.randn(1, 1, 64, 64))
4040
target = torch.abs(torch.randn(1, 1, 64, 64))
@@ -47,7 +47,7 @@ def test2d_uniform(self):
4747
expected_value = 0.022655
4848
self.assertAlmostEqual(expected_value, result.item(), 4)
4949

50-
def test3d_gaussian(self):
50+
def test_3d_gaussian(self):
5151
set_determinism(0)
5252
preds = torch.abs(torch.randn(1, 1, 64, 64, 64))
5353
target = torch.abs(torch.randn(1, 1, 64, 64, 64))
@@ -60,19 +60,19 @@ def test3d_gaussian(self):
6060
expected_value = 0.061796
6161
self.assertAlmostEqual(expected_value, result.item(), 4)
6262

63-
def input_ill_input_shape2d(self):
63+
def test_input_ill_input_shape2d(self):
6464
metric = MultiScaleSSIMMetric(spatial_dims=3, weights=[0.5, 0.5])
6565

6666
with self.assertRaises(ValueError):
6767
metric(torch.randn(1, 1, 64, 64), torch.randn(1, 1, 64, 64))
6868

69-
def input_ill_input_shape3d(self):
69+
def test_input_ill_input_shape3d(self):
7070
metric = MultiScaleSSIMMetric(spatial_dims=2, weights=[0.5, 0.5])
7171

7272
with self.assertRaises(ValueError):
7373
metric(torch.randn(1, 1, 64, 64, 64), torch.randn(1, 1, 64, 64, 64))
7474

75-
def small_inputs(self):
75+
def test_small_inputs(self):
7676
metric = MultiScaleSSIMMetric(spatial_dims=2)
7777

7878
with self.assertRaises(ValueError):

0 commit comments

Comments
 (0)