Author: bugman
Date: Tue Feb 4 16:05:24 2014
New Revision: 22120
URL: http://svn.gna.org/viewcvs/relax?rev=22120&view=rev
Log:
Merged revisions 22116 via svnmerge from
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk
........
r22116 | bugman | 2014-02-04 15:43:10 +0100 (Tue, 04 Feb 2014) | 11 lines
Improvements for the steady-state NOE analysis overfit_deselect() method.
The spin deselection which occurs at the start of the calc user function
call, used to calculate the
NOE, is now clearer. Each deselection condition is now explained in detail
and the text is now far
more informative.
In addition, the special condition of all spins being deselected is now
caught. If this happens, a
RelaxError is raised to prevent the user from going forwards. This should
remove confusion as to
why the output file is empty.
........
Modified:
branches/double_rotor/ (props changed)
branches/double_rotor/specific_analyses/noe/main.py
Propchange: branches/double_rotor/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 4 16:05:24 2014
@@ -1,1 +1,1 @@
-/trunk:1-22112,22115
+/trunk:1-22112,22115-22116
Modified: branches/double_rotor/specific_analyses/noe/main.py
URL:
http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/noe/main.py?rev=22120&r1=22119&r2=22120&view=diff
==============================================================================
--- branches/double_rotor/specific_analyses/noe/main.py (original)
+++ branches/double_rotor/specific_analyses/noe/main.py Tue Feb 4 16:05:24
2014
@@ -170,28 +170,50 @@
# Loop over spin data.
deselect_flag = False
+ all_desel = True
for spin, spin_id in spin_loop(return_id=True):
# Skip deselected spins.
if not spin.select:
continue
+ # No intensity data.
+ if not hasattr(spin, 'intensities'):
+ warn(RelaxDeselectWarning(spin_id, 'the absence of intensity
data'))
+ spin.select = False
+ deselect_flag = True
+ continue
+
# Check for sufficient data.
- if not hasattr(spin, 'intensities') or not len(spin.intensities)
2:
- warn(RelaxDeselectWarning(spin_id, 'insufficient data'))
+ if not len(spin.intensities) > 2:
+ warn(RelaxDeselectWarning(spin_id, 'insufficient data (less
than two data points)'))
+ spin.select = False
+ deselect_flag = True
+ continue
+
+ # No error data.
+ if not hasattr(spin, 'intensity_err'):
+ warn(RelaxDeselectWarning(spin_id, 'the absence of errors'))
spin.select = False
deselect_flag = True
continue
# Check for sufficient errors.
- elif not hasattr(spin, 'intensity_err') or not
len(spin.intensity_err) > 2:
- warn(RelaxDeselectWarning(spin_id, 'missing errors'))
- spin.select = False
- deselect_flag = True
- continue
+ if not len(spin.intensity_err) > 2:
+ warn(RelaxDeselectWarning(spin_id, 'missing errors (less
than two error points)'))
+ spin.select = False
+ deselect_flag = True
+ continue
+
+ # Not all spins have been deselected.
+ all_desel = False
# Final printout.
if verbose and not deselect_flag:
print("No spins have been deselected.")
+
+ # Catch complete failures - i.e. no spins are selected.
+ if all_desel:
+ raise RelaxError("All spins have been deselected.")
return_data_name_doc = Desc_container("NOE calculation data type string
matching patterns")