From 5d20741b204ed0bd9a2ea0499afe5a90f636324b Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 21 May 2022 19:12:06 -0400 Subject: [PATCH] fix DP driver energy shape The shape of energies should be (nframes,) instead of (nframes, 1) --- dpdata/plugins/deepmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 2798d78ae..d07745887 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -163,7 +163,7 @@ def label(self, data: dict) -> dict: cell = None e, f, v = self.dp.eval(coord, cell, atype) data = ss.data - data['energies'] = e.reshape((1, 1)) + data['energies'] = e.reshape((1,)) data['forces'] = f.reshape((1, ss.get_natoms(), 3)) data['virials'] = v.reshape((1, 3, 3)) this_sys = dpdata.LabeledSystem.from_dict({'data': data}) @@ -178,7 +178,7 @@ def label(self, data: dict) -> dict: cell = None e, f, v = self.dp.eval(coord, cell, atype) data = ori_sys.data.copy() - data['energies'] = e.reshape((ori_sys.get_nframes(), 1)) + data['energies'] = e.reshape((ori_sys.get_nframes(),)) data['forces'] = f.reshape((ori_sys.get_nframes(), ori_sys.get_natoms(), 3)) data['virials'] = v.reshape((ori_sys.get_nframes(), 3, 3)) return data