How to use the pyscal.traj_process.read_poscar function in pyscal

To help you get started, we’ve selected a few pyscal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github srmnitc / pyscal / src / pyscal / core.py View on Github external
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
            else:
                raise IOError("input file %s not found"%filename)
        else:
            raise TypeError("format recieved an unknown option %s"%format)