Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

mathieu_modsem2 test failure (Trac #1847) #2366

Closed
scipy-gitbot opened this Issue Apr 25, 2013 · 11 comments

Comments

Projects
None yet
1 participant

Original ticket http://projects.scipy.org/scipy/ticket/1847 on 2013-02-17 by @rgommers, assigned to @pv.

Just saw this with Python 3.3, 320bit Linux. Not sure yet if it reproduces on other versions:

======================================================================
FAIL: test_mathieu_modsem2 (test_basic.TestCephes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 582, in chk_same_position
    assert_array_equal(x_id, y_id)
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 719, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 645, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 0.4761904761904816%)
 x: array([[[False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False],...
 y: array([[[False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False],...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/scipy/special/tests/test_basic.py", line 445, in test_mathieu_modsem2
    assert_allclose(y1, y2, rtol=1e-10)
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 1179, in assert_allclose
    verbose=verbose, header=header)
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 608, in assert_array_compare
    chk_same_position(x_isnan, y_isnan, hasval='nan')
  File "/home/rgommers/.tox/scipy/py33/lib/python3.3/site-packages/numpy/testing/utils.py", line 588, in chk_same_position
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-10, atol=0

x and y nan location mismatch:
 x: array([[[ -6.374e+00,  -7.494e+00,  -8.815e+00,  -1.037e+01,  -1.221e+01,  -1.437e+01,
          -1.690e+01],
        [ -3.830e+00,  -4.472e+00,  -5.229e+00,  -6.116e+00,  -7.155e+00,  -8.364e+00,...
 y: array([[[ -6.374e+00,  -7.494e+00,  -8.815e+00,  -1.037e+01,  -1.221e+01,  -1.437e+01,
          -1.690e+01],
        [ -3.830e+00,  -4.472e+00,  -5.229e+00,  -6.116e+00,  -7.155e+00,  -8.364e+00,...

@pv wrote on 2013-02-18

May be a tolerance issue.

Unfortunately, the assert_allclose output is useless, so it's not possible to see this directly. This should maybe be fixed in Numpy.

@pv wrote on 2013-02-18

Ah oops, it says nan locations differ. Still, the test should probably use the machinery used in many other scipy.special tests, which makes seeing what actually fails possible...

@rgommers wrote on 2013-03-25

Hmm, can't reproduce this anymore after upgrading Ubuntu from 12.04 to 12.10. Can you reproduce it?

@rgommers wrote on 2013-03-28

Found one install again to reproduce this. Intermittently, there's a nan at the same location:

In [36]: y1[1, 9, 6]
Out[36]: nan

In [65]: cephes.mathieu_modsem2(m[1], q[0,9,0], -z[0,0,6])
Out[65]: (array([[ 0.14317429]]), array([[ 0.90178715]]))

In [66]: cephes.mathieu_modsem2(2, 100, -1)
Out[66]: (0.14317429130664511, 0.90178714503202273)

If I run special.test() everything works, while if I run the full scipy test suite it fails consistently. Extracting the failing test and running it as a script gives me a failure once every 10 runs or so.

Not sure how to debug this further, going to mark as knownfail on 0.12.x

@pv wrote on 2013-03-28

Sounds like an uninitialized variable somewhere. Need to check Valgrind + check warnings from C compiler.

Milestone changed to 0.13.0 by @pv on 2013-03-28

@pv wrote on 2013-03-28

Ok, found the bug, PR in a moment.

@rgommers wrote on 2013-03-28

great

@pv wrote on 2013-03-28

PR #489

Should be safe to backport, IMHO.

@rgommers wrote on 2013-03-29

PR merged, and backported to 0.12.x in 0476cae

Milestone changed to 0.12.0 by @rgommers on 2013-03-29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment