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:


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to