From 63b347db0b224a30784a946e4e78534973261109 Mon Sep 17 00:00:00 2001 From: root <2000011006@stu.pku.edu.cn> Date: Wed, 30 Oct 2024 15:22:08 +0800 Subject: [PATCH 1/3] change tmap to all head --- deepmd/entrypoints/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index d9ccf392f5..fd0393c914 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -124,7 +124,7 @@ def test( log.info(f"# testing system : {system}") # create data class - tmap = dp.get_type_map() if isinstance(dp, DeepPot) else None + tmap = dp.get_type_map() data = DeepmdData( system, set_prefix="set", From 16bd291cde48ad593ad3273d40163eae51a4b02d Mon Sep 17 00:00:00 2001 From: root <2000011006@stu.pku.edu.cn> Date: Wed, 30 Oct 2024 17:07:48 +0800 Subject: [PATCH 2/3] Modify UT --- source/tests/pt/test_dp_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/source/tests/pt/test_dp_test.py b/source/tests/pt/test_dp_test.py index c18c3286f6..79cc97780b 100644 --- a/source/tests/pt/test_dp_test.py +++ b/source/tests/pt/test_dp_test.py @@ -152,6 +152,7 @@ def setUp(self): self.config["training"]["training_data"]["systems"] = data_file self.config["training"]["validation_data"]["systems"] = data_file self.config["model"] = deepcopy(model_property) + self.config["model"]["type_map"] = [self.config["model"]["type_map"][i] for i in [1,0,3,2]] self.input_json = "test_dp_test_property.json" with open(self.input_json, "w") as fp: json.dump(self.config, fp, indent=4) From fa886f7280ad609da08b32b158d6fd7d33086deb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:10:42 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/tests/pt/test_dp_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/tests/pt/test_dp_test.py b/source/tests/pt/test_dp_test.py index 79cc97780b..0427f2b14a 100644 --- a/source/tests/pt/test_dp_test.py +++ b/source/tests/pt/test_dp_test.py @@ -152,7 +152,9 @@ def setUp(self): self.config["training"]["training_data"]["systems"] = data_file self.config["training"]["validation_data"]["systems"] = data_file self.config["model"] = deepcopy(model_property) - self.config["model"]["type_map"] = [self.config["model"]["type_map"][i] for i in [1,0,3,2]] + self.config["model"]["type_map"] = [ + self.config["model"]["type_map"][i] for i in [1, 0, 3, 2] + ] self.input_json = "test_dp_test_property.json" with open(self.input_json, "w") as fp: json.dump(self.config, fp, indent=4)