Skip to content

Commit 52792f0

Browse files
[pre-commit.ci] pre-commit autoupdate (#5381)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.8 → v0.15.9](astral-sh/ruff-pre-commit@v0.15.8...v0.15.9) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <njzjz@qq.com>
1 parent adf5b83 commit 52792f0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
exclude: ^source/3rdparty
3131
- repo: https://github.com/astral-sh/ruff-pre-commit
3232
# Ruff version.
33-
rev: v0.15.8
33+
rev: v0.15.9
3434
hooks:
3535
- id: ruff
3636
args: ["--fix"]

deepmd/tf/env.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def filter(self, record: logging.LogRecord) -> bool:
138138
# \3: layer index
139139
# The rest: types of neighbor atoms
140140
# IMPORTANT: the order is critical to match the pattern
141-
EMBEDDING_NET_PATTERN = str(
141+
EMBEDDING_NET_PATTERN = (
142142
r"filter_type_(\d+)/(matrix)_(\d+)_(\d+)|"
143143
r"filter_type_(\d+)/(bias)_(\d+)_(\d+)|"
144144
r"filter_type_(\d+)/(idt)_(\d+)_(\d+)|"
@@ -157,7 +157,7 @@ def filter(self, record: logging.LogRecord) -> bool:
157157
# \1: layer index or "final"
158158
# \2: type of centeral atom, optional
159159
# the last: weight name
160-
FITTING_NET_PATTERN = str(
160+
FITTING_NET_PATTERN = (
161161
r"layer_(\d+)/(matrix)|"
162162
r"layer_(\d+)_type_(\d+)/(matrix)|"
163163
r"layer_(\d+)/(bias)|"
@@ -182,13 +182,13 @@ def filter(self, record: logging.LogRecord) -> bool:
182182
# subpatterns:
183183
# \1: weight name
184184
# \2: layer index
185-
TYPE_EMBEDDING_PATTERN = str(
185+
TYPE_EMBEDDING_PATTERN = (
186186
r"type_embed_net/(matrix)_(\d+)|"
187187
r"type_embed_net/(bias)_(\d+)|"
188188
r"type_embed_net/(idt)_(\d+)|"
189189
)[:-1]
190190

191-
ATTENTION_LAYER_PATTERN = str(
191+
ATTENTION_LAYER_PATTERN = (
192192
r"attention_layer_(\d+)/(c_query)/(matrix)|"
193193
r"attention_layer_(\d+)/(c_query)/(bias)|"
194194
r"attention_layer_(\d+)/(c_key)/(matrix)|"
@@ -207,7 +207,7 @@ def filter(self, record: logging.LogRecord) -> bool:
207207
EMBEDDING_NET_PATTERN
208208
+ FITTING_NET_PATTERN
209209
+ TYPE_EMBEDDING_PATTERN
210-
+ str(
210+
+ (
211211
r"descrpt_attr/t_avg|"
212212
r"descrpt_attr/t_std|"
213213
r"fitting_attr/t_fparam_avg|"

0 commit comments

Comments
 (0)