[Numpy-discussion] Test failures on FreeBSD buildbot

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Jul 27 23:16:22 CDT 2009


Charles R Harris wrote:
>
>
> On Mon, Jul 27, 2009 at 9:37 PM, David Cournapeau <cournape@gmail.com
> <mailto:cournape@gmail.com>> wrote:
>
>     On Tue, Jul 28, 2009 at 8:44 AM, Charles R
>     Harris<charlesr.harris@gmail.com
>     <mailto:charlesr.harris@gmail.com>> wrote:
>
>     > ERROR: test_nan_items (test_utils.TestApproxEqual)
>     >
>     ----------------------------------------------------------------------
>     > Traceback (most recent call last):
>     >   File
>     >
>     "/tmp/numpy-buildbot/b12/numpy-install/lib/python2.5/site-packages/numpy/testing/tests/test_utils.py",
>     > line 248, in test_nan_items
>     >
>     >     self._assert_func(anan, anan)
>     >   File
>     >
>     "../numpy-install/lib/python2.5/site-packages/numpy/testing/utils.py",
>     line
>     > 433, in assert_approx_equal
>     > ValueError: math domain error
>     >
>     >
>     ----------------------------------------------------------------------
>     >
>     > Ran 2177 tests in 30.179s
>     >
>     >
>     > I expect there is a problem with the FreeBSD math libraries.
>
>     Actually, I am surprised it did not fail on Linux/Windows/Mac OS X :)
>     Reading the code for assert_approx_equal, using log/pow functions
>     nan should produce this error. I will work on a fix,
>
>
> Yeah, the function is kind of a mess.

Yes - I am afraid I have added to the mess with my nan/inf handling :( I
tried reimplementing from a clean state, but quite a few unit tests
depend on some 'obscure' features. For example, do we really want
assert_array_equal(np.array([1, 1]), 1) to be true ? I understand it is
handy, but it can hide bugs, and it makes writing the function more
complicated (as you can't check that both arrays have the same shape,
and covering every corner case with handling scalar/scalar arrays/arrays
is difficult).

I am also concerned with speed issues (they are likely to be a
bottleneck in many unit tests).

> I think most of the math can be avoided.

Do you know of a way to avoid log/pow for approx equal ?

cheers,

David


More information about the NumPy-Discussion mailing list