Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 7, 2024
1 parent b261abc commit b81ec36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions deepmd/pt/model/task/polarizability.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
to_numpy_array,
)
from deepmd.utils.out_stat import (

Check warning on line 29 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L29

Added line #L29 was not covered by tests
compute_stats_from_redu,
compute_stats_from_atomic,
compute_stats_from_redu,
)
from deepmd.utils.path import (
DPPath,
Expand Down Expand Up @@ -208,8 +208,7 @@ def compute_output_stats(

if sampled[sys]["find_atomic_polarizability"] > 0.0:
sys_atom_polar = compute_stats_from_atomic(

Check warning on line 210 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L209-L210

Added lines #L209 - L210 were not covered by tests
sampled[sys]["atomic_polarizability"],
sampled[sys]["type"]
sampled[sys]["atomic_polarizability"], sampled[sys]["type"]
)[0]
else:
if not sampled[sys]["find_polarizability"] > 0.0:
Expand All @@ -218,7 +217,7 @@ def compute_output_stats(
for itype in range(self.ntypes):
type_mask = sampled[sys]["type"] == itype
sys_type_count[:, itype] = type_mask.sum(dim=1)

Check warning on line 219 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L214-L219

Added lines #L214 - L219 were not covered by tests

sys_bias_redu = sampled[sys]["polarizability"]

Check warning on line 221 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L221

Added line #L221 was not covered by tests

sys_atom_polar = compute_stats_from_redu(

Check warning on line 223 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L223

Added line #L223 was not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion deepmd/tf/fit/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def compute_output_stats(self, all_stat):
polar_bias.append(
np.sum(
all_stat["atomic_polarizability"][ss][:, index_lis, :],
axis=(0,1),
axis=(0, 1),
).reshape((1, 9))
)
else: # No atomic polar in this system, so it should have global polar
Expand Down

0 comments on commit b81ec36

Please sign in to comment.