Skip to content

Ruff check failed #7884

@KumoLiu

Description

@KumoLiu
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions