mailr9083 - in /branches/frame_order: generic_fns/align_tensor.py specific_fns/n_state_model.py


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

Header


Content

Posted by edward on June 18, 2009 - 22:15:
Author: bugman
Date: Thu Jun 18 22:15:18 2009
New Revision: 9083

URL: http://svn.gna.org/viewcvs/relax?rev=9083&view=rev
Log:
Shifted the N-state model set_type() method to the align_tensor function 
reduction().


Modified:
    branches/frame_order/generic_fns/align_tensor.py
    branches/frame_order/specific_fns/n_state_model.py

Modified: branches/frame_order/generic_fns/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order/generic_fns/align_tensor.py?rev=9083&r1=9082&r2=9083&view=diff
==============================================================================
--- branches/frame_order/generic_fns/align_tensor.py (original)
+++ branches/frame_order/generic_fns/align_tensor.py Thu Jun 18 22:15:18 2009
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2008 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2009 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -822,6 +822,39 @@
         sys.stdout.write("\n")
 
 
+def reduction(from_tensor=None, to_tensor=None):
+    """Specify which tensor is a reduction of which other tensor.
+
+    @param from_tensor: The full alignment tensor.
+    @type from_tensor:  str
+    @param to_tensor:   The reduced alignment tensor.
+    @type to_tensor:    str
+    """
+
+    # Alias the current data pipe.
+    cdp = pipes.get_pipe()
+
+    # Test the tensor names.
+    match_from = False
+    match_to = False
+    for tensor_cont in cdp.align_tensors:
+        if tensor_cont.name == from_tensor:
+            match_from = True
+        if tensor_cont.name == to_tensor:
+            match_to = True
+
+    # No match.
+    if not match_from:
+        raise RelaxNoTensorError, ('alignment', from_tensor)
+    if not match_to:
+        raise RelaxNoTensorError, ('alignment', to_tensor)
+
+    # Store.
+    if not hasattr(cdp.align_tensors, 'reduction'):
+        cdp.align_tensors.reduction = []
+    cdp.align_tensors.reduction.append([from_tensor, to_tensor])
+
+
 def return_conversion_factor(param):
     """Function for returning the factor of conversion between different 
parameter units.
 

Modified: branches/frame_order/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order/specific_fns/n_state_model.py?rev=9083&r1=9082&r2=9083&view=diff
==============================================================================
--- branches/frame_order/specific_fns/n_state_model.py (original)
+++ branches/frame_order/specific_fns/n_state_model.py Thu Jun 18 22:15:18 
2009
@@ -1903,28 +1903,3 @@
 
                 # Set the parameter value.
                 object[index] = value[i]
-
-
-    def set_type(self, tensor=None, red=None):
-        """Set the whether the given tensor is the full or reduced tensor.
-
-        @param tensor:  The alignment tensor label.
-        @type tensor:   str
-        @param red:     The flag specifying whether the given tensor is the 
full or reduced tensor.
-        @type red:      bool
-        """
-
-        # Alias the current data pipe.
-        cdp = pipes.get_pipe()
-
-        # Loop over the tensors.
-        match = False
-        for tensor_cont in cdp.align_tensors:
-            # Find the matching tensor and then store the tensor type.
-            if tensor_cont.name == tensor:
-                tensor_cont.red = red
-                match = True
-
-        # The tensor label doesn't exist.
-        if not match:
-            raise RelaxNoTensorError, ('alignment', tensor)




Related Messages


Powered by MHonArc, Updated Fri Jun 19 10:20:04 2009