[Numpy-discussion] Error in allclose with inf values

Matthew Brett matthew.brett at gmail.com
Fri Aug 17 08:11:41 EDT 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: 758 bytes
Desc: not available
URL: <http://mail.python.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: 1463 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070817/55c80aa6/attachment-0001.bin>


More information about the NumPy-Discussion mailing list