Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
files: \.py$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.282
rev: v0.0.284
hooks:
- id: ruff
args: ["--fix"]
Expand Down Expand Up @@ -72,7 +72,7 @@ repos:
#- id: cmake-lint
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.3
rev: v1.5.4
hooks:
# C++, js
- id: insert-license
Expand Down
2 changes: 1 addition & 1 deletion deepmd/entrypoints/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def get_min_nbor_dist(jdata, rcut):


def parse_auto_sel(sel):
if type(sel) is not str:
if not isinstance(sel, str):
return False
words = sel.split(":")
if words[0] == "auto":
Expand Down
4 changes: 2 additions & 2 deletions deepmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ def get_module(module_name: str) -> "ModuleType":
) from e
error_message = (
"This deepmd-kit package is inconsitent with TensorFlow "
"Runtime, thus an error is raised when loading {}. "
f"Runtime, thus an error is raised when loading {module_name}. "
"You need to rebuild deepmd-kit against this TensorFlow "
"runtime.".format(module_name)
"runtime."
)
if TF_CXX11_ABI_FLAG == 1:
# #1791
Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/argcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,8 +1861,8 @@ def normalize_fitting_weight(fitting_keys, data_keys, fitting_weight=None):
else:
valid_fitting_keys.remove(item)
log.warning(
"Fitting net '{}' has zero or invalid weight "
"and will not be used in training.".format(item)
f"Fitting net '{item}' has zero or invalid weight "
"and will not be used in training."
)
new_weight[item] = 0.0
else:
Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def replace_model_params_with_pretrained_model(
if i not in pretrained_type_map:
out_line_type.append(i)
assert not out_line_type, (
"{} type(s) not contained in the pretrained model! "
"Please choose another suitable one.".format(str(out_line_type))
f"{str(out_line_type)} type(s) not contained in the pretrained model! "
"Please choose another suitable one."
)
if cur_type_map != pretrained_type_map:
log.info(
Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/multi_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def replace_model_params_with_frz_multi_model(
if i not in pretrained_type_map:
out_line_type.append(i)
assert not out_line_type, (
"{} type(s) not contained in the pretrained model! "
"Please choose another suitable one.".format(str(out_line_type))
f"{str(out_line_type)} type(s) not contained in the pretrained model! "
"Please choose another suitable one."
)
if cur_type_map != pretrained_type_map:
log.info(
Expand Down
6 changes: 3 additions & 3 deletions source/install/build_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def __call__(self):
self.download()
if not self.exists:
raise RuntimeError(
"Download {} from {} failed! "
"You can manually download it to {} and "
"retry the script.".format(self.filename, self.url, str(self.path))
f"Download {self.filename} from {self.url} failed! "
f"You can manually download it to {str(self.path)} and "
"retry the script."
)
self.post_process()

Expand Down