Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.box = boxdims
if triclinic:
#we have to input rotation matrix and the inverse rotation matrix
rot = box.T
rotinv = np.linalg.inv(rot)
self.assign_triclinic_params(rot, rotinv)
else:
raise IOError("input file %s not found"%filename)
#now remove filenames
for file in filenames:
os.remove(file)
elif 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:
rot = box.T
rotinv = np.linalg.inv(rot)
self.assign_triclinic_params(rot, rotinv)
else:
raise IOError("input file %s not found"%filename)
elif format == 'poscar':
if os.path.exists(filename):
atoms, boxdims = ptp.read_poscar(filename, compressed=compressed)
self.atoms = atoms
self.box = boxdims
#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
rotinv = np.linalg.inv(rot)
self.assign_triclinic_params(rot, rotinv)
else:
raise IOError("input file %s not found"%filename)
#now remove filenames
for file in filenames:
os.remove(file)
elif os.path.exists(filename):