Skip to content

Commit 18613d6

Browse files
wankiwinjzjzpre-commit-ci[bot]
authored
fix restart trajectory for merge_traj (#1111)
When turning on the merge_traj function, if the procedure is interrupted in the run_model_devi stage, the old trajectory file will be overwritten after it is rerun. The incomplete trajectory file will cause the following error in the next post_model_devi stage: `.../site-packages/dpdata/lammps/dump.py:176: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. system['coords'] = np.array(system['coords']) DeepModeling ` This PR repaired this question. --------- Signed-off-by: kiwi <46419582+wankiwi@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1aafd33 commit 18613d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dpgen/generator/lib/lammps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def make_lammps_input(
108108
model_devi_merge_traj = jdata.get("model_devi_merge_traj", False)
109109
if model_devi_merge_traj is True:
110110
ret += "dump 1 all custom ${DUMP_FREQ} all.lammpstrj id type x y z fx fy fz\n"
111+
ret += 'if "${restart} > 0" then "dump_modify 1 append yes"\n'
111112
else:
112113
ret += "dump 1 all custom ${DUMP_FREQ} traj/*.lammpstrj id type x y z fx fy fz\n"
113114
ret += "restart 10000 dpgen.restart\n"

0 commit comments

Comments
 (0)