Author: bugman Date: Tue Jun 23 19:23:11 2009 New Revision: 9141 URL: http://svn.gna.org/viewcvs/relax?rev=9141&view=rev Log: Removed ambiguity from the align_tensor.reduction() user function. The from_tensor and to_tensor args have been renamed to full_tensor and red_tensor respectively. Modified: branches/frame_order/generic_fns/align_tensor.py branches/frame_order/prompt/align_tensor.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=9141&r1=9140&r2=9141&view=diff ============================================================================== --- branches/frame_order/generic_fns/align_tensor.py (original) +++ branches/frame_order/generic_fns/align_tensor.py Tue Jun 23 19:23:11 2009 @@ -831,44 +831,44 @@ sys.stdout.write("\n") -def reduction(from_tensor=None, to_tensor=None): +def reduction(full_tensor=None, red_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 + @param full_tensor: The full alignment tensor. + @type full_tensor: str + @param red_tensor: The reduced alignment tensor. + @type red_tensor: str """ # Alias the current data pipe. cdp = pipes.get_pipe() # Tensor information. - match_from = False - match_to = False + match_full = False + match_red = False i = 0 for tensor_cont in cdp.align_tensors: # Test the tensor names. - if tensor_cont.name == from_tensor: - match_from = True - index_from = i - if tensor_cont.name == to_tensor: - match_to = True - index_to = i + if tensor_cont.name == full_tensor: + match_full = True + index_full = i + if tensor_cont.name == red_tensor: + match_red = True + index_red = i # Increment. i = i + 1 # No match. - if not match_from: - raise RelaxNoTensorError, ('alignment', from_tensor) - if not match_to: - raise RelaxNoTensorError, ('alignment', to_tensor) + if not match_full: + raise RelaxNoTensorError, ('alignment', full_tensor) + if not match_red: + raise RelaxNoTensorError, ('alignment', red_tensor) # Store. if not hasattr(cdp.align_tensors, 'reduction'): cdp.align_tensors.reduction = [] - cdp.align_tensors.reduction.append([index_from, index_to]) + cdp.align_tensors.reduction.append([index_full, index_red]) def return_conversion_factor(param): Modified: branches/frame_order/prompt/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order/prompt/align_tensor.py?rev=9141&r1=9140&r2=9141&view=diff ============================================================================== --- branches/frame_order/prompt/align_tensor.py (original) +++ branches/frame_order/prompt/align_tensor.py Tue Jun 23 19:23:11 2009 @@ -334,15 +334,15 @@ align_tensor.matrix_angles(basis_set, tensors) - def reduction(self, from_tensor=None, to_tensor=None): + def reduction(self, full_tensor=None, red_tensor=None): """Specify that one tensor is a reduction of another. Keyword Arguments ~~~~~~~~~~~~~~~~~ - from_tensor: The full alignment tensor. - - to_tensor: The reduce alignment tensor. + full_tensor: The full alignment tensor. + + red_tensor: The reduce alignment tensor. Description @@ -358,26 +358,26 @@ To state that the alignment tensor loaded as 'chi3 C-dom' is a reduction of 'chi3 N-dom', type: - relax> align_tensor.reduction(from_tensor='chi3 N-dom', to_tensor='chi3 C-dom') + relax> align_tensor.reduction(full_tensor='chi3 N-dom', red_tensor='chi3 C-dom') """ # Function intro text. if self.__relax__.interpreter.intro: text = sys.ps3 + "align_tensor.reduction(" - text = text + "from_tensor=" + `from_tensor` - text = text + ", to_tensor=" + `to_tensor` + ")" + text = text + "full_tensor=" + `full_tensor` + text = text + ", red_tensor=" + `red_tensor` + ")" print text # From tensor argument. - if type(from_tensor) != str: - raise RelaxStrError, ('from tensor', from_tensor) + if type(full_tensor) != str: + raise RelaxStrError, ('from tensor', full_tensor) # To tensor argument. - if type(to_tensor) != str: - raise RelaxStrError, ('to tensor', to_tensor) - - # Execute the functional code. - align_tensor.reduction(from_tensor=from_tensor, to_tensor=to_tensor) + if type(red_tensor) != str: + raise RelaxStrError, ('to tensor', red_tensor) + + # Execute the functional code. + align_tensor.reduction(full_tensor=full_tensor, red_tensor=red_tensor) def svd(self, basis_set=0, tensors=None):