[pypy-issue] [issue1733] numpy: bug. test_2d_w_missing gives incorrect results

lesshaste tracker at bugs.pypy.org
Sat Apr 12 10:33:03 CEST 2014


New submission from lesshaste <drraph at gmail.com>:

If you run 

np.test('test_2d_w_missing')

You get  "Arrays are not almost equal" failures.  For example

======================================================================
FAIL: Test cov 1 1D variable w/missing values
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/tests/test_extras.py",
line 574, in test_1d_w_missing
    assert_almost_equal(np.cov(nx, nx[::-1]), cov(x, x[::-1]))
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 158, in assert_almost_equal
    err_msg=err_msg, verbose=verbose)
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 224, in assert_array_almost_equal
    header='Arrays are not almost equal')
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 189, in assert_array_compare
    verbose=verbose, header=header)
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/testing/utils.py",
line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal

(mismatch 100.0%)
 x: array([[ 0.02492787, -0.00234864],
       [-0.00234864,  0.01556521]])
 y: array([[ 0.02464231, -0.00498551],
       [-0.01461801, -0.00223288]])
======================================================================
FAIL: Test cov on 2D variable w/ missing value
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/tests/test_extras.py",
line 589, in test_2d_w_missing
    np.cov(xf) * (x.shape[1] - 1) / (frac - 1.))
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 158, in assert_almost_equal
    err_msg=err_msg, verbose=verbose)
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 224, in assert_array_almost_equal
    header='Arrays are not almost equal')
  File
"/home/foo/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/ma/testutils.py",
line 189, in assert_array_compare
    verbose=verbose, header=header)
  File
"/home/raph/Downloads/pypy-2.3-alpha-20140405-linux_x86_64-portable/bin/my-env/site-packages/numpy/testing/utils.py",
line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal

(mismatch 100.0%)
 x: array([[ 0.0097693 ,  0.00435026, -0.03047703],
       [ 0.00051701, -0.03022188,  0.07877541],
       [-0.01996614,  0.0155907 , -0.01221537]])
 y: array([[ 0.05489846, -0.0785603 ,  0.00251277],
       [-0.0785603 ,  0.12726405, -0.01220223],
       [ 0.00251277, -0.01220223,  0.00545237]])

----------
messages: 6701
nosy: lesshaste, pypy-issue
priority: bug
status: unread
title: numpy: bug. test_2d_w_missing gives incorrect results

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1733>
________________________________________


More information about the pypy-issue mailing list