mailr17559 - in /trunk/specific_fns: consistency_tests.py jw_mapping.py noe/main.py relax_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 25, 2012 - 15:06:
Author: bugman
Date: Tue Sep 25 15:06:25 2012
New Revision: 17559

URL: http://svn.gna.org/viewcvs/relax?rev=17559&view=rev
Log:
The overfit_deselect() printouts are now regularised and match the model-free 
printouts.


Modified:
    trunk/specific_fns/consistency_tests.py
    trunk/specific_fns/jw_mapping.py
    trunk/specific_fns/noe/main.py
    trunk/specific_fns/relax_fit.py

Modified: trunk/specific_fns/consistency_tests.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/consistency_tests.py?rev=17559&r1=17558&r2=17559&view=diff
==============================================================================
--- trunk/specific_fns/consistency_tests.py (original)
+++ trunk/specific_fns/consistency_tests.py Tue Sep 25 15:06:25 2012
@@ -297,13 +297,14 @@
 
         # Print out.
         if verbose:
-            print("\n\nOver-fit spin deselection.\n")
+            print("\nOver-fit spin deselection:")
 
         # Test the sequence data exists.
         if not exists_mol_res_spin_data():
             raise RelaxNoSequenceError
 
         # Loop over spin data.
+        deselect_flag = False
         for spin, spin_id in spin_loop(return_id=True):
             # Skip deselected spins.
             if not spin.select:
@@ -313,6 +314,8 @@
             if not hasattr(spin, 'ri_data'):
                 warn(RelaxDeselectWarning(spin_id, 'missing relaxation 
data'))
                 spin.select = False
+                deselect_flag = True
+                continue
 
             # Require 3 or more data points.
             else:
@@ -326,6 +329,12 @@
                 if data_points < 3:
                     warn(RelaxDeselectWarning(spin_id, 'insufficient 
relaxation data, 3 or more data points are required'))
                     spin.select = False
+                    deselect_flag = True
+                    continue
+
+        # Final printout.
+        if verbose and not deselect_flag:
+            print("No spins have been deselected.")
 
 
     return_data_name_doc = Desc_container("Consistency testing data type 
string matching patterns")

Modified: trunk/specific_fns/jw_mapping.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/jw_mapping.py?rev=17559&r1=17558&r2=17559&view=diff
==============================================================================
--- trunk/specific_fns/jw_mapping.py (original)
+++ trunk/specific_fns/jw_mapping.py Tue Sep 25 15:06:25 2012
@@ -281,13 +281,14 @@
 
         # Print out.
         if verbose:
-            print("\n\nOver-fit spin deselection.\n")
+            print("\nOver-fit spin deselection:")
 
         # Test the sequence data exists.
         if not exists_mol_res_spin_data():
             raise RelaxNoSequenceError
 
         # Loop over spin data.
+        deselect_flag = False
         for spin, spin_id in spin_loop(return_id=True):
             # Skip deselected spins.
             if not spin.select:
@@ -297,6 +298,8 @@
             if not hasattr(spin, 'ri_data'):
                 warn(RelaxDeselectWarning(spin_id, 'missing relaxation 
data'))
                 spin.select = False
+                deselect_flag = True
+                continue
 
             # Require 3 or more data points.
             else:
@@ -310,6 +313,12 @@
                 if data_points < 3:
                     warn(RelaxDeselectWarning(spin_id, 'insufficient 
relaxation data, 3 or more data points are required'))
                     spin.select = False
+                    deselect_flag = True
+                    continue
+
+        # Final printout.
+        if verbose and not deselect_flag:
+            print("No spins have been deselected.")
 
 
     return_data_name_doc = Desc_container("Reduced spectral density mapping 
data type string matching patterns")

Modified: trunk/specific_fns/noe/main.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/noe/main.py?rev=17559&r1=17558&r2=17559&view=diff
==============================================================================
--- trunk/specific_fns/noe/main.py (original)
+++ trunk/specific_fns/noe/main.py Tue Sep 25 15:06:25 2012
@@ -151,13 +151,14 @@
 
         # Print out.
         if verbose:
-            print("\n\nOver-fit spin deselection.\n")
+            print("\nOver-fit spin deselection:")
 
         # Test the sequence data exists.
         if not exists_mol_res_spin_data():
             raise RelaxNoSequenceError
 
         # Loop over spin data.
+        deselect_flag = False
         for spin, spin_id in spin_loop(return_id=True):
             # Skip deselected spins.
             if not spin.select:
@@ -167,11 +168,19 @@
             if not hasattr(spin, 'intensities') or not len(spin.intensities) 
== 2:
                 warn(RelaxDeselectWarning(spin_id, 'insufficient data'))
                 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
+
+        # Final printout.
+        if verbose and not deselect_flag:
+            print("No spins have been deselected.")
 
 
     return_data_name_doc = Desc_container("NOE calculation data type string 
matching patterns")

Modified: trunk/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/relax_fit.py?rev=17559&r1=17558&r2=17559&view=diff
==============================================================================
--- trunk/specific_fns/relax_fit.py (original)
+++ trunk/specific_fns/relax_fit.py Tue Sep 25 15:06:25 2012
@@ -814,13 +814,14 @@
 
         # Print out.
         if verbose:
-            print("\n\nOver-fit spin deselection.\n")
+            print("\nOver-fit spin deselection:")
 
         # Test the sequence data exists.
         if not exists_mol_res_spin_data():
             raise RelaxNoSequenceError
 
         # Loop over spin data.
+        deselect_flag = False
         for spin, spin_id in spin_loop(return_id=True):
             # Skip deselected spins.
             if not spin.select:
@@ -830,17 +831,23 @@
             if not hasattr(spin, 'intensities'):
                 warn(RelaxDeselectWarning(spin_id, 'missing intensity data'))
                 spin.select = False
+                deselect_flag = True
                 continue
 
             # Require 3 or more data points.
             elif len(spin.intensities) < 3:
                 warn(RelaxDeselectWarning(spin_id, 'insufficient data, 3 or 
more data points are required'))
                 spin.select = False
+                deselect_flag = True
                 continue
 
             # Check that the number of relaxation times is complete.
             if len(spin.intensities) != len(cdp.relax_times):
                 raise RelaxError("The %s peak intensity points of the spin 
'%s' does not match the expected number of %s (the IDs %s do not match %s)." 
% (len(spin.intensities), spin_id, len(cdp.relax_times), 
spin.intensities.keys(), cdp.relax_times.keys()))
+
+        # Final printout.
+        if verbose and not deselect_flag:
+            print("No spins have been deselected.")
 
 
     def return_data(self, spin):




Related Messages


Powered by MHonArc, Updated Tue Sep 25 15:20:01 2012