My system is Mac OSX 10.6.8, python.org 2.7.1.  When I run numpy.test(), I see 
the following warning:

>>> import numpy as np
>>> np.test()
Running unit tests for numpy
NumPy version 1.6.1rc2
NumPy is installed in 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy
Python version 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple 
Inc. build 5494)]
nose version 0.11.3
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................../Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py:1922:
 RuntimeWarning: invalid value encountered in absolute
  return all(less_equal(absolute(x-y), atol + rtol * absolute(y)))


Everything else completes with 3 KNOWNFAILs and 1 SKIP.  This warning is not 
new to this release; I've seen it before but haven't  tried tracking it down 
until today.

It arises in allclose().  The comments state "If either array contains NaN, 
then False is returned." but no test for NaN is done, and NaNs are indeed what 
cause the warning.

Inserting

    if any(isnan(x)) or any(isnan(y)):
        return False

before current line number 1916 in numeric.py seems to  fix it.

Thanks to all for the great work.  Numpy has saved me a lot of grief.

Bob Pyle
Cambridge, MA

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to