Skip to content

Commit 53c1af0

Browse files
authored
add default cells when loading hdf5 data (#262)
Now dpdata requires cells even in nopbc data.
1 parent 3821c90 commit 53c1af0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpdata/deepmd/hdf5.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def to_system_data(f: h5py.File,
7777

7878
if len(all_data) > 0 :
7979
data[dt] = np.concatenate(all_data, axis = 0)
80+
if 'cells' not in data:
81+
nframes = data['coords'].shape[0]
82+
data['cells'] = np.zeros((nframes, 3, 3))
8083
return data
8184

8285
def dump(f: h5py.File,

0 commit comments

Comments
 (0)