Author: bugman Date: Thu Jan 10 16:51:37 2008 New Revision: 4605 URL: http://svn.gna.org/viewcvs/relax?rev=4605&view=rev Log: Updated the get_tensor_index() and get_tensor_object() functions to allow for a different data pipe. Modified: branches/N_state_model/generic_fns/align_tensor.py Modified: branches/N_state_model/generic_fns/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/generic_fns/align_tensor.py?rev=4605&r1=4604&r2=4605&view=diff ============================================================================== --- branches/N_state_model/generic_fns/align_tensor.py (original) +++ branches/N_state_model/generic_fns/align_tensor.py Thu Jan 10 16:51:37 2008 @@ -98,6 +98,9 @@ # Create the align_tensor dictionary if it doesn't yet exist. if not hasattr(relax_data_store[pipe_to], 'align_tensor'): relax_data_store[pipe_to].align_tensor = AlignTensorList() + + # Find the tensor index. + index = get_tensor_index(tensor) # Copy the data. relax_data_store[pipe_to].align_tensor[tensor_to] = deepcopy(relax_data_store[pipe_from].align_tensor[tensor_from]) @@ -320,17 +323,23 @@ cdp.align_tensor.beta_sim[sim_index] = cdp.align_tensor.beta_sim[sim_index] + pi -def get_tensor_index(tensor): +def get_tensor_index(tensor, pipe=None): """Function for returning the index corresponding to the 'tensor' argument. @param tensor: The alignment tensor identification string. @type tensor: str + @param pipe: The data pipe to search for data in. + @type pipe: str @return: The index corresponding to the 'tensor' arg. @rtype: int """ + # The data pipe to check. + if pipe == None: + pipe = relax_data_store.current_pipe + # Alias the current data pipe. - cdp = relax_data_store[relax_data_store.current_pipe] + cdp = relax_data_store[pipe] # Init. index = None @@ -344,17 +353,23 @@ return index -def get_tensor_object(tensor): +def get_tensor_object(tensor, pipe=None): """Function for returning the AlignTensorData instance corresponding to the 'tensor' argument. @param tensor: The alignment tensor identification string. @type tensor: str + @param pipe: The data pipe to search for data in. + @type pipe: str @return: The alignment tensor object corresponding to the 'tensor' arg. @rtype: AlignTensorData instance """ + # The data pipe to check. + if pipe == None: + pipe = relax_data_store.current_pipe + # Alias the current data pipe. - cdp = relax_data_store[relax_data_store.current_pipe] + cdp = relax_data_store[pipe] # Init. data = None