Author: bugman Date: Fri Aug 8 11:24:54 2008 New Revision: 7117 URL: http://svn.gna.org/viewcvs/relax?rev=7117&view=rev Log: Fix for the __update_model() method. This was only working if both RDC and PCS data are supplied. Modified: branches/rdc_analysis/specific_fns/n_state_model.py Modified: branches/rdc_analysis/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/specific_fns/n_state_model.py?rev=7117&r1=7116&r2=7117&view=diff ============================================================================== --- branches/rdc_analysis/specific_fns/n_state_model.py (original) +++ branches/rdc_analysis/specific_fns/n_state_model.py Fri Aug 8 11:24:54 2008 @@ -313,22 +313,27 @@ data_types = self.__base_data_types() # Set up alignment tensors for each alignment. - if 'rdc' in data_types or 'pcs' in data_types: - # Loop over the RDC and PCS ids. - for id in cdp.rdc_ids+cdp.pcs_ids: - # No tensors initialised. - if not hasattr(cdp, 'align_tensors'): - generic_fns.align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) - - # Find if the tensor corresponding to the id exists. - exists = False - for tensor in cdp.align_tensors: - if id == tensor.name: - exists = True - - # Initialise the tensor. - if not exists: - generic_fns.align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) + ids = [] + if 'rdc' in data_types: + ids = ids+cdp.rdc_ids + if 'pcs' in data_types: + ids = ids+cdp.pcs_ids + + # Set up tensors for each alignment. + for id in ids: + # No tensors initialised. + if not hasattr(cdp, 'align_tensors'): + generic_fns.align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) + + # Find if the tensor corresponding to the id exists. + exists = False + for tensor in cdp.align_tensors: + if id == tensor.name: + exists = True + + # Initialise the tensor. + if not exists: + generic_fns.align_tensor.init(tensor=id, params=[0.0, 0.0, 0.0, 0.0, 0.0]) def __linear_constraints(self, data_types=None, scaling_matrix=None):