mailr17743 - in /branches/tensor_data: data/diff_tensor.py generic_fns/diffusion_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 - 11:44:
Author: bugman
Date: Mon Oct  8 11:44:02 2012
New Revision: 17743

URL: http://svn.gna.org/viewcvs/relax?rev=17743&view=rev
Log:
Renamed the diffusion tensor data structure type() method to set_type().

This is because the type is stored as the 'type' object, clashing with the 
method name.


Modified:
    branches/tensor_data/data/diff_tensor.py
    branches/tensor_data/generic_fns/diffusion_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=17743&r1=17742&r2=17743&view=diff
==============================================================================
--- branches/tensor_data/data/diff_tensor.py (original)
+++ branches/tensor_data/data/diff_tensor.py Mon Oct  8 11:44:02 2012
@@ -979,6 +979,22 @@
         xml_to_object(diff_tensor_node, self, file_version=file_version)
 
 
+    def set_type(self, value):
+        """Set the diffusion tensor type.
+
+        @param value:   The diffusion tensor type.  This can be one of 
'sphere', 'spheroid' or 'ellipsoid'.
+        @type value:    str
+        """
+
+        # Checks.
+        allowed = ['sphere', 'spheroid', 'ellipsoid']
+        if value not in allowed:
+            raise RelaxError("The diffusion tensor type '%s' must be one of 
%s." % (value, allowed))
+
+        # Set the type.
+        self.__dict__['type'] = value
+
+
     def to_xml(self, doc, element):
         """Create an XML element for the diffusion tensor.
 
@@ -998,22 +1014,6 @@
 
         # Add all simple python objects within the PipeContainer to the pipe 
element.
         fill_object_contents(doc, tensor_element, object=self, 
blacklist=['type'] + list(self.__class__.__dict__.keys()))
-
-
-    def type(self, value):
-        """Set the diffusion tensor type.
-
-        @param value:   The diffusion tensor type.  This can be one of 
'sphere', 'spheroid' or 'ellipsoid'.
-        @type value:    str
-        """
-
-        # Checks.
-        allowed = ['sphere', 'spheroid', 'ellipsoid']
-        if value not in allowed:
-            raise RelaxError("The diffusion tensor type '%s' must be one of 
%s." % (value, allowed))
-
-        # Set the type.
-        self.__dict__['type'] = value
 
 
 

Modified: branches/tensor_data/generic_fns/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/tensor_data/generic_fns/diffusion_tensor.py?rev=17743&r1=17742&r2=17743&view=diff
==============================================================================
--- branches/tensor_data/generic_fns/diffusion_tensor.py (original)
+++ branches/tensor_data/generic_fns/diffusion_tensor.py Mon Oct  8 11:44:02 
2012
@@ -523,7 +523,7 @@
     """
 
     # The diffusion type.
-    cdp.diff_tensor.type('ellipsoid')
+    cdp.diff_tensor.set_type('ellipsoid')
 
     # (tm, Da, Dr, alpha, beta, gamma).
     if param_types == 0:
@@ -1552,7 +1552,7 @@
     """
 
     # The diffusion type.
-    cdp.diff_tensor.type('sphere')
+    cdp.diff_tensor.set_type('sphere')
 
     # tm.
     if param_types == 0:
@@ -1596,7 +1596,7 @@
     """
 
     # The diffusion type.
-    cdp.diff_tensor.type('spheroid')
+    cdp.diff_tensor.set_type('spheroid')
 
     # Spheroid diffusion type.
     allowed_types = [None, 'oblate', 'prolate']




Related Messages


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