From 2b1f81ba574b0dfbec6db331d39580580bde36f6 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 16 Mar 2022 03:33:35 -0400 Subject: [PATCH] add default cells when loading hdf5 data Now dpdata requires cells even in nopbc data. --- dpdata/deepmd/hdf5.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dpdata/deepmd/hdf5.py b/dpdata/deepmd/hdf5.py index 5b6239580..4b2486ba8 100644 --- a/dpdata/deepmd/hdf5.py +++ b/dpdata/deepmd/hdf5.py @@ -77,6 +77,9 @@ def to_system_data(f: h5py.File, if len(all_data) > 0 : data[dt] = np.concatenate(all_data, axis = 0) + if 'cells' not in data: + nframes = data['coords'].shape[0] + data['cells'] = np.zeros((nframes, 3, 3)) return data def dump(f: h5py.File,