Author: bugman
Date: Mon Sep 22 10:29:55 2014
New Revision: 25945
URL: http://svn.gna.org/viewcvs/relax?rev=25945&view=rev
Log:
Implemented the internal structural object collapse_ensemble() method.
This allows the Structure.test_collapse_ensemble system test to pass.
Modified:
trunk/lib/structure/internal/object.py
Modified: trunk/lib/structure/internal/object.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=25945&r1=25944&r2=25945&view=diff
==============================================================================
--- trunk/lib/structure/internal/object.py (original)
+++ trunk/lib/structure/internal/object.py Mon Sep 22 10:29:55 2014
@@ -1485,6 +1485,29 @@
return data
+ def collapse_ensemble(self, model_num=None, model_to=1):
+ """Collapse the ensemble into a single model.
+
+ @keyword model_num: The number of the model to keep. All other models
will be removed.
+ @type model_num: int
+ @keyword model_to: The model number for the sole remaining model.
+ @type model_to: int
+ """
+
+ # Store all the model numbers.
+ models = []
+ for model_cont in self.model_loop():
+ if model_cont.num != model_num:
+ models.append(model_cont.num)
+
+ # Delete all models.
+ for model in models:
+ self.delete(model)
+
+ # Renumber the remaining model.
+ self.set_model(model_orig=model_num, model_new=model_to)
+
+
def connect_atom(self, mol_name=None, index1=None, index2=None):
"""Connect two atoms in the structural data object.
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits