Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
If `custom_keys` are provided, this extra information is read in from input files if
available. This information is not passed to the C++ instance of atom, and is stored
as a dictionary. It can be accessed directly as `atom.custom['customval']`
"""
if customkeys == None:
customkeys = []
if format == 'lammps-dump':
#check customkeys and assign a variable
customread = (len(customkeys) > 0)
if frame != -1:
#split the traj and returns set of filenames
filenames = ptp.split_traj_lammps_dump(filename, compressed=compressed)
#reassign filename
try:
filename = filenames[frame]
except:
raise IOError("frame %d is not found in the trajectory"%frame)
#now if file exists
if os.path.exists(filename):
atoms, boxdims, box, triclinic = ptp.read_lammps_dump(filename, compressed=compressed, check_triclinic=True, box_vectors=True, customkeys=customkeys)
self.atoms = atoms
self.box = boxdims
if triclinic:
#we have to input rotation matrix and the inverse rotation matrix
rot = box.T