Skip to content

Commit 91633f0

Browse files
[pre-commit.ci] pre-commit autoupdate (#2743)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](astral-sh/ruff-pre-commit@v0.0.282...v0.0.284) - [github.com/Lucas-C/pre-commit-hooks: v1.5.3 → v1.5.4](Lucas-C/pre-commit-hooks@v1.5.3...v1.5.4) <!--pre-commit.ci end--> --------- Signed-off-by: Jinzhe Zeng <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <[email protected]>
1 parent 94df72a commit 91633f0

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
files: \.py$
3434
- repo: https://github.com/astral-sh/ruff-pre-commit
3535
# Ruff version.
36-
rev: v0.0.282
36+
rev: v0.0.284
3737
hooks:
3838
- id: ruff
3939
args: ["--fix"]
@@ -72,7 +72,7 @@ repos:
7272
#- id: cmake-lint
7373
# license header
7474
- repo: https://github.com/Lucas-C/pre-commit-hooks
75-
rev: v1.5.3
75+
rev: v1.5.4
7676
hooks:
7777
# C++, js
7878
- id: insert-license

deepmd/entrypoints/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def get_min_nbor_dist(jdata, rcut):
445445

446446

447447
def parse_auto_sel(sel):
448-
if type(sel) is not str:
448+
if not isinstance(sel, str):
449449
return False
450450
words = sel.split(":")
451451
if words[0] == "auto":

deepmd/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ def get_module(module_name: str) -> "ModuleType":
418418
) from e
419419
error_message = (
420420
"This deepmd-kit package is inconsitent with TensorFlow "
421-
"Runtime, thus an error is raised when loading {}. "
421+
f"Runtime, thus an error is raised when loading {module_name}. "
422422
"You need to rebuild deepmd-kit against this TensorFlow "
423-
"runtime.".format(module_name)
423+
"runtime."
424424
)
425425
if TF_CXX11_ABI_FLAG == 1:
426426
# #1791

deepmd/utils/argcheck.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,8 +1861,8 @@ def normalize_fitting_weight(fitting_keys, data_keys, fitting_weight=None):
18611861
else:
18621862
valid_fitting_keys.remove(item)
18631863
log.warning(
1864-
"Fitting net '{}' has zero or invalid weight "
1865-
"and will not be used in training.".format(item)
1864+
f"Fitting net '{item}' has zero or invalid weight "
1865+
"and will not be used in training."
18661866
)
18671867
new_weight[item] = 0.0
18681868
else:

deepmd/utils/finetune.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def replace_model_params_with_pretrained_model(
5555
if i not in pretrained_type_map:
5656
out_line_type.append(i)
5757
assert not out_line_type, (
58-
"{} type(s) not contained in the pretrained model! "
59-
"Please choose another suitable one.".format(str(out_line_type))
58+
f"{str(out_line_type)} type(s) not contained in the pretrained model! "
59+
"Please choose another suitable one."
6060
)
6161
if cur_type_map != pretrained_type_map:
6262
log.info(

deepmd/utils/multi_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def replace_model_params_with_frz_multi_model(
5454
if i not in pretrained_type_map:
5555
out_line_type.append(i)
5656
assert not out_line_type, (
57-
"{} type(s) not contained in the pretrained model! "
58-
"Please choose another suitable one.".format(str(out_line_type))
57+
f"{str(out_line_type)} type(s) not contained in the pretrained model! "
58+
"Please choose another suitable one."
5959
)
6060
if cur_type_map != pretrained_type_map:
6161
log.info(

source/install/build_tf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def __call__(self):
150150
self.download()
151151
if not self.exists:
152152
raise RuntimeError(
153-
"Download {} from {} failed! "
154-
"You can manually download it to {} and "
155-
"retry the script.".format(self.filename, self.url, str(self.path))
153+
f"Download {self.filename} from {self.url} failed! "
154+
f"You can manually download it to {str(self.path)} and "
155+
"retry the script."
156156
)
157157
self.post_process()
158158

0 commit comments

Comments
 (0)