Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ruff type check issue #7885

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,12 @@ Post-processing
:members:
:special-members: __call__

`Invert`
"""""""""
.. autoclass:: Invert
:members:
:special-members: __call__

Regularization
^^^^^^^^^^^^^^

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ exclude = "monai/bundle/__main__.py"

[tool.ruff]
line-length = 133
lint.ignore-init-module-imports = true
lint.ignore = ["F401", "E741"]

[tool.pytype]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_pad_collation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def tearDown(self) -> None:

@parameterized.expand(TESTS)
def test_pad_collation(self, t_type, collate_method, transform):
if t_type == dict:
if t_type is dict:
dataset = CacheDataset(self.dict_data, transform, progress=False)
else:
dataset = _Dataset(self.list_data, self.list_labels, transform)
Expand All @@ -104,7 +104,7 @@ def test_pad_collation(self, t_type, collate_method, transform):
loader = DataLoader(dataset, batch_size=10, collate_fn=collate_method)
# check collation in forward direction
for data in loader:
if t_type == dict:
if t_type is dict:
shapes = []
decollated_data = decollate_batch(data)
for d in decollated_data:
Expand All @@ -113,7 +113,7 @@ def test_pad_collation(self, t_type, collate_method, transform):
self.assertTrue(len(output["image"].applied_operations), len(dataset.transform.transforms))
self.assertTrue(len(set(shapes)) > 1) # inverted shapes must be different because of random xforms

if t_type == dict:
if t_type is dict:
batch_inverse = BatchInverseTransform(dataset.transform, loader)
for data in loader:
output = batch_inverse(data)
Expand Down
Loading