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 29, 2024
1 parent 88456a9 commit 49beb1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ def compute_output_stats(
rcond: Optional[float] = None,
atom_ener: Optional[List[float]] = None,
model_forward: Optional[Callable[..., torch.Tensor]] = None,

):
key_mapping = {

Check warning on line 92 in deepmd/pt/utils/stat.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/utils/stat.py#L92

Added line #L92 was not covered by tests
"polar":"polarizability",
"polar": "polarizability",
"energy": "energy",
"dos": "dos",
"dipole": "dipole",
Expand Down Expand Up @@ -288,7 +287,6 @@ def compute_output_stats_with_atomic(
which will be subtracted from the energy label of the data.
The difference will then be used to calculate the delta complement energy bias for each type.
"""

atomic_label_name, global_label_name = "atom_" + key, key

Check warning on line 290 in deepmd/pt/utils/stat.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/utils/stat.py#L290

Added line #L290 was not covered by tests

if stat_file_path is not None:
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pt/model/test_polar_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def test_atomic_consistency(self):

def test_global_consistency(self):
self.sampled[0]["find_atom_polarizability"] = -1
self.sampled[0]["polarizability"] = self.sampled[0][
"atom_polarizability"
].sum(dim=1)
self.sampled[0]["polarizability"] = self.sampled[0]["atom_polarizability"].sum(
dim=1
)
self.all_stat["find_atom_polarizability"] = [-1]
self.all_stat["polarizability"] = [
self.all_stat["atom_polarizability"][0].sum(axis=1)
Expand Down

0 comments on commit 49beb1b

Please sign in to comment.