ensemble.setAtoms(atoms)
if isPDBEnsemble:
confs = attr_dict["_confs"]
ensemble.addCoordset(attr_dict["_confs"], weights)
if "_identifiers" in attr_dict.files:
ensemble._labels = list(attr_dict["_identifiers"])
if "_labels" in attr_dict.files:
After Change
Returns ensemble instance loaded from *filename*. This function makes
use of :func:`numpy.load` function. See also :func:`saveEnsemble`
attr_dict = np.load(filename)
if "_weights" in attr_dict:
weights = attr_dict["_weights"]
else:
weights = None
isPDBEnsemble = False
try:
title = str(attr_dict["_title"])
except KeyError:
title = str(attr_dict["_name"])
if weights is not None and weights.ndim == 3:
isPDBEnsemble = True
ensemble = PDBEnsemble(title)
else:
ensemble = Ensemble(title)
ensemble.setCoords(attr_dict["_coords"])
if "_atoms" in attr_dict:
atoms = attr_dict["_atoms"][0]
else:
atoms = None
ensemble.setAtoms(atoms)
if "_indices" in attr_dict:
indices = attr_dict["_indices"]
else:
indices = None
ensemble._indices = indices
if isPDBEnsemble:
confs = attr_dict["_confs"]
ensemble.addCoordset(confs, weights)