mailr17745 - /branches/tensor_data/data/diff_tensor.py


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

Header


Content

Posted by edward on October 08, 2012 - 14:13:
Author: bugman
Date: Mon Oct  8 14:13:34 2012
New Revision: 17745

URL: http://svn.gna.org/viewcvs/relax?rev=17745&view=rev
Log:
Improvements to the diffusion tensor set() method.

The parameters, errors and simulations are now properly differentiated and 
stored.


Modified:
    branches/tensor_data/data/diff_tensor.py

Modified: branches/tensor_data/data/diff_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/tensor_data/data/diff_tensor.py?rev=17745&r1=17744&r2=17745&view=diff
==============================================================================
--- branches/tensor_data/data/diff_tensor.py (original)
+++ branches/tensor_data/data/diff_tensor.py Mon Oct  8 14:13:34 2012
@@ -964,14 +964,27 @@
 
         # Check the type.
         if category not in ['val', 'err', 'sim']:
-            raise RelaxError("The category of the parameter '%s' is 
incorrectly set to %s." % (param, category))
+            raise RelaxError("The category of the parameter '%s' is 
incorrectly set to %s - it must be one of 'val', 'err' or 'sim'." % (param, 
category))
 
         # Test if the attribute that is trying to be set is modifiable.
         if not param in self.__mod_attr__:
             raise RelaxError("The object '%s' is not a modifiable 
attribute." % param)
 
-        # Set the attribute normally.
-        self.__dict__[param] = value
+        # Set a parameter value.
+        if category == 'val':
+            self.__dict__[param] = value
+
+        # Set an error.
+        elif category == 'err':
+            self.__dict__[param+'_err'] = value
+
+        # Set a simulation value.
+        else:
+            # The object.
+            obj = getattr(self, param+'_sim')
+
+            # Set the value.
+            obj[sim_index] = value
 
         # Flag for the spheroid type.
         if param == 'spheroid_type' and value:




Related Messages


Powered by MHonArc, Updated Mon Oct 08 14:20:02 2012