[Numpy-discussion] numpy tests errors and failures

Warren Weckesser warren.weckesser@gmail....
Sat Jun 1 19:56:08 CDT 2013


On Sat, Jun 1, 2013 at 7:47 PM, Charles R Harris
<charlesr.harris@gmail.com>wrote:

>
>
> On Sat, Jun 1, 2013 at 4:50 PM, Warren Weckesser <
> warren.weckesser@gmail.com> wrote:
>
>> I'm getting a failure and two errors with the latest master branch:
>>
>> $ python -c "import numpy; numpy.test('full')"
>> Running unit tests for numpy
>> NumPy version 1.8.0.dev-dff8c94
>> NumPy is installed in
>> /home/warren/local_numpy/lib/python2.7/site-packages/numpy
>> Python version 2.7.4 |Anaconda 1.5.0 (64-bit)| (default, Apr 21 2013,
>> 17:43:08) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]
>> nose version 1.3.0
>>
>> .....................F...................................................................................................................................................................................................................................................................................................................S...............................................................................................................................S..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K........................................E.E.................................................................................................................................................SSS...............................................................................................................................................................................................................................................................................................................................................K........................................................................................................K......................K...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................SS..SS.....................................................................................................SSSSSSSS................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
>> ======================================================================
>> ERROR: test_numeric.TestIsclose.test_ip_isclose_allclose([1e-08, 1,
>> 1000020.0000000099], [0, nan, 1000000.0])
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py",
>> line 197, in runTest
>>     self.test(*self.arg)
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/core/tests/test_numeric.py",
>> line 1253, in tst_isclose_allclose
>>     assert_array_equal(isclose(x, y).all(), allclose(x, y), msg % (x, y))
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/core/numeric.py",
>> line 2008, in allclose
>>     return all(less_equal(abs(x-y), atol + rtol * abs(y)))
>> RuntimeWarning: invalid value encountered in absolute
>>
>> ======================================================================
>> ERROR: test_numeric.TestIsclose.test_ip_isclose_allclose(nan, [nan, nan,
>> nan])
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py",
>> line 197, in runTest
>>     self.test(*self.arg)
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/core/tests/test_numeric.py",
>> line 1253, in tst_isclose_allclose
>>     assert_array_equal(isclose(x, y).all(), allclose(x, y), msg % (x, y))
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/core/numeric.py",
>> line 2008, in allclose
>>     return all(less_equal(abs(x-y), atol + rtol * abs(y)))
>> RuntimeWarning: invalid value encountered in absolute
>>
>> ======================================================================
>> FAIL: Test numpy dot with different order C, F
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py",
>> line 197, in runTest
>>     self.test(*self.arg)
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/core/tests/test_blasdot.py",
>> line 114, in test_dot_array_order
>>     assert_almost_equal(a.dot(a), a.T.dot(a.T).T, decimal=30)
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/testing/utils.py",
>> line 458, in assert_almost_equal
>>     return assert_array_almost_equal(actual, desired, decimal, err_msg)
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/testing/utils.py",
>> line 819, in assert_array_almost_equal
>>     header=('Arrays are not almost equal to %d decimals' % decimal))
>>   File
>> "/home/warren/local_numpy/lib/python2.7/site-packages/numpy/testing/utils.py",
>> line 652, in assert_array_compare
>>     raise AssertionError(msg)
>> AssertionError:
>> Arrays are not almost equal to 30 decimals
>>
>
> Thirty decimals? What architecture?
>


`decimal=30` is used in three places in numpy/core/tests/test_blasdot.py,
in the function `test_dot_array_order()`.  It looks like the argument
should be `decimal=prec`.

If I make that change, the above test passes, but I get a failure in a test
for array equality in the same function (lines 119-120):