Skip to content

Commit 91f40d0

Browse files
committed
Fix black formatting with --skip-magic-trailing-comma
Signed-off-by: Emanuilo Jovanovic <emanuilo.jovanovic@hotmail.com>
1 parent 6484465 commit 91f40d0

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

tests/transforms/test_spatial_cropd.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,34 +79,23 @@ class TestSpatialCropdStringKeys(unittest.TestCase):
7979
def test_string_roi_start_end(self):
8080
"""String keys for roi_start and roi_end should resolve from data dict."""
8181
img = MetaTensor(torch.rand(3, 10, 10, 10))
82-
data = {
83-
"img": img,
84-
"roi_start_key": [0, 0, 0],
85-
"roi_end_key": [5, 5, 5],
86-
}
82+
data = {"img": img, "roi_start_key": [0, 0, 0], "roi_end_key": [5, 5, 5]}
8783
cropper = SpatialCropd(keys="img", roi_start="roi_start_key", roi_end="roi_end_key")
8884
result = cropper(data)
8985
self.assertEqual(result["img"].shape, (3, 5, 5, 5))
9086

9187
def test_string_roi_center_size(self):
9288
"""String keys for roi_center and roi_size should resolve from data dict."""
9389
img = MetaTensor(torch.rand(1, 20, 20, 20))
94-
data = {
95-
"img": img,
96-
"center_key": [10, 10, 10],
97-
"size_key": [6, 6, 6],
98-
}
90+
data = {"img": img, "center_key": [10, 10, 10], "size_key": [6, 6, 6]}
9991
cropper = SpatialCropd(keys="img", roi_center="center_key", roi_size="size_key")
10092
result = cropper(data)
10193
self.assertEqual(result["img"].shape, (1, 6, 6, 6))
10294

10395
def test_mixed_string_and_direct(self):
10496
"""Mix of string key and direct value for ROI params."""
10597
img = MetaTensor(torch.rand(1, 20, 20, 20))
106-
data = {
107-
"img": img,
108-
"center_key": [10, 10, 10],
109-
}
98+
data = {"img": img, "center_key": [10, 10, 10]}
11099
cropper = SpatialCropd(keys="img", roi_center="center_key", roi_size=[4, 4, 4])
111100
result = cropper(data)
112101
self.assertEqual(result["img"].shape, (1, 4, 4, 4))
@@ -175,11 +164,7 @@ def test_string_key_same_as_direct(self):
175164
def test_inverse_with_string_keys(self):
176165
"""Inverse should work correctly when string keys are used."""
177166
img = MetaTensor(torch.rand(1, 10, 10, 10))
178-
data = {
179-
"img": img,
180-
"start": [2, 2, 2],
181-
"end": [6, 6, 6],
182-
}
167+
data = {"img": img, "start": [2, 2, 2], "end": [6, 6, 6]}
183168
cropper = SpatialCropd(keys="img", roi_start="start", roi_end="end")
184169
result = cropper(data)
185170
self.assertEqual(result["img"].shape, (1, 4, 4, 4))

tests/transforms/utility/test_transform_points_image_to_worldd.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ class TestTransformPointsImageToWorldd(unittest.TestCase):
4040
@parameterized.expand(TEST_CASES)
4141
def test_transform(self, image, points, expected_output):
4242
data = {"image": image, "point": points}
43-
transform = TransformPointsImageToWorldd(
44-
keys="point",
45-
refer_keys="image",
46-
dtype=torch.int64,
47-
)
43+
transform = TransformPointsImageToWorldd(keys="point", refer_keys="image", dtype=torch.int64)
4844
output = transform(data)
4945
self.assertTrue(torch.allclose(output["point"], expected_output))
5046

tests/transforms/utility/test_transform_points_world_to_imaged.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ class TestTransformPointsWorldToImaged(unittest.TestCase):
4747
def test_transform(self, image, points, affine_lps_to_ras, expected_output):
4848
data = {"image": image, "point": points}
4949
transform = TransformPointsWorldToImaged(
50-
keys="point",
51-
refer_keys="image",
52-
dtype=torch.int64,
53-
affine_lps_to_ras=affine_lps_to_ras,
50+
keys="point", refer_keys="image", dtype=torch.int64, affine_lps_to_ras=affine_lps_to_ras
5451
)
5552
output = transform(data)
5653
self.assertTrue(torch.allclose(output["point"], expected_output))

0 commit comments

Comments
 (0)