[Numpy-discussion] test failure

Ralf Gommers ralf.gommers@googlemail....
Thu Oct 7 04:35:44 CDT 2010


On Sat, Oct 2, 2010 at 12:51 PM, John Mitchell <workalof@gmail.com> wrote:

> After spending a lot of time building 'numpy' (1.5.0) and 'scipy'  (0.8.0)
> I ran the following tests -- per what I read somewhere:
> numpy.test()
>
> Out of several thousand small tests I found this one error -- perhaps its
> not really an error?
>
>  This doesn't look serious but it can be bothersome when one is trying to
> be sure that the installation is as good as possible.
>

It's not a real problem, it only has to do with your printing precision. Is
it possible you set it to 4 in your interpreter before running the tests,
perhaps by running some other file? I can reproduce the exact errors with:

>>> np.set_printoptions(precision=4)
>>> np.test()

You can check the precision with np.get_printoptions(), it should be 8 by
default.

Ralf



>
> Not sure if it matters, but my compiler is gcc-4.4.1 and I'm using
> gfortran.  Both were wrapped with mpich2.
>
> Regards,
> John
>
>
> FAIL: test_doctests (test_polynomial.TestDocs)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 90, in test_doctests
>     return rundocs()
>   File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/testing/utils.py",
> line 962, in rundocs
>     raise AssertionError("Some doctests failed:\n%s" % "\n".join(msg))
> AssertionError: Some doctests failed:
> **********************************************************************
> File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 38, in test_polynomial
> Failed example:
>     p / q
> Expected:
>     (poly1d([ 0.33333333]), poly1d([ 1.33333333,  2.66666667]))
> Got:
>     (poly1d([ 0.333]), poly1d([ 1.333,  2.667]))
>
> **********************************************************************
> File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 60, in test_polynomial
> Failed example:
>     p.integ()
> Expected:
>     poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])
> Got:
>     poly1d([ 0.333,  1.   ,  3.   ,  0.   ])
>
> **********************************************************************
> File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 62, in test_polynomial
> Failed example:
>     p.integ(1)
> Expected:
>     poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])
> Got:
>     poly1d([ 0.333,  1.   ,  3.   ,  0.   ])
>
> **********************************************************************
> File
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 64, in test_polynomial
> Failed example:
>     p.integ(5)
> Expected:
>     poly1d([ 0.00039683,  0.00277778,  0.025     ,  0.        ,  0.
> ,
>             0.        ,  0.        ,  0.        ])
> Got:
>     poly1d([ 0.   ,  0.003,  0.025,  0.   ,  0.   ,  0.   ,  0.   ,  0.
> ])
>
> >>  raise AssertionError("Some doctests failed:\n%s" %
> "\n".join(['**********************************************************************\nFile
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 38, in test_polynomial\nFailed example:\n    p / q\nExpected:\n
> (poly1d([ 0.33333333]), poly1d([ 1.33333333,  2.66666667]))\nGot:\n
> (poly1d([ 0.333]), poly1d([ 1.333,  2.667]))\n',
> '**********************************************************************\nFile
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 60, in test_polynomial\nFailed example:\n    p.integ()\nExpected:\n
> poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])\nGot:\n
> poly1d([ 0.333,  1.   ,  3.   ,  0.   ])\n',
> '**********************************************************************\nFile
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 62, in test_polynomial\nFailed example:\n    p.integ(1)\nExpected:\n
> poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])\nGot:\n
> poly1d([ 0.333,  1.   ,  3.   ,  0.   ])\n',
> '**********************************************************************\nFile
> "/usr/local/python2.6.6/lib/python2.6/site-packages/numpy/lib/tests/test_polynomial.py",
> line 64, in test_polynomial\nFailed example:\n    p.integ(5)\nExpected:\n
> poly1d([ 0.00039683,  0.00277778,  0.025     ,  0.        ,  0.
> ,\n            0.        ,  0.        ,  0.        ])\nGot:\n    poly1d([
> 0.   ,  0.003,  0.025,  0.   ,  0.   ,  0.   ,  0.   ,  0.   ])\n']))
>
>
> ----------------------------------------------------------------------
> Ran 2966 tests in 9.896s
>
> FAILED (KNOWNFAIL=4, failures=1)
> <nose.result.TextTestResult run=2966 errors=0 failures=1>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20101007/1db3fe7e/attachment.html 


More information about the NumPy-Discussion mailing list