From 9deb288363a8bdce6ccdc89848cb5d6fd694eef1 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 17 May 2024 16:02:27 -0400 Subject: [PATCH 1/2] style: enable W rules Fix https://github.com/deepmodeling/deepmd-kit/issues/3789. Signed-off-by: Jinzhe Zeng --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 23d42e73d2..80d5ad9ee9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -298,6 +298,7 @@ docstring-code-format = true [tool.ruff.lint] select = [ "E", # errors + "W", # warning "F", # pyflakes "D", # pydocstyle "UP", # pyupgrade From 3d4f5f79f47b4d2e04b7072f355037fe4cb21262 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 20:03:32 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/getting-started/quick_start.ipynb | 2 +- source/tests/pt/model/test_fitting_net.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/getting-started/quick_start.ipynb b/doc/getting-started/quick_start.ipynb index 67674c4654..67462c91d4 100644 --- a/doc/getting-started/quick_start.ipynb +++ b/doc/getting-started/quick_start.ipynb @@ -396,7 +396,7 @@ } ], "source": [ - "! cat DeePMD-kit_Tutorial/00.data/training_data/type.raw " + "! cat DeePMD-kit_Tutorial/00.data/training_data/type.raw" ] }, { diff --git a/source/tests/pt/model/test_fitting_net.py b/source/tests/pt/model/test_fitting_net.py index c7e1723799..900b01d687 100644 --- a/source/tests/pt/model/test_fitting_net.py +++ b/source/tests/pt/model/test_fitting_net.py @@ -113,7 +113,7 @@ def test_consistency(self): ).to(env.DEVICE) for name, param in my_fn.named_parameters(): matched = re.match( - "filter_layers\.networks\.(\d).layers\.(\d)\.([a-z]+)", name + r"filter_layers\.networks\.(\d).layers\.(\d)\.([a-z]+)", name ) key = None if matched: