mailr22667 - in /trunk/specific_analyses: parameter_object.py relax_disp/parameter_object.py


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

Header


Content

Posted by edward on April 09, 2014 - 16:51:
Author: bugman
Date: Wed Apr  9 16:51:38 2014
New Revision: 22667

URL: http://svn.gna.org/viewcvs/relax?rev=22667&view=rev
Log:
Created two new parameter list methods from the relaxation dispersion code.

The add_model_info() and add_peak_intensity() base class methods have been 
created from the
relaxation dispersion code.  These are just aliases for setting up a number 
of parameters via add()
in a standard way.


Modified:
    trunk/specific_analyses/parameter_object.py
    trunk/specific_analyses/relax_disp/parameter_object.py

Modified: trunk/specific_analyses/parameter_object.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/parameter_object.py?rev=22667&r1=22666&r2=22667&view=diff
==============================================================================
--- trunk/specific_analyses/parameter_object.py (original)
+++ trunk/specific_analyses/parameter_object.py Wed Apr  9 16:51:38 2014
@@ -173,6 +173,36 @@
             self.add('warning', scope=scope, desc='Optimisation warning', 
py_type=str, set='min', err=False, sim=True)
 
 
+    def add_model_info(self, scope='spin'):
+        """Add model specific objects 'model' and 'params'.
+
+        This is the equivalent of calling:
+
+            add('params', scope=scope, desc='The parameters of the model', 
py_type=list)
+            add('model', scope=scope, desc='The model', py_type=str)
+
+
+        @keyword scope:         The parameter scope.  This can be set to 
'global' for parameters located within the global scope of the current data 
pipe.  Or set to 'spin' for spin specific parameters.  Alternatively the 
value 'both' indicates that there are both global and specific versions of 
this parameter.
+        @type scope:            str
+        """
+
+        # Add the model variables.
+        self.add('params', scope=scope, desc='The parameters of the model', 
py_type=list)
+        self.add('model', scope=scope, desc='The model name', py_type=str)
+
+
+    def add_peak_intensity(self):
+        """Add the peak intensity structure 'peak_intensity'.
+
+        This is the equivalent of calling:
+
+            add('peak_intensity', scope='spin', desc='The peak intensities', 
py_type=dict, grace_string='\\qPeak intensities\\Q')
+        """
+
+        # Add the peak intensity structure.
+        self.add('peak_intensity', scope='spin', desc='The peak 
intensities', py_type=dict, grace_string='\\qPeak intensities\\Q')
+
+
     def base_loop(self, set=None, scope=None):
         """An iterator method for looping over all the base parameters.
 

Modified: trunk/specific_analyses/relax_disp/parameter_object.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/parameter_object.py?rev=22667&r1=22666&r2=22667&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/parameter_object.py      (original)
+++ trunk/specific_analyses/relax_disp/parameter_object.py      Wed Apr  9 
16:51:38 2014
@@ -39,7 +39,7 @@
         Param_list.__init__(self)
 
         # Add the base data for the 'R2eff' model.
-        self.add('peak_intensity', scope='spin', desc='The peak 
intensities', py_type=dict, grace_string='\\qPeak intensities\\Q')
+        self.add_peak_intensity()
 
         # Add the base information for the dispersion analysis.
         self.add('relax_times', scope='spin', py_type=dict, 
grace_string='\\qRelaxation time period (s)\\Q')
@@ -82,8 +82,7 @@
         self.add('k_BA', scope='spin', default=10000.0, desc='The exchange 
rate from state B to state A', set='params', py_type=float, 
grace_string='\\qk\\sBA\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True)
 
         # Add the model variables.
-        self.add('params', scope='spin', desc='The model parameters', 
py_type=list)
-        self.add('model', scope='spin', desc='The dispersion model', 
py_type=str)
+        self.add_model_info()
 
         # Add the minimisation data.
         self.add_min_data(min_stats_global=False, min_stats_spin=True)




Related Messages


Powered by MHonArc, Updated Wed Apr 09 17:20:01 2014