[NumPy-Tickets] [NumPy] #1905: numpy/core/numeric/allclose() fails to test for NaN inputs

NumPy Trac numpy-tickets@scipy....
Tue Jul 12 16:43:25 CDT 2011


#1905: numpy/core/numeric/allclose() fails to test for NaN inputs
------------------------+---------------------------------------------------
 Reporter:  robertpyle  |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  Other       |     Version:  1.6.0      
 Keywords:              |  
------------------------+---------------------------------------------------
 Despite a comment that says NaNs in either input cause it to return False,
 routine allclose() in core/numeric.py fails to test its inputs for NaN.
 This causes a warning to be issued by numpy.test(), at least on MacOSX
 10.6.8  with python.org python2.7.1, numpy 1.6.1.rc3.

 A 2-line addition fixes this.  Here's the diff:

 1915a1916,1917
 >     if any(isnan(x)) or any(isnan(y)):
 >         return False

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1905>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list