[Numpy-discussion] Error in allclose with inf values

Matthew Brett matthew.brett@gmail....
Fri Aug 17 07:11:41 CDT 2007


Hi,

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.

Obviously the test script could be a test case in core/tests/test_numeric.py

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.

Best,

Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my_allclose.py
Type: text/x-python-script
Size: 757 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070817/55c80aa6/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_allclose.py
Type: text/x-python-script
Size: 1462 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070817/55c80aa6/attachment-0001.bin 


More information about the Numpy-discussion mailing list