mailr15180 - in /branches/spec_api: generic_fns/ opendx/ specific_fns/ specific_fns/model_free/ specific_fns/noe/


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

Header


Content

Posted by edward on January 18, 2012 - 18:15:
Author: bugman
Date: Wed Jan 18 18:15:26 2012
New Revision: 15180

URL: http://svn.gna.org/viewcvs/relax?rev=15180&view=rev
Log:
Removed the spin and spin_id args from the specific API return_units() method.

This was needed for the model-free Rex parameter where the first field 
strength was part of the
units.  This has been replaced by the first global frequency value.


Modified:
    branches/spec_api/generic_fns/diffusion_tensor.py
    branches/spec_api/generic_fns/minimise.py
    branches/spec_api/opendx/base_map.py
    branches/spec_api/specific_fns/api_base.py
    branches/spec_api/specific_fns/frame_order.py
    branches/spec_api/specific_fns/model_free/main.py
    branches/spec_api/specific_fns/n_state_model.py
    branches/spec_api/specific_fns/noe/main.py
    branches/spec_api/specific_fns/relax_fit.py

Modified: branches/spec_api/generic_fns/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/generic_fns/diffusion_tensor.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/generic_fns/diffusion_tensor.py (original)
+++ branches/spec_api/generic_fns/diffusion_tensor.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -1112,7 +1112,7 @@
     return Dx, Dy, Dz
 
 
-def return_units(param, spin_id=None):
+def return_units(param):
     """Function for returning a string representing the parameters units.
 
     For example, the internal representation of tm is in seconds, whereas 
the external
@@ -1122,8 +1122,6 @@
 
     @param param:       The name of the parameter to return the units for.
     @type param:        str
-    @keyword spin_id:   The spin identification string.  This arg is unused.
-    @type spin_id:      None or str
     @return:            The parameter units string.
     @rtype:             str
     """

Modified: branches/spec_api/generic_fns/minimise.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/generic_fns/minimise.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/generic_fns/minimise.py (original)
+++ branches/spec_api/generic_fns/minimise.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -395,13 +395,11 @@
     return grace_string
 
 
-def return_units(stat_type, spin_id=None):
+def return_units(stat_type):
     """Dummy function which returns None as the stats have no units.
 
     @param stat_type:   The name of the statistic.  This is unused!
     @type stat_type:    str
-    @keyword spin_id:   Not used.
-    @type spin_id:      None
     @return:            Nothing.
     @rtype:             None
     """

Modified: branches/spec_api/opendx/base_map.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/opendx/base_map.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/opendx/base_map.py (original)
+++ branches/spec_api/opendx/base_map.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2005, 2007-2009 Edward d'Auvergne                       
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -321,7 +321,7 @@
             factor = self.return_conversion_factor[i](self.param_names[i], 
spin_id=self.spin_id)
 
             # Parameter units.
-            units = self.return_units[i](self.param_names[i], 
spin_id=self.spin_id)
+            units = self.return_units[i](self.param_names[i])
 
             # Labels.
             if units:

Modified: branches/spec_api/specific_fns/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/api_base.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/api_base.py (original)
+++ branches/spec_api/specific_fns/api_base.py Wed Jan 18 18:15:26 2012
@@ -576,15 +576,11 @@
         raise RelaxImplementError
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Return a string representing the parameters units.
 
         @param param:       The name of the parameter to return the units 
string for.
         @type param:        str
-        @keyword spin:      The spin container.
-        @type spin:         SpinContainer instance
-        @keyword spin_id:   The spin identification string (ignored if the 
spin container is supplied).
-        @type spin_id:      str
         @return:            The parameter units string.
         @rtype:             str
         """

Modified: branches/spec_api/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/frame_order.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/frame_order.py (original)
+++ branches/spec_api/specific_fns/frame_order.py Wed Jan 18 18:15:26 2012
@@ -1375,15 +1375,11 @@
         return red_tensor_err
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Return a string representing the parameters units.
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @param spin:    The spin container (unused).
-        @type spin:     None
-        @param spin_id: The spin identification string (unused).
-        @type spin_id:  None
         @return:        The parameter units string.
         @rtype:         str
         """

Modified: branches/spec_api/specific_fns/model_free/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/model_free/main.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/model_free/main.py (original)
+++ branches/spec_api/specific_fns/model_free/main.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -2368,7 +2368,7 @@
             return '\\qCSA\\Q'
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Return a string representing the parameters units.
 
         For example, the internal representation of te is in seconds, 
whereas the external representation is in picoseconds, therefore this 
function will return the string 'picoseconds' for te.
@@ -2376,26 +2376,12 @@
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @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
         """
 
         # Get the object name.
         object_name = self.return_data_name(param)
-
-        # Test for objects needing the spin container.
-        if object_name in ['rex']:
-            # The spin must be specified to get frequency units.
-            if spin == None and spin_id == None:
-                raise RelaxNoSpinSpecError
-
-            # Get the spin.
-            if not spin:
-                spin = return_spin(spin_id)
 
         # tm (nanoseconds).
         if object_name == 'tm' or object_name == 'local_tm':
@@ -2406,8 +2392,8 @@
             return 'ps'
 
         # Rex (value at 1st field strength).
-        elif object_name == 'rex' and hasattr(spin, 'frq_labels') and 
spin.frq_labels != None and len(spin.frq_labels):
-            return spin.frq_labels[0] + ' MHz'
+        elif object_name == 'rex' and hasattr(cdp, 'frq_labels') and 
cdp.frq_labels != None and len(cdp.frq_labels):
+            return cdp.frq_labels[0] + ' MHz'
 
         # Bond length (Angstrom).
         elif object_name == 'r':

Modified: branches/spec_api/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/n_state_model.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/n_state_model.py (original)
+++ branches/spec_api/specific_fns/n_state_model.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -2357,15 +2357,11 @@
             return "Back-calculated RDC"
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Return a string representing the parameters units.
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @param spin:    The spin container (unused).
-        @type spin:     None
-        @param spin_id: The spin identification string (unused).
-        @type spin_id:  None
         @return:        The parameter units string.
         @rtype:         str
         """

Modified: branches/spec_api/specific_fns/noe/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/noe/main.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/noe/main.py (original)
+++ branches/spec_api/specific_fns/noe/main.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2004-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2004-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -322,15 +322,11 @@
         return param
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Dummy function which returns None as the stats have no units.
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @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:        Nothing.
         @rtype:         None
         """

Modified: branches/spec_api/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/relax_fit.py?rev=15180&r1=15179&r2=15180&view=diff
==============================================================================
--- branches/spec_api/specific_fns/relax_fit.py (original)
+++ branches/spec_api/specific_fns/relax_fit.py Wed Jan 18 18:15:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2004-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2004-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -1028,15 +1028,11 @@
         return grace_string
 
 
-    def return_units(self, param, spin=None, spin_id=None):
+    def return_units(self, param):
         """Dummy method which returns None as the stats have no units.
 
         @param param:   The name of the parameter to return the units string 
for.
         @type param:    str
-        @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:        Nothing.
         @rtype:         None
         """




Related Messages


Powered by MHonArc, Updated Thu Jan 19 09:40:02 2012