mailr22699 - in /trunk: pipe_control/ specific_analyses/ specific_analyses/model_free/ user_functions/


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

Header


Content

Posted by edward on April 10, 2014 - 19:41:
Author: bugman
Date: Thu Apr 10 19:41:09 2014
New Revision: 22699

URL: http://svn.gna.org/viewcvs/relax?rev=22699&view=rev
Log:
Expansion of the value.set user function to handle list-type data.

The value.set user function can now handle parameters which consist of lists 
of values.  The index
argument has been added to allow the index of the list to be specified, and 
this is then propagated
into the specific analysis API.


Modified:
    trunk/pipe_control/value.py
    trunk/specific_analyses/api_base.py
    trunk/specific_analyses/api_common.py
    trunk/specific_analyses/model_free/api.py
    trunk/user_functions/value.py

Modified: trunk/pipe_control/value.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/value.py?rev=22699&r1=22698&r2=22699&view=diff
==============================================================================
--- trunk/pipe_control/value.py (original)
+++ trunk/pipe_control/value.py Thu Apr 10 19:41:09 2014
@@ -358,13 +358,15 @@
         minimise.reset_min_stats()
 
 
-def set(val=None, param=None, pipe=None, spin_id=None, error=False, 
force=True, reset=True):
+def set(val=None, param=None, index=None, pipe=None, spin_id=None, 
error=False, force=True, reset=True):
     """Set global or spin specific data values.
 
     @keyword val:       The parameter values.
     @type val:          None or list
     @keyword param:     The parameter names.
     @type param:        None, str, or list of str
+    @keyword index:     The index for parameters which are of the list-type. 
 This is ignored for all other types.
+    @type index:        None or int
     @keyword pipe:      The data pipe the values should be placed in.
     @type pipe:         None or str
     @keyword spin_id:   The spin identification string.
@@ -426,7 +428,7 @@
                 raise RelaxParamSetError(param[i])
 
     # Set the parameter values.
-    api.set_param_values(param=param, value=val, spin_id=spin_id, 
error=error, force=force)
+    api.set_param_values(param=param, value=val, index=index, 
spin_id=spin_id, error=error, force=force)
 
     # Reset all minimisation statistics.
     if reset:

Modified: trunk/specific_analyses/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/api_base.py?rev=22699&r1=22698&r2=22699&view=diff
==============================================================================
--- trunk/specific_analyses/api_base.py (original)
+++ trunk/specific_analyses/api_base.py Thu Apr 10 19:41:09 2014
@@ -655,13 +655,15 @@
         raise RelaxImplementError('set_error')
 
 
-    def set_param_values(self, param=None, value=None, spin_id=None, 
error=False, force=True):
+    def set_param_values(self, param=None, value=None, index=None, 
spin_id=None, error=False, force=True):
         """Set the model parameter values.
 
         @keyword param:     The parameter name list.
         @type param:        list of str
         @keyword value:     The parameter value list.
         @type value:        list
+        @keyword index:     The index for parameters which are of the 
list-type.  This is ignored for all other types.
+        @type index:        None or int
         @keyword spin_id:   The spin identification string, only used for 
spin specific parameters.
         @type spin_id:      None or str
         @keyword error:     A flag which if True will allow the parameter 
errors to be set instead of the values.

Modified: trunk/specific_analyses/api_common.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/api_common.py?rev=22699&r1=22698&r2=22699&view=diff
==============================================================================
--- trunk/specific_analyses/api_common.py       (original)
+++ trunk/specific_analyses/api_common.py       Thu Apr 10 19:41:09 2014
@@ -494,13 +494,15 @@
             inc = inc + 1
 
 
-    def _set_param_values_global(self, param=None, value=None, spin_id=None, 
error=False, force=True):
+    def _set_param_values_global(self, param=None, value=None, index=None, 
spin_id=None, error=False, force=True):
         """Set the global parameter values in the top layer of the data pipe.
 
         @keyword param:     The parameter name list.
         @type param:        list of str
         @keyword value:     The parameter value list.
         @type value:        list
+        @keyword index:     The index for parameters which are of the 
list-type.  This is unused.
+        @type index:        None or int
         @keyword spin_id:   The spin identification string (unused).
         @type spin_id:      None
         @keyword error:     A flag which if True will allow the parameter 
errors to be set instead of the values.
@@ -534,13 +536,15 @@
             setattr(cdp, obj_name, value[i])
 
 
-    def _set_param_values_spin(self, param=None, value=None, spin_id=None, 
error=False, force=True):
+    def _set_param_values_spin(self, param=None, value=None, index=None, 
spin_id=None, error=False, force=True):
         """Set the spin specific parameter values.
 
         @keyword param:     The parameter name list.
         @type param:        list of str
         @keyword value:     The parameter value list.
         @type value:        list
+        @keyword index:     The index for parameters which are of the 
list-type.  This is unused.
+        @type index:        None or int
         @keyword spin_id:   The spin identification string, only used for 
spin specific parameters.
         @type spin_id:      None or str
         @keyword error:     A flag which if True will allow the parameter 
errors to be set instead of the values.

Modified: trunk/specific_analyses/model_free/api.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/model_free/api.py?rev=22699&r1=22698&r2=22699&view=diff
==============================================================================
--- trunk/specific_analyses/model_free/api.py   (original)
+++ trunk/specific_analyses/model_free/api.py   Thu Apr 10 19:41:09 2014
@@ -1875,13 +1875,15 @@
                 inc = inc + 1
 
 
-    def set_param_values(self, param=None, value=None, spin_id=None, 
error=False, force=True):
+    def set_param_values(self, param=None, value=None, index=None, 
spin_id=None, error=False, force=True):
         """Set the model-free parameter values.
 
         @keyword param:     The parameter name list.
         @type param:        list of str
         @keyword value:     The parameter value list.
         @type value:        list
+        @keyword index:     The index for parameters which are of the 
list-type.  This is unused.
+        @type index:        None or int
         @keyword spin_id:   The spin identification string, only used for 
spin specific parameters.
         @type spin_id:      None or str
         @keyword error:     A flag which if True will allow the parameter 
errors to be set instead of the values.

Modified: trunk/user_functions/value.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/value.py?rev=22699&r1=22698&r2=22699&view=diff
==============================================================================
--- trunk/user_functions/value.py       (original)
+++ trunk/user_functions/value.py       Thu Apr 10 19:41:09 2014
@@ -327,6 +327,14 @@
     wiz_combo_iter = value.get_parameters,
     wiz_read_only = False,
     can_be_none = True
+)
+uf.add_keyarg(
+    name = "index",
+    py_type = "int",
+    min = 0,
+    max = 10000000,
+    desc_short = "index for list-type parameters",
+    desc = "The list index for when the parameter is a list of values.  This 
is ignored in all other cases."
 )
 uf.add_keyarg(
     name = "spin_id",
@@ -410,7 +418,7 @@
 uf.desc[-1].add_prompt("relax> value.set(val=[0.56, 13e-12], param=['s2', 
'te'], spin_id=':126@Ca')")
 uf.backend = value.set
 uf.menu_text = "&set"
-uf.wizard_height_desc = 480
+uf.wizard_height_desc = 440
 uf.wizard_size = (1000, 750)
 uf.wizard_image = WIZARD_IMAGE_PATH + 'value' + sep + 'value.png'
 




Related Messages


Powered by MHonArc, Updated Thu Apr 10 20:00:02 2014