From 34700f0a940c2b09b56bc321ebee220d2285e8a7 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 3 Apr 2024 13:59:10 +0800 Subject: [PATCH] [CodeStyle] bump ruff version to 0.3.5 (#63206) --- .pre-commit-config.yaml | 2 +- test/ir/pir/fused_pass/xpu/pass_test.py | 6 ++---- test/legacy_test/test_stack_extension_api.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d1ac6a170243c..7b100965d8e915 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,7 +57,7 @@ repos: - id: black files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.0 + rev: v0.3.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] diff --git a/test/ir/pir/fused_pass/xpu/pass_test.py b/test/ir/pir/fused_pass/xpu/pass_test.py index 7eae64b3fe8599..a66a9e6e7c3a57 100644 --- a/test/ir/pir/fused_pass/xpu/pass_test.py +++ b/test/ir/pir/fused_pass/xpu/pass_test.py @@ -54,10 +54,8 @@ def check_fused_ops(self, program): actual_valid_op_count = op_names.count(valid_op_name) self.assertTrue( valid_op_count == actual_valid_op_count, - "Checking of the number of fused operator < {} > failed. " - "Expected: {}, Received: {}".format( - valid_op_name, valid_op_count, actual_valid_op_count - ), + f"Checking of the number of fused operator < {valid_op_name} > failed. " + f"Expected: {valid_op_count}, Received: {actual_valid_op_count}", ) @abc.abstractmethod diff --git a/test/legacy_test/test_stack_extension_api.py b/test/legacy_test/test_stack_extension_api.py index b6f42de6c95373..84ec12d20c2862 100644 --- a/test/legacy_test/test_stack_extension_api.py +++ b/test/legacy_test/test_stack_extension_api.py @@ -375,7 +375,7 @@ def test_dtype(self): class TestRowStack(BaseTest, BaseCases): def setUp(self): self.func_paddle = paddle.row_stack - self.func_numpy = np.row_stack + self.func_numpy = np.vstack def test_mix_ndim(self): d0 = generate_data([2], count=1, dtype='float64') @@ -495,7 +495,7 @@ def setUp(self): class TestErrorRowStack(BaseTest, ErrorCases0d1d): def setUp(self): self.func_paddle = paddle.row_stack - self.func_numpy = np.row_stack + self.func_numpy = np.vstack if __name__ == '__main__':