[Numpy-discussion] Error in allclose with inf values

Stefan van der Walt stefan at sun.ac.za
Mon Aug 20 10:54:55 EDT 2007


Hi Matthew

On Fri, Aug 17, 2007 at 01:11:41PM +0100, Matthew Brett wrote:
> I noticed that allclose does not always behave correctly for arrays with infs.
> 
> I've attached a test script for allclose, and here's an alternative
> implementation that I believe behaves correctly.

Thanks for the patch --  I applied it in r3977 with the appropriate
tests.

> I wonder if we should allow nans in the test arrays - possibly with an
> optional keyword arg like allownan.  After all inf-inf is nan - but we
> allow that in the test.

I'm happy with both allclose([Inf],[-Inf]) and
allclose([anything],[NaN]) returning False.

Cheers
Stéfan



More information about the NumPy-Discussion mailing list