How to use the pyscal.pickle_object.unpickle_atom 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
Examples
        --------

        >>> sys = System()
        >>> sys.from_pickle(filename)

        """
        if os.path.exists(file):
            psys = np.load(file, allow_pickle=True).flatten()[0]
        else:
            raise IOError("file does not exist")
        #set up indicators
        self.set_indicators(psys.indicators)
        #unpickle atoms
        self.atoms = [pp.unpickle_atom(atom) for atom in psys.atoms]
        self.box = psys.box


        #if triclinic, get those
        if psys.indicators[6] == 1:
            rot = psys.rot
            rotinv = np.linalg.inv(rot)
            self.assign_triclinic_params(rot, rotinv)