Enable some ruff checks for performance and readability (#39383)
* Fix inefficient sequence tests Signed-off-by: cyy <cyyever@outlook.com> * Enable PERF102 Signed-off-by: cyy <cyyever@outlook.com> * Enable PLC1802 Signed-off-by: cyy <cyyever@outlook.com> * Enable PLC0208 Signed-off-by: cyy <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -37,7 +37,7 @@ from tests.test_pipeline_mixin import pipeline_test_mapping
|
||||
|
||||
|
||||
PIPELINE_TEST_MAPPING = {}
|
||||
for task, _ in pipeline_test_mapping.items():
|
||||
for task in pipeline_test_mapping.keys():
|
||||
PIPELINE_TEST_MAPPING[task] = {"pt": None, "tf": None}
|
||||
|
||||
|
||||
|
||||
@@ -790,7 +790,7 @@ def check_all_auto_object_names_being_defined():
|
||||
mappings_to_check.update({name: getattr(module, name) for name in mapping_names})
|
||||
|
||||
for name, mapping in mappings_to_check.items():
|
||||
for _, class_names in mapping.items():
|
||||
for class_names in mapping.values():
|
||||
if not isinstance(class_names, tuple):
|
||||
class_names = (class_names,)
|
||||
for class_name in class_names:
|
||||
|
||||
@@ -332,7 +332,7 @@ if __name__ == "__main__":
|
||||
|
||||
doc_test_results = {}
|
||||
# `artifact_key` is the artifact path
|
||||
for artifact_key, artifact_obj in available_artifacts.items():
|
||||
for artifact_obj in available_artifacts.values():
|
||||
artifact_path = artifact_obj.paths[0]
|
||||
if not artifact_path["path"].startswith("doc_tests_gpu_test_reports_"):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user