mailr6453 - /1.3/specific_fns/model_free/main.py


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

Header


Content

Posted by edward on June 23, 2008 - 22:24:
Author: bugman
Date: Mon Jun 23 22:24:12 2008
New Revision: 6453

URL: http://svn.gna.org/viewcvs/relax?rev=6453&view=rev
Log:
Updated the return_units() method to accept the spin arg.


Modified:
    1.3/specific_fns/model_free/main.py

Modified: 1.3/specific_fns/model_free/main.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/model_free/main.py?rev=6453&r1=6452&r2=6453&view=diff
==============================================================================
--- 1.3/specific_fns/model_free/main.py (original)
+++ 1.3/specific_fns/model_free/main.py Mon Jun 23 22:24:12 2008
@@ -2043,7 +2043,7 @@
             return '\\qCSA\\Q'
 
 
-    def return_units(self, param, spin_id):
+    def return_units(self, param, spin=None, spin_id=None):
         """Function for returning a string representing the parameters units.
 
         For example, the internal representation of te is in seconds, 
whereas the external
@@ -2053,14 +2053,21 @@
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @param spin_id: The spin identification string.
+        @param spin:    The spin container.
+        @type spin:     SpinContainer instance
+        @param spin_id: The spin identification string (ignored if the spin 
container is supplied).
         @type spin_id:  str
         @return:        The parameter units string.
         @rtype:         str
         """
 
+        # The spin must be specified to get frequency units.
+        if spin == None and spin_id == None:
+            raise RelaxNoSpinSpecError
+
         # Get the spin.
-        spin = return_spin(spin_id)
+        if not spin:
+            spin = return_spin(spin_id)
 
         # Get the object name.
         object_name = self.return_data_name(param)




Related Messages


Powered by MHonArc, Updated Mon Jun 23 22:40:22 2008