mailr28093 - /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 24, 2015 - 08:15:
Author: tlinnet
Date: Tue Nov 24 08:15:35 2015
New Revision: 28093

URL: http://svn.gna.org/viewcvs/relax?rev=28093&view=rev
Log:
Using Gary's lib.float.isNaN() instead of math.isnan(), to have backwards 
compability with python 2.5.

Modified:
    trunk/lib/sequence.py

Modified: trunk/lib/sequence.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/sequence.py?rev=28093&r1=28092&r2=28093&view=diff
==============================================================================
--- trunk/lib/sequence.py       (original)
+++ trunk/lib/sequence.py       Tue Nov 24 08:15:35 2015
@@ -24,13 +24,13 @@
 """Module for handling the molecule, residue, and spin sequence data."""
 
 # Python module imports.
-from math import isnan
 from warnings import warn
 
 # relax module imports.
 from lib.checks import Check
 from lib.check_types import is_float
 from lib.errors import RelaxError, RelaxInvalidSeqError
+from lib.float import isFinite
 from lib.io import extract_data, open_write_file, strip, write_data
 from lib.selection import spin_id_to_data_list
 from lib.warnings import RelaxWarning, RelaxFileEmptyWarning
@@ -312,8 +312,8 @@
                     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))
+                    if not isFinite(value):
+                        warn(RelaxWarning("The value is not finite, skipping 
the line %s" % line))
                         continue
 
             # Bad data.
@@ -334,8 +334,8 @@
                     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))
+                    if not isFinite(error):
+                        warn(RelaxWarning("The error is not finite, skipping 
the line %s" % line))
                         continue
 
             # Bad data.




Related Messages


Powered by MHonArc, Updated Tue Nov 24 08:20:13 2015