Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#3236)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 →
v0.2.0](astral-sh/ruff-pre-commit@v0.1.14...v0.2.0)
<!--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 <jinzhe.zeng@rutgers.edu>
(cherry picked from commit 37cdccf)
  • Loading branch information
pre-commit-ci[bot] authored and njzjz committed Apr 6, 2024
1 parent 5d9e627 commit 2ce9c58
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.14
rev: v0.2.0
hooks:
- id: ruff
args: ["--fix"]
Expand Down
5 changes: 4 additions & 1 deletion deepmd/descriptor/loc_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ def prod_force_virial(
tf.summary.histogram("net_derivative", net_deriv)
net_deriv_reshape = tf.reshape(
net_deriv,
[np.cast["int64"](-1), natoms[0] * np.cast["int64"](self.ndescrpt)],
[
np.asarray(-1, dtype=np.int64),
natoms[0] * np.asarray(self.ndescrpt, dtype=np.int64),
],
)
force = op_module.prod_force(
net_deriv_reshape,
Expand Down
5 changes: 4 additions & 1 deletion deepmd/descriptor/se_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,10 @@ def prod_force_virial(
tf.summary.histogram("net_derivative", net_deriv)
net_deriv_reshape = tf.reshape(
net_deriv,
[np.cast["int64"](-1), natoms[0] * np.cast["int64"](self.ndescrpt)],
[
np.asarray(-1, dtype=np.int64),
natoms[0] * np.asarray(self.ndescrpt, dtype=np.int64),
],
)
force = op_module.prod_force_se_a(
net_deriv_reshape,
Expand Down
5 changes: 4 additions & 1 deletion deepmd/descriptor/se_r.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ def prod_force_virial(
tf.summary.histogram("net_derivative", net_deriv)
net_deriv_reshape = tf.reshape(
net_deriv,
[np.cast["int64"](-1), natoms[0] * np.cast["int64"](self.ndescrpt)],
[
np.asarray(-1, dtype=np.int64),
natoms[0] * np.asarray(self.ndescrpt, dtype=np.int64),
],
)
force = op_module.prod_force_se_r(
net_deriv_reshape, self.descrpt_deriv, self.nlist, natoms
Expand Down
5 changes: 4 additions & 1 deletion deepmd/descriptor/se_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,10 @@ def prod_force_virial(
[net_deriv] = tf.gradients(atom_ener, self.descrpt_reshape)
net_deriv_reshape = tf.reshape(
net_deriv,
[np.cast["int64"](-1), natoms[0] * np.cast["int64"](self.ndescrpt)],
[
np.asarray(-1, dtype=np.int64),
natoms[0] * np.asarray(self.ndescrpt, dtype=np.int64),
],
)
force = op_module.prod_force_se_a(
net_deriv_reshape,
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ignore = "D413, D416, D203, D107, D213"
profile = "black"
force_grid_wrap = 1

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # errors
"F", # pyflakes
Expand Down Expand Up @@ -250,7 +250,7 @@ ignore = [
]
ignore-init-module-imports = true

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.pytest.ini_options]
Expand Down

0 comments on commit 2ce9c58

Please sign in to comment.