mailr28076 - /trunk/lib/sequence.py


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

Header


Content

Posted by tlinnet on November 21, 2015 - 15:08:
Author: tlinnet
Date: Sat Nov 21 15:08:17 2015
New Revision: 28076

URL: http://svn.gna.org/viewcvs/relax?rev=28076&view=rev
Log:
Made additional check in sequence reading, that "nan" values are skipped.

Modified:
    trunk/lib/sequence.py

Modified: trunk/lib/sequence.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/sequence.py?rev=28076&r1=28075&r2=28076&view=diff
==============================================================================
--- trunk/lib/sequence.py       (original)
+++ trunk/lib/sequence.py       Sat Nov 21 15:08:17 2015
@@ -24,6 +24,7 @@
 """Module for handling the molecule, residue, and spin sequence data."""
 
 # Python module imports.
+from math import isnan
 from warnings import warn
 
 # relax module imports.
@@ -310,6 +311,11 @@
                 else:
                     value = float(line[data_col-1])
 
+                    # If it a float, test if is nan.
+                    if isnan(value):
+                        warn(RelaxWarning("The value is 'nan', skipping the 
line %s" % line))
+                        continue
+
             # Bad data.
             except ValueError:
                 warn(RelaxWarning("Invalid data, skipping the line %s" % 
line))
@@ -326,6 +332,11 @@
                 # A float.
                 else:
                     error = float(line[error_col-1])
+
+                    # If it a float, test if is nan.
+                    if isnan(error):
+                        warn(RelaxWarning("The error is 'nan', skipping the 
line %s" % line))
+                        continue
 
             # Bad data.
             except ValueError:




Related Messages


Powered by MHonArc, Updated Sun Nov 22 16:20:07 2015