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

Ruff check failed #7884

Closed
KumoLiu opened this issue Jun 28, 2024 · 0 comments · Fixed by #7885
Closed

Ruff check failed #7884

KumoLiu opened this issue Jun 28, 2024 · 0 comments · Fixed by #7885

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Jun 28, 2024

ruff 0.5.0
warning: The `ignore-init-module-imports` option is deprecated and will be removed in a future release. Ruff's handling of imports in `__init__.py` files has been improved (in preview) and unused imports will always be flagged.
tests/test_pad_collation.py:92:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
   |
90 |     @parameterized.expand(TESTS)
91 |     def test_pad_collation(self, t_type, collate_method, transform):
92 |         if t_type == dict:
   |            ^^^^^^^^^^^^^^ E721
93 |             dataset = CacheDataset(self.dict_data, transform, progress=False)
94 |         else:
   |

tests/test_pad_collation.py:107:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
    |
105 |         # check collation in forward direction
106 |         for data in loader:
107 |             if t_type == dict:
    |                ^^^^^^^^^^^^^^ E721
108 |                 shapes = []
109 |                 decollated_data = decollate_batch(data)
    |

tests/test_pad_collation.py:116:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
    |
114 |                 self.assertTrue(len(set(shapes)) > 1)  # inverted shapes must be different because of random xforms
115 | 
116 |         if t_type == dict:
    |            ^^^^^^^^^^^^^^ E721
117 |             batch_inverse = BatchInverseTransform(dataset.transform, loader)
118 |             for data in loader:
    |

Found 3 errors.
Check failed!
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Jun 28, 2024
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
@KumoLiu KumoLiu mentioned this issue Jun 28, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant