Author: bugman Date: Wed Apr 28 17:50:40 2010 New Revision: 11165 URL: http://svn.gna.org/viewcvs/relax?rev=11165&view=rev Log: Another fix for _update_model(). This was introduced in the last change. The alignment tensors are only updated if alignment data is loaded. Modified: 1.3/specific_fns/n_state_model.py Modified: 1.3/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=11165&r1=11164&r2=11165&view=diff ============================================================================== --- 1.3/specific_fns/n_state_model.py (original) +++ 1.3/specific_fns/n_state_model.py Wed Apr 28 17:50:40 2010 @@ -1356,20 +1356,21 @@ data_types = self._base_data_types() # Set up tensors for each alignment. - for id in cdp.align_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]) + if hasattr(cdp, 'align_ids'): + for id in cdp.align_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 calculate(self, spin_id=None, verbosity=1, sim_index=None):