dpdata
dpdata copied to clipboard
[BUG] Unable to handle incomplete trajectories
Bug summary
Here are really two issues.
- If I have a lammps/dump file that has some incomplete frames or it contains some comment lines starting with "#", dpdata.System() will throw an ValueError exception:
ValueError: invalid literal for int() with base 10: '#####'
. It might be better if it can either throw a more meaningful exception, or it can report a warning and still able to read in the frames and mark the incorrect frame as nan.
-
It seems
dpdata.System()
cannot read in velocities in the lammps dump file. -
Another minor feature request: can we add an option to choose not to reorder the atom indices? i.e., dpdata.System( reorder = False).
dpdata Version
v0.2.17 Latest on Oct
Input Files, Running Commands, Error Log, etc.
Python code:
import dpdata
# 1. Load input data file
# I attached a lammps dump file with the last frame incomplete. [traj.txt](https://github.com/deepmodeling/dpdata/files/14617582/traj.txt)
in_file= "traj.txt"
d_conf = dpdata.System(in_file, fmt="lammps/dump")
Steps to Reproduce
Run the above python codes.
Further Information, Files, and Links
No response