mailr16512 - in /branches/uf_redesign/specific_fns: api_base.py model_free/main.py model_free/results.py


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

Header


Content

Posted by edward on May 29, 2012 - 16:00:
Author: bugman
Date: Tue May 29 16:00:37 2012
New Revision: 16512

URL: http://svn.gna.org/viewcvs/relax?rev=16512&view=rev
Log:
The specific API data_names() method now accepts the 'scope' argument.

This is used to differentiate global verses spin parameters.


Modified:
    branches/uf_redesign/specific_fns/api_base.py
    branches/uf_redesign/specific_fns/model_free/main.py
    branches/uf_redesign/specific_fns/model_free/results.py

Modified: branches/uf_redesign/specific_fns/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/api_base.py?rev=16512&r1=16511&r2=16512&view=diff
==============================================================================
--- branches/uf_redesign/specific_fns/api_base.py (original)
+++ branches/uf_redesign/specific_fns/api_base.py Tue May 29 16:00:37 2012
@@ -140,11 +140,13 @@
         raise RelaxImplementError('data_init')
 
 
-    def data_names(self, set='all', error_names=False, sim_names=False):
+    def data_names(self, set='all', scope=None, error_names=False, 
sim_names=False):
         """Return a list of names of data structures.
 
         @keyword set:           The set of object names to return.  This can 
be set to 'all' for all names, to 'generic' for generic object names, 
'params' for analysis specific parameter names, or to 'min' for minimisation 
specific object names.
         @type set:              str
+        @keyword scope:         The scope of the parameter to return.  If 
not set, then all will be returned.  If set to 'global' or 'spin', then only 
the parameters within that scope will be returned.
+        @type scope:            str or None
         @keyword error_names:   A flag which if True will add the error 
object names as well.
         @type error_names:      bool
         @keyword sim_names:     A flag which if True will add the Monte 
Carlo simulation object names as well.
@@ -157,7 +159,7 @@
         names = []
 
         # Loop over the parameters.
-        for name in self.PARAMS.loop(set=set, error_names=error_names, 
sim_names=sim_names):
+        for name in self.PARAMS.loop(set=set, scope=scope, 
error_names=error_names, sim_names=sim_names):
             names.append(name)
 
         # Return the names.

Modified: branches/uf_redesign/specific_fns/model_free/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/model_free/main.py?rev=16512&r1=16511&r2=16512&view=diff
==============================================================================
--- branches/uf_redesign/specific_fns/model_free/main.py (original)
+++ branches/uf_redesign/specific_fns/model_free/main.py Tue May 29 16:00:37 
2012
@@ -667,7 +667,7 @@
             raise RelaxNoSequenceError
 
         # Get all data structure names.
-        names = self.data_names()
+        names = self.data_names(scope='spin')
 
         # Loop over the spins.
         for spin in spin_loop():
@@ -1217,7 +1217,7 @@
         """
 
         # Get the data names.
-        data_names = self.data_names()
+        data_names = self.data_names(scope='spin')
 
         # Loop over the data structure names.
         for name in data_names:
@@ -2022,7 +2022,7 @@
         model_type = self._determine_model_type()
 
         # Get the parameter object names.
-        param_names = self.data_names(set='params')
+        param_names = self.data_names(set='params', scope='spin')
 
 
         # Diffusion tensor parameter errors.
@@ -2157,8 +2157,8 @@
             obj_name = self.return_data_name(mf_params[i])
 
             # Check if it is a model-free parameter.
-            if obj_name not in self.data_names(set='params') and obj_name 
not in self.data_names(set='generic'):
-                raise RelaxError("The parameter '%s' is unknown.  It should 
be one of %s or %s" % (mf_params[i], self.data_names(set='params'), 
self.data_names(set='generic')))
+            if obj_name not in self.data_names(set='params', scope='spin') 
and obj_name not in self.data_names(set='generic', scope='spin'):
+                raise RelaxError("The parameter '%s' is unknown.  It should 
be one of %s or %s" % (mf_params[i], self.data_names(set='params', 
scope='spin'), self.data_names(set='generic', scope='spin')))
 
             # Set the parameter.
             for spin in spin_loop(spin_id):
@@ -2224,10 +2224,10 @@
         model_type = self._determine_model_type()
 
         # Get the parameter object names.
-        param_names = self.data_names(set='params')
+        param_names = self.data_names(set='params', scope='spin')
 
         # Get the minimisation statistic object names.
-        min_names = self.data_names(set='min')
+        min_names = self.data_names(set='min', scope='spin')
 
         # List of diffusion tensor parameters.
         if model_type == 'diff' or model_type == 'all':
@@ -2413,7 +2413,7 @@
         model_type = self._determine_model_type()
 
         # Get the parameter object names.
-        param_names = self.data_names(set='params')
+        param_names = self.data_names(set='params', scope='spin')
 
 
         # Diffusion tensor parameters.

Modified: branches/uf_redesign/specific_fns/model_free/results.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/model_free/results.py?rev=16512&r1=16511&r2=16512&view=diff
==============================================================================
--- branches/uf_redesign/specific_fns/model_free/results.py (original)
+++ branches/uf_redesign/specific_fns/model_free/results.py Tue May 29 
16:00:37 2012
@@ -404,10 +404,10 @@
         # Construct the simulation data structures.
         if data_set == 'sim_0':
             # Get the parameter object names.
-            param_names = self.data_names(set='params')
+            param_names = self.data_names(set='params', scope='spin')
 
             # Get the minimisation statistic object names.
-            min_names = self.data_names(set='min')
+            min_names = self.data_names(set='min', scope='spin')
 
             # Loop over all the parameter names.
             for object_name in param_names:




Related Messages


Powered by MHonArc, Updated Tue May 29 16:20:02 2012