Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)