diff --git a/deepmd/common.py b/deepmd/common.py index 92fd55e762..32648e7918 100644 --- a/deepmd/common.py +++ b/deepmd/common.py @@ -126,7 +126,7 @@ def add_data_requirement( # standardize key if "atomic_" in key: key = key.replace("atomic_", "atom_") - + data_requirement[key] = { "ndof": ndof, "atomic": atomic, diff --git a/deepmd/utils/data.py b/deepmd/utils/data.py index d9ab246b27..f9b2c34900 100644 --- a/deepmd/utils/data.py +++ b/deepmd/utils/data.py @@ -180,7 +180,7 @@ def add( # standardize key if "atomic_" in key: key = key.replace("atomic_", "atom_") - + self.data_dict[key] = { "ndof": ndof, "atomic": atomic, diff --git a/source/tests/pt/model/test_polar_stat.py b/source/tests/pt/model/test_polar_stat.py index d3f6334182..052163b60c 100644 --- a/source/tests/pt/model/test_polar_stat.py +++ b/source/tests/pt/model/test_polar_stat.py @@ -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)