[Numpy-discussion] Numpy on Mac OS X python 2.6

Charles R Harris charlesr.harris@gmail....
Mon Nov 24 21:41:31 CST 2008


On Mon, Nov 24, 2008 at 8:18 PM, David Cournapeau <cournape@gmail.com>wrote:

> Hi,
>
> Following the discussion on python 2.6 support for numpy, I tried last
> svn on mac os X, and I get a number of failures which I don't
> understand, which seem to be linked to dtype code, more exactly to
> endianness:
>
>
> ======================================================================
> FAIL: test_basic (test_multiarray.TestClip)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/core/tests/test_multiarray.py",
> line 677, in test_basic
>    self._clip_type('float',1024,-12.8,100.2, inplace=inplace)
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/core/tests/test_multiarray.py",
> line 671, in _clip_type
>    assert_equal(x.dtype.byteorder,byteorder)
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/testing/utils.py",
> line 183, in assert_equal
>    raise AssertionError(msg)
> AssertionError:
> Items are not equal:
>  ACTUAL: '>'
>  DESIRED: '='
>
> ======================================================================
> FAIL: test_binary (test_multiarray.TestFromstring)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/core/tests/test_multiarray.py",
> line 120, in test_binary
>    assert_array_equal(a, array([1,2,3,4]))
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/testing/utils.py",
> line 303, in assert_array_equal
>    verbose=verbose, header='Arrays are not equal')
>  File
> "/Users/david/pylocal/lib/python2.6/site-packages/numpy/testing/utils.py",
> line 295, in assert_array_compare
>    raise AssertionError(msg)
> AssertionError:
> Arrays are not equal
>
> (mismatch 100.0%)
>  x: array([  4.60060299e-41,   8.96831017e-44,   2.30485571e-41,
>         4.60074312e-41], dtype=float32)
>  y: array([1, 2, 3, 4])
>

Sure enough, it's byteswapped. Is it correct that:

1) This problem is specific to 2.6 and 2.5 works.
2) It's on Intel hardware?

What about normal doubles, do they work?
Does python work?
Is it possible there are two versions of (python, lib,...), one for ppc and
the other for Intel that are getting confused?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081124/5f89f477/attachment-0001.html 


More information about the Numpy-discussion mailing list