Author: bugman Date: Wed Feb 20 10:03:36 2013 New Revision: 18514 URL: http://svn.gna.org/viewcvs/relax?rev=18514&view=rev Log: Fix for the classic_style() method of the model-free specific Macro class. This was identified by the new Mf.test_bug_20531_molmol_macro_write_relaxfault system test, but would probably never be encountered by users. It is not related to the bug this test is trying to catch. The problem is if spins have model-free parameters set up but there is no model-free model initialised - then the Molmol and PyMOL macro creation would fail. Modified: trunk/specific_fns/model_free/macro_base.py Modified: trunk/specific_fns/model_free/macro_base.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_fns/model_free/macro_base.py?rev=18514&r1=18513&r2=18514&view=diff ============================================================================== --- trunk/specific_fns/model_free/macro_base.py (original) +++ trunk/specific_fns/model_free/macro_base.py Wed Feb 20 10:03:36 2013 @@ -85,8 +85,8 @@ if data_type == 's2': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # Skip spins which don't have an S2 value. @@ -104,8 +104,8 @@ elif data_type == 's2f': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The backbone NH. @@ -125,8 +125,8 @@ elif data_type == 's2s': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The backbone NH. @@ -146,8 +146,8 @@ elif data_type == 'amp_fast': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The model. @@ -185,8 +185,8 @@ elif data_type == 'amp_slow': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The model. @@ -215,8 +215,8 @@ elif data_type == 'te': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # Skip spins which don't have a te value. @@ -234,8 +234,8 @@ elif data_type == 'tf': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # Skip spins which don't have a tf value. @@ -253,8 +253,8 @@ elif data_type == 'ts': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # Skip spins which don't have a ts value. @@ -278,8 +278,8 @@ elif data_type == 'time_fast': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The model. @@ -310,8 +310,8 @@ elif data_type == 'time_slow': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The model. @@ -347,8 +347,8 @@ elif data_type == 'rex': # Loop over the spins. for spin, mol_name, res_num, res_name in spin_loop(spin_id, full_info=True): - # Skip deselected spins. - if not spin.select: + # Skip deselected spins or spins with no model information set. + if not spin.select or not hasattr(spin, 'model'): continue # The backbone NH.