dpdata icon indicating copy to clipboard operation
dpdata copied to clipboard

[BUG] Unable to handle incomplete trajectories

Open nbzy1995 opened this issue 11 months ago • 0 comments

Bug summary

Here are really two issues.

  1. 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.

  1. It seems dpdata.System() cannot read in velocities in the lammps dump file.

  2. 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

nbzy1995 avatar Mar 15 '24 15:03 nbzy1995