Skip to content

Commit 78295c7

Browse files
authored
Fix Premerge (#7397)
Fixes #7396 ### 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: YunLiu <[email protected]>
1 parent 25f1901 commit 78295c7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ max_line_length = 120
173173
# B028 https://github.com/Project-MONAI/MONAI/issues/5855
174174
# B907 https://github.com/Project-MONAI/MONAI/issues/5868
175175
# B908 https://github.com/Project-MONAI/MONAI/issues/6503
176+
# B036 https://github.com/Project-MONAI/MONAI/issues/7396
176177
ignore =
177178
E203
178179
E501
@@ -186,6 +187,7 @@ ignore =
186187
B028
187188
B907
188189
B908
190+
B036
189191
per_file_ignores = __init__.py: F401, __main__.py: F401
190192
exclude = *.pyi,.git,.eggs,monai/_version.py,versioneer.py,venv,.venv,_version.py
191193

tests/test_flexible_unet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DummyEncoder(BaseEncoder):
3939
def get_encoder_parameters(cls):
4040
basic_dict = {"spatial_dims": 2, "in_channels": 3, "pretrained": False}
4141
param_dict_list = [basic_dict]
42-
for key in basic_dict:
42+
for key in basic_dict.keys():
4343
cur_dict = basic_dict.copy()
4444
del cur_dict[key]
4545
param_dict_list.append(cur_dict)

tests/test_invertd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ def test_invert(self):
112112
self.assertTupleEqual(i.shape[1:], (101, 100, 107))
113113

114114
# check the case that different items use different interpolation mode to invert transforms
115-
d = item["image_inverted1"]
115+
j = item["image_inverted1"]
116116
# if the interpolation mode is nearest, accumulated diff should be smaller than 1
117-
self.assertLess(torch.sum(d.to(torch.float) - d.to(torch.uint8).to(torch.float)).item(), 1.0)
118-
self.assertTupleEqual(d.shape, (1, 101, 100, 107))
117+
self.assertLess(torch.sum(j.to(torch.float) - j.to(torch.uint8).to(torch.float)).item(), 1.0)
118+
self.assertTupleEqual(j.shape, (1, 101, 100, 107))
119119

120-
d = item["label_inverted1"]
120+
k = item["label_inverted1"]
121121
# if the interpolation mode is not nearest, accumulated diff should be greater than 10000
122-
self.assertGreater(torch.sum(d.to(torch.float) - d.to(torch.uint8).to(torch.float)).item(), 10000.0)
123-
self.assertTupleEqual(d.shape, (1, 101, 100, 107))
122+
self.assertGreater(torch.sum(k.to(torch.float) - k.to(torch.uint8).to(torch.float)).item(), 10000.0)
123+
self.assertTupleEqual(k.shape, (1, 101, 100, 107))
124124

125125
# check labels match
126126
reverted = item["label_inverted"].detach().cpu().numpy().astype(np.int32)

0 commit comments

Comments
 (0)