[Numpy-discussion] Test error with ATLAS, Windows 64 bit

Warren Weckesser warren.weckesser at gmail.com
Mon Apr 14 15:12:48 EDT 2014


On Mon, Apr 14, 2014 at 2:59 PM, Matthew Brett <matthew.brett at gmail.com>wrote:

> Hi,
>
> With Carl Kleffner, I am trying to build a numpy 1.8.1 wheel for
> Windows 64-bit, and latest stable ATLAS.
>
> It works fine, apart from the following test failure:
>
> ======================================================================
> FAIL: test_special (test_umath.TestExpm1)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\numpy\core\tests\test_umath.py",
> line 329, in test_special
>     assert_equal(ncu.expm1(-0.), -0.)
>   File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line
> 311, in assert_equal
>     raise AssertionError(msg)
> AssertionError:
> Items are not equal:
>  ACTUAL: 0.0
>  DESIRED: -0.0
>
> Has anyone seen this?  Is it in fact necessary that expm1(-0.) return
> -0 instead of 0?
>
>

What a cowinky dink.  This moring I ran into this issue in a scipy pull
request (https://github.com/scipy/scipy/pull/3547), and I asked about this
comparison failing on the mailing list a few hours ago.  In the pull
request, the modified function returns -0.0 where it used to return 0.0,
and the test for the value 0.0 failed.  My work-around was to use
`assert_array_equal` instead of `assert_equal`.  The array comparison
functions treat the values -0.0 and 0.0 as equal.  `assert_equal` has code
that checks for signed zeros, and fails if they are not the same sign.

Warren



Thanks a lot,
>
> Matthew
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140414/56e1d288/attachment.html>


More information about the NumPy-Discussion mailing list