mailr7236 - /1.3/specific_fns/base_class.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 24, 2008 - 14:47:
Author: bugman
Date: Wed Sep 24 14:47:48 2008
New Revision: 7236

URL: http://svn.gna.org/viewcvs/relax?rev=7236&view=rev
Log:
Created the specific base class method model_loop().

This defaults to one model per spin system, and can be used by most analysis 
types.


Modified:
    1.3/specific_fns/base_class.py

Modified: 1.3/specific_fns/base_class.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/base_class.py?rev=7236&r1=7235&r2=7236&view=diff
==============================================================================
--- 1.3/specific_fns/base_class.py (original)
+++ 1.3/specific_fns/base_class.py Wed Sep 24 14:47:48 2008
@@ -109,6 +109,28 @@
 
         # Return the default of True.
         return True
+
+
+    def model_loop(self):
+        """Default generator method for looping over the models.
+
+        In this case only a single model per spin system is assumed.  Hence 
the yielded data is the
+        spin ID string.
+
+
+        @return:    Information about the model which for this analysis is 
the spin identification
+                    string.
+        @rtype:     str
+        """
+
+        # Loop over the sequence.
+        for spin, spin_id in spin_loop(return_id=True):
+            # Skip deselected spins.
+            if not spin.select:
+                continue
+
+            # Yield the spin ID string.
+            yield spin_id
 
 
     def num_instances(self):




Related Messages


Powered by MHonArc, Updated Wed Sep 24 15:00:05 2008