From 511b38418e987d9b28f7a8cf04145a2748c30834 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 17 May 2023 14:44:05 -0400 Subject: [PATCH] keep atom types when using DP models Before this PR, when using DP models to predict energies and forces, the atom types were changed according to the type map in the model. This is not an expected behavior. --- dpdata/plugins/deepmd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 38eab85fd..51fd4667a 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -394,8 +394,10 @@ def label(self, data: dict) -> dict: type_map = self.dp.get_type_map() ori_sys = dpdata.System.from_dict({"data": data}) + ori_sys_copy = ori_sys.copy() ori_sys.sort_atom_names(type_map=type_map) atype = ori_sys["atom_types"] + ori_sys = ori_sys_copy if not self.enable_auto_batch_size: labeled_sys = dpdata.LabeledSystem()