8000 1.7.0b1 - Unittest errors building on Debian powerpc · Issue #411 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

1.7.0b1 - Unittest errors building on Debian powerpc #411

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandrotosi opened this issue Sep 1, 2012 · 27 comments
Closed

1.7.0b1 - Unittest errors building on Debian powerpc #411

sandrotosi opened this issue Sep 1, 2012 · 27 comments

Comments

@sandrotosi
Copy link
Contributor

Hello,
when building 1.7.0b1 on Debian unstable powerpc the tests suite returns some error:

-- running tests for 2.7 plain --
.............................................................................................................................................................................................................E.............................................................................................S...................................................................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS..............................................................................................................................................................................................................................................................................E.........................K.................
8000
.....K............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
ERROR: test_singleton (test_getlimits.TestLongdouble)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_getlimits.py", line 38, in test_singleton
    ftype = finfo(longdouble)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
ERROR: Failure: RuntimeWarning (overflow encountered in add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 833, in <module>
    class TestComplexFunctions(object):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 1019, in TestComplexFunctions
    @dec.knownfailureif(is_longdouble_finfo_bogus(), "Bogus long double finfo")
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 829, in is_longdouble_finfo_bogus
    info = np.finfo(np.longcomplex)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4692 tests in 40.433s

FAILED (KNOWNFAIL=4, SKIP=5, errors=2, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b1
NumPy is installed in /build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy
Python version 2.7.3 (default, Aug 26 2012, 14:59:52) [GCC 4.6.3]
nose version 1.1.2
-- running tests for 2.7 debug --
.............................................................................................................................................................................................................E.............................................................................................S...................................................................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS..............................................................................................................................................................................................................................................................................E.........................K......................K............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
ERROR: test_singleton (test_getlimits.TestLongdouble)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_getlimits.py", line 38, in test_singleton
    ftype = finfo(longdouble)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
ERROR: Failure: RuntimeWarning (overflow encountered in add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 833, in <module>
    class TestComplexFunctions(object):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 1019, in TestComplexFunctions
    @dec.knownfailureif(is_longdouble_finfo_bogus(), "Bogus long double finfo")
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py", line 829, in is_longdouble_finfo_bogus
    info = np.finfo(np.longcomplex)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4692 tests in 114.895s

FAILED (KNOWNFAIL=4, SKIP=5, errors=2, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b1
NumPy is installed in /build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.7/dist-packages/numpy
Python version 2.7.3 (default, Aug 26 2012, 14:01:10) [GCC 4.6.3]
nose version 1.1.2
[1474985 refs]
-- running tests for 2.6 plain --
.............................................................................................................................................................................................................E.............................................................................................S...................................................................................................................................S......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K.........................................................................................................................................................................................SSS..............................................................................................................................................................................................................................................................................E.........................K......................K............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
ERROR: test_singleton (test_getlimits.TestLongdouble)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_getlimits.py", line 38, in test_singleton
    ftype = finfo(longdouble)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
ERROR: Failure: RuntimeWarning (overflow encountered in add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.6/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.6/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 833, in <module>
    class TestComplexFunctions(object):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 1019, in TestComplexFunctions
    @dec.knownfailureif(is_longdouble_finfo_bogus(), "Bogus long double finfo")
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 829, in is_longdouble_finfo_bogus
    info = np.finfo(np.longcomplex)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

----------------------------------------------------------------------
Ran 4692 tests in 40.272s

FAILED (KNOWNFAIL=4, SKIP=5, errors=2)
Running unit tests for numpy
NumPy version 1.7.0b1
NumPy is installed in /build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy
Python version 2.6.8 (unknown, Jun 25 2012, 22:41:43) [GCC 4.6.3]
nose version 1.1.2
-- running tests for 2.6 debug --
.............................................................................................................................................................................................................E.............................................................................................S...................................................................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS..............................................................................................................................................................................................................................................................................E.........................K......................K............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
ERROR: test_singleton (test_getlimits.TestLongdouble)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/
8000
core/tests/test_getlimits.py", line 38, in test_singleton
    ftype = finfo(longdouble)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
ERROR: Failure: RuntimeWarning (overflow encountered in add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.6/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.6/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 833, in <module>
    class TestComplexFunctions(object):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 1019, in TestComplexFunctions
    @dec.knownfailureif(is_longdouble_finfo_bogus(), "Bogus long double finfo")
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py", line 829, in is_longdouble_finfo_bogus
    info = np.finfo(np.longcomplex)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4692 tests in 105.265s

FAILED (KNOWNFAIL=4, SKIP=5, errors=2, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b1
NumPy is installed in /build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python2.6/dist-packages/numpy
Python version 2.6.8 (unknown, Jun 25 2012, 23:41:12) [GCC 4.6.3]
nose version 1.1.2
[1458442 refs]
# Python 3.2 maps to python3/ dir alone? bah
for v in 3.2 ; do \
        echo "-- running tests for "$v" plain --" ; \
        python$v -c "import sys ; sys.path.insert(0, '/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test()" ; \
        echo "-- running tests for "$v" debug --" ; \
        python$v-dbg -c "import sys ; sys.path.insert(0, '/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test()" ; \
    done
-- running tests for 3.2 plain --
/usr/lib/python3/dist-packages/nose/core.py:247: ResourceWarning: unclosed file <_io.TextIOWrapper name='/usr/lib/python3/dist-packages/nose/usage.txt' mode='r' encoding='ANSI_X3.4-1968'>
  os.path.dirname(__file__), 'usage.txt'), 'r').read()
.............................................................................................................................................................................................................E.............................................................................................S...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS..........................................................................................K...................................................................................................................................................................................E.........................K......................K................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................/usr/lib/python3.2/zipfile.py:1317: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmplu5hdb.npz'>
  self.fp = None
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
ERROR: test_singleton (test_getlimits.TestLongdouble)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_getlimits.py", line 38, in test_singleton
    ftype = finfo(longdouble)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
ERROR: Failure: RuntimeWarning (overflow encountered in add)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 37, in runTest
    raise self.exc_class(self.exc_val).with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_umath.py", line 833, in <module>
    class TestComplexFunctions(object):
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_umath.py", line 1019, in TestComplexFunctions
    @dec.knownfailureif(is_longdouble_finfo_bogus(), "Bogus long double finfo")
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_umath.py", line 829, in is_longdouble_finfo_bogus
    info = np.finfo(np.longcomplex)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/getlimits.py", line 119, in __new__
    obj = object.__new__(cls)._init(dtype)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/getlimits.py", line 149, in _init
    'numpy %s precision floating point number' % precname)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py", line 110, in __init__
    self._do_init(float_conv, int_conv, float_to_float, float_to_str, title)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py", line 125, in _do_init
    a = a + a
RuntimeWarning: overflow encountered in add

======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4691 tests in 51.947s

FAILED (KNOWNFAIL=5, SKIP=4, errors=2, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b1
NumPy is installed in /build/buildd-python-numpy_1.7.0~b1-1-powerpc-b8azze/python-numpy-1.7.0~b1/debian/tmp/usr/lib/python3/dist-packages/numpy
Python version 3.2.3 (default, Jul 14 2012, 00:40:39) [GCC 4.6.3]
nose version 1.1.2
-- running tests for 3.2 debug --
/usr/lib/python3/dist-packages/nose/core.py:247: ResourceWarning: unclosed file <_io.TextIOWrapper name='/usr/lib/python3/dist-packages/nose/usage.txt' mode='r' encoding='ANSI_X3.4-1968'>
  os.path.dirname(__file__), 'usage.txt'), 'r').read()
..........................................................................................................................python3.2-dbg: numpy/core/src/multiarray/common.c:161: PyArray_DTypeFromObjectHelper: Assertion `((((((PyObject*)(temp))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed.
Aborted

Full build log is available at: https://buildd.debian.org/status/fetch.php?pkg=python-numpy&arch=powerpc&ver=1%3A1.7.0~b1-1&stamp=1346419716

Regards,
Sandro

@sandrotosi
Copy link
Contributor Author

With beta2 some more ResourceWarning but less failure have arrived:

-- running tests for 2.7 plain --
............................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:125: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:127: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:136: RuntimeWarning: invalid value encountered in subtract
  itemp = int_conv(temp-a)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:160: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:162: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:169: RuntimeWarning: invalid value encountered in subtract
  if any(temp-a != zero):
..............................................................................................S...................................................................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS.................................................................................................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py:830: RuntimeWarning: invalid value encountered in log10
  return not np.isfinite(np.log10(info.tiny/info.eps))
.................................K...K..............................................................K..K..............................K......................K..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 90.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4808 tests in 43.134s

FAILED (KNOWNFAIL=8, SKIP=5, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b2
NumPy is installed in /build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy
Python version 2.7.3 (default, Sep 10 2012, 00:00:47) [GCC 4.6.3]
nose version 1.1.2
1
-- running tests for 2.7 debug --
............................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:125: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:127: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:136: RuntimeWarning: invalid value encountered in subtract
  itemp = int_conv(temp-a)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:160: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:162: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/machar.py:169: RuntimeWarning: invalid value encountered in subtract
  if any(temp-a != zero):
..............................................................................................S...................................................................................................................................S......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K.........................................................................................................................................................................................SSS.................................................................................................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py:830: RuntimeWarning: invalid value encountered in log10
  return not np.isfinite(np.log10(info.tiny/info.eps))
.................................K...K............................................./build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py:139: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, 0+1j), cnan)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py:143: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, -p), cnan)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy/core/tests/test_umath.py:144: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, -1+0.2j), cnan)
.................K..K..............................K......................K..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
----------------------------------------------------------------------
Ran 4808 tests in 138.402s

OK (KNOWNFAIL=8, SKIP=5)
Running unit tests for numpy
NumPy version 1.7.0b2
NumPy is installed in /build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.7/dist-packages/numpy
Python version 2.7.3 (default, Sep  9 2012, 23:32:33) [GCC 4.6.3]
nose version 1.1.2
1
[1532321 refs]
-- running tests for 2.6 plain --
............................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:125: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:127: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:136: RuntimeWarning: invalid value encountered in subtract
  itemp = int_conv(temp-a)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:160: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:162: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:169: RuntimeWarning: invalid value encountered in subtract
  if any(temp-a != zero):
..............................................................................................S...................................................................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS.................................................................................................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py:830: RuntimeWarning: invalid value encountered in log10
  return not np.isfinite(np.log10(info.tiny/info.eps))
.................................K...K..............................................................K..K..............................K......................K..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4808 tests in 42.676s

FAILED (KNOWNFAIL=8, SKIP=5, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b2
NumPy is installed in /build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy
Python version 2.6.8 (unknown, Jun 25 2012, 22:41:43) [GCC 4.6.3]
nose version 1.1.2
1
-- running tests for 2.6 debug --
............................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:125: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:127: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:136: RuntimeWarning: invalid value encountered in subtract
  itemp = int_conv(temp-a)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:160: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:162: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/machar.py:169: RuntimeWarning: invalid value encountered in subtract
  if any(temp-a != zero):
..............................................................................................S...................................................................................................................................S..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
8000
..............................................................................................................................................F.............................................................................................................K.........................................................................................................................................................................................SSS.................................................................................................................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py:830: RuntimeWarning: invalid value encountered in log10
  return not np.isfinite(np.log10(info.tiny/info.eps))
.................................K...K............................................./build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py:139: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, 0+1j), cnan)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py:143: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, -p), cnan)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_umath.py:144: RuntimeWarning: invalid value encountered in power
  assert_complex_equal(np.power(zero, -1+0.2j), cnan)
.................K..K..............................K......................K..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
======================================================================
FAIL: test_nditer.test_iter_buffered_cast_byteswapped_complex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/core/tests/test_nditer.py", line 1651, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 256, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 718, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

----------------------------------------------------------------------
Ran 4808 tests in 126.786s

FAILED (KNOWNFAIL=8, SKIP=5, failures=1)
Running unit tests for numpy
NumPy version 1.7.0b2
NumPy is installed in /build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python2.6/dist-packages/numpy
Python version 2.6.8 (unknown, Jun 25 2012, 23:41:12) [GCC 4.6.3]
nose version 1.1.2
1
[1515975 refs]
# Python 3.2 maps to python3/ dir alone? bah
for v in 3.2 ; do \
        echo "-- running tests for "$v" plain --" ; \
        python$v -c "import sys ; sys.path.insert(0, '/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test()" ; \
        echo "-- running tests for "$v" debug --" ; \
        python$v-dbg -c "import sys ; sys.path.insert(0, '/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test()" ; \
    done
-- running tests for 3.2 plain --
/usr/lib/python3/dist-packages/nose/core.py:247: ResourceWarning: unclosed file <_io.TextIOWrapper name='/usr/lib/python3/dist-packages/nose/usage.txt' mode='r' encoding='ANSI_X3.4-1968'>
  os.path.dirname(__file__), 'usage.txt'), 'r').read()
..........................................................................................................................................................................S.................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:125: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:127: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:136: RuntimeWarning: invalid value encountered in subtract
  itemp = int_conv(temp-a)
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:160: RuntimeWarning: overflow encountered in add
  a = a + a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:162: RuntimeWarning: invalid value encountered in subtract
  temp1 = temp - a
/build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/machar.py:169: RuntimeWarning: invalid value encountered in subtract
  if any(temp-a != zero):
..............................................................................................S.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K.........................................................................................................................................................................................SSS............................................................................................K....................................................................................................................................................................................../build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy/core/tests/test_umath.py:830: RuntimeWarning: invalid value encountered in log10
  return not np.isfinite(np.log10(info.tiny/info.eps))
.................................K...K..............................................................K..K..............................K......................K................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................../usr/lib/python3.2/zipfile.py:1317: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp_6g466.npz'>
  self.fp = None
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K....................................................
----------------------------------------------------------------------
Ran 4807 tests in 48.664s

OK (KNOWNFAIL=9, SKIP=5)
Running unit tests for numpy
NumPy version 1.7.0b2
NumPy is installed in /build/buildd-python-numpy_1.7.0~b2-1-powerpc-J1PqbS/python-numpy-1.7.0~b2/debian/tmp/usr/lib/python3/dist-packages/numpy
Python version 3.2.3 (default, Aug 26 2012, 22:32:58) [GCC 4.6.3]
nose version 1.1.2
1
-- running tests for 3.2 debug --
/usr/lib/python3/dist-packages/nose/core.py:247: ResourceWarning: unclosed file <_io.TextIOWrapper name='/usr/lib/python3/dist-packages/nose/usage.txt' mode='r' encoding='ANSI_X3.4-1968'>
  os.path.dirname(__file__), 'usage.txt'), 'r').read()
..........................................................................................................................python3.2-dbg: numpy/core/src/multiarray/common.c:161: PyArray_DTypeFromObjectHelper: Assertion `((((((PyObject*)(temp))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed.
Aborted

Full build log at: https://buildd.debian.org/status/fetch.php?pkg=python-numpy&arch=powerpc&ver=1%3A1.7.0~b2-1&stamp=1348947690

@certik
Copy link
Contributor
certik commented Nov 14, 2012

The last abort was fixed by 5ae12ea, but the AssertionError: Arrays are not equal look like genuine failures.

@sandrotosi, is there any chance for me to get access to this machine and debug it? Any ideas what could cause those errors?

@rgommers
Copy link
Member

Agree that this last remaining failure is not release critical.

@certik
Copy link
Contributor
certik commented Dec 16, 2012

Ok, I am clearing the milestone.

@sandrotosi
Copy link
Contributor Author

just to confirm the same failures happen with RC1

@sandrotosi
Copy link
Contributor Author

I've asked the installation of the needed depends on this achitecture Debian porterbox; after that, I can try to debug the problem, but I don't know if I can get to something useful; @certik if you prefer, you can ask for access to Debian machine following the steps at http://dsa.debian.org/doc/guest-account/ (of course I'll happily sponsor you).

@sandrotosi
Copy link
Contributor Author

Ok, so I did some tests: on my machine (amd64) I have this output:

In [5]: a = np.arange(10, dtype=np.clongdouble).newbyteorder().byteswap()

In [6]: a
Out[6]: 
array([ 0.0+1.0869577e-4943j,  1.0+1.0869577e-4943j,  2.0+0.0j,  3.0+0.0j,
        4.0+0.0j,  5.0+0.0j,  6.0+0.0j,  7.0+0.0j,  8.0+0.0j,  9.0+0.0j], dtype=complex256)

In [7]: a += 2j

In [8]: a
Out[8]: 
array([ 0.0+5.9722949e-4947j,  1.0+5.9722949e-4947j,  2.0+5.9722949e-4947j,
        3.0+5.9722949e-4947j,  4.0+5.9722949e-4947j,  5.0+5.9722949e-4947j,
        6.0+5.9722949e-4947j,  7.0+5.9722949e-4947j,  8.0+5.9722949e-4947j,
        9.0+5.9722949e-4947j], dtype=complex256)

but running the same code on the powerpc machine I got:

a:  [ 0.0+0.0j  1.0+0.0j  2.0+0.0j  3.0+0.0j  4.0+0.0j  5.0+0.0j  6.0+0.0j
  7.0+0.0j  8.0+0.0j  9.0+0.0j]
a + 2j: [ 0.0+3.1620201e-322j  2.7369744e-303+3.1620201e-322j
  2.8480945e-306+3.1620201e-322j  9.398712e-305+3.1620201e-322j
  1.8512615e-304+3.1620201e-322j  2.3069566e-304+3.1620201e-322j
  2.7626517e-304+3.1620201e-322j  3.2183468e-304+3.1620201e-322j
  3.674042e-304+3.1620201e-322j  3.9018895e-304+3.1620201e-322j]

which are, well, quite different :) and the tests confirms it. I don't know how to debug it further: do you have something in mind that I can run on this machine to understand why it's happening?

@seberg
Copy link
Member
seberg commented Jan 1, 2013

@sandrotosi but both are just nonsense. It seems like the printing for the imaginary part got mumbled up somewhere badly (its ok in 1.6.) and maybe it reads all a byte shifted or so for this printing. If you can maybe check this for the powerpc too (though I doubt its necessary to be honest), in your example if you check a.imag the result is fully correct. (Just to note, I am not checking this out further for now, but it sounds like it should be bisected?)

Edit: ah, for the powerpc, also the real printing is messed up, but maybe there its also just the printing, and it just happens to not effect the other for these small numbers.

@sandrotosi
Copy link
Contributor Author

@seberg indeed (I was just reporting what I had found until then), but it could still mean there's some other thing going fishing; just re-attaching printing a.imag:

amd64:

In [5]: a = np.arange(10, dtype=np.clongdouble).newbyteorder().byteswap()

In [6]: a
Out[6]: 
array([ 0.0+1.2613487e-4943j,  1.0+1.2613487e-4943j,  2.0+0.0j,  3.0+0.0j,
        4.0+0.0j,  5.0+0.0j,  6.0+0.0j,  7.0+0.0j,  8.0+0.0j,  9.0+0.0j], dtype=complex256)

In [7]: a.imag
Out[7]: array([ 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0], dtype=float128)

In [8]: a += 2j

In [9]: a
Out[9]: 
array([ 0.0+5.9722949e-4947j,  1.0+5.9722949e-4947j,  2.0+5.9722949e-4947j,
        3.0+5.9722949e-4947j,  4.0+5.9722949e-4947j,  5.0+5.9722949e-4947j,
        6.0+5.9722949e-4947j,  7.0+5.9722949e-4947j,  8.0+5.9722949e-4947j,
        9.0+5.9722949e-4947j], dtype=complex256)

In [10]: a.imag
Out[10]: array([ 2.0,  2.0,  2.0,  2.0,  2.0,  2.0,  2.0,  2.0,  2.0,  2.0], dtype=float128)

powerpc:

a: [ 0.0+0.0j  1.0+0.0j  2.0+0.0j  3.0+0.0j  4.0+0.0j  5.0+0.0j  6.0+0.0j
  7.0+0.0j  8.0+0.0j  9.0+0.0j]
a.imag: [ 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
a + 2j: [ 0.0+3.1620201e-322j  2.7369744e-303+3.1620201e-322j
  2.8480945e-306+3.1620201e-322j  9.398712e-305+3.1620201e-322j
  1.8512615e-304+3.1620201e-322j  2.3069566e-304+3.1620201e-322j
  2.7626517e-304+3.1620201e-322j  3.2183468e-304+3.1620201e-322j
  3.674042e-304+3.1620201e-322j  3.9018895e-304+3.1620201e-322j]
a + 2j .imag: [ 2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0]
i:  <numpy.nditer object at 0x10c164f0>
0-th v: [  0.00000000e+000+4.j   6.07730388e-319+4.j   6.32404027e-322+4.j]
1-th v: [  2.08693329e-320+4.j   4.11062617e-320+4.j   5.12247262e-320+4.j]
2-th v: [  6.13431906e-320+4.j   7.14616550e-320+4.j   8.15801194e-320+4.j]
3-th v: [  8.66393517e-320+4.j]
compare:  [ 0.0+4.0j  2.0+4.0j  4.0+4.0j  6.0+4.0j  8.0+4.0j  10.0+4.0j  12.0+4.0j
  14.0+4.0j  16.0+4.0j  18.0+4.0j]
Traceback (most recent call last):
  File "issue411.py", line 25, in <module>
    test_iter_buffered_cast_byteswapped_complex()
  File "issue411.py", line 23, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 90.0%)
 x: array([ 0.0+2.0553131e-320j,  5.4739487e-303+2.0553131e-320j,
        5.6961891e-306+2.0553131e-320j,  1.8797424e-304+2.0553131e-320j,
        3.7025229e-304+2.0553131e-320j,  4.6139132e-304+2.0553131e-320j,...
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

@certik
Copy link
Contributor
certik commented Jan 4, 2013

Thanks @sandrotosi for debugging it. Typically these things happen when there is some improper handling of the byteorder (swap) inside numpy, we had a similar problem in unicode + python 3.3. However, I would need access to powerpc to debug it.

@rgommers, @charris, @njsmith --- do you think we should fix this before the final release, or let it be?
I am currently working on the casting issues, as that is very important. I personally don't want to hold the release any further. @sandrotosi --- how painful it is if these tests fail on powerpc for Debian? One solution is to disable the failing tests like we did in the other issue, until this gets fixed.

I put the 1.7 milestone on it so that we don't forget it.

@rgommers
Copy link
Member
rgommers commented Jan 4, 2013

I'd say it's nice to get fixed but not a blocker.

@seberg
Copy link
Member
seberg commented Jan 5, 2013

I don't know if this is a blocker, since it only affects a rare and non native byteorder datatype, but my guess is, that the non-powerpc failures are likely directly related and it is not quite limited to printing, so its possible to start debuggin without powerpc:

In [13]: np.arange(10, dtype=np.clongdouble).newbyteorder().byteswap().item(0).imag
Out[13]: 1.2422373419115392489e-4943

I wanted to bisect it since it seems to work OK in my numpy 1.6.2, but had problems with the bisecting...

@seberg
Copy link
Member
seberg commented Jan 5, 2013

Ok, I have bisected the non-powerpc and the result is:
The first bad commit could be any of: 9897d95 f6a2c7c 6bde534

having a look at those, but probably not for long.

@seberg
Copy link
Member
seberg commented Jan 5, 2013

Ok.... I have tracked it down I think, however I have no clue whatsoever what those commits actually changed that have anything to do with it (unless for some reason that code never got executed before?!) and I will leave that for someone else to figure out (and best write tests :-))

--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -1825,7 +1825,7 @@ static void
                 *a++ = *b;
                 *b-- = c;
             }
-            a += nn / 2;
+            a += nn;
             b = a + (NPY_SIZEOF_@fsize@ - 1);
             nn = NPY_SIZEOF_@fsize@ / 2;
             for (i = 0; i < nn; i++) {

The division by two is wrong here. nn is already half the floating size, a already is incremented by nn, but we need to increment by another nn to increment it overall by the floating size (half the complex size).

@sandrotosi maybe you can check if this also fixes all of the powerpc failures? Though I am only half confident, since on first sight that change probably only effects scalars and the failing test seems likely not only scalars.

@charris
Copy link
Member
charris commented Jan 5, 2013

Man, there really was a pony under there ;)

@sandrotosi
Copy link
Contributor Author

@seberg thanks for bisect it! I've tried it on the powerpc machine, but sadly it didn't fix it:

a: [ 0.0+0.0j  1.0+0.0j  2.0+0.0j  3.0+0.0j  4.0+0.0j  5.0+0.0j  6.0+0.0j
  7.0+0.0j  8.0+0.0j  9.0+0.0j]
a.imag: [ 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
a + 2j: [ 0.0+2.0j  2.7369744e-303+2.0j  2.8480945e-306+2.0j  9.398712e-305+2.0j
  1.8512615e-304+2.0j  2.3069566e-304+2.0j  2.7626517e-304+2.0j
  3.2183468e-304+2.0j  3.674042e-304+2.0j  3.9018895e-304+2.0j]
a + 2j .imag: [ 2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0]
i:  <numpy.nditer object at 0x10c564f0>
0-th v: [  0.00000000e+000+4.j   6.07730388e-319+4.j   6.32404027e-322+4.j]
1-th v: [  2.08693329e-320+4.j   4.11062617e-320+4.j   5.12247262e-320+4.j]
2-th v: [  6.13431906e-320+4.j   7.14616550e-320+4.j   8.15801194e-320+4.j]
3-th v: [  8.66393517e-320+4.j]
compare:  [ 0.0+4.0j  2.0+4.0j  4.0+4.0j  6.0+4.0j  8.0+4.0j  10.0+4.0j  12.0+4.0j
  14.0+4.0j  16.0+4.0j  18.0+4.0j]
Traceback (most recent call last):
  File "issue411.py", line 25, in <module>
    test_iter_buffered_cast_byteswapped_complex()
  File "issue411.py", line 23, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+4.0j,  5.4739487e-303+4.0j,  5.6961891e-306+4.0j,
        1.8797424e-304+4.0j,  3.7025229e-304+4.0j,  4.6139132e-304+4.0j,
        5.5253034e-304+4.0j,  6.4366937e-304+4.0j,  7.3480839e-304+4.0j,
        7.803779e-304+4.0j], dtype=complex256)
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

@certik I do agree with @rgommers that it would be nice to have it fixed, but it should not diverge too much energy from the actual release; I can live with it failing or I'll just skip() it using the platform.machine() or similar. About having access to the machine, please have a look at #411 (comment)

@certik
Copy link
Contributor
certik commented Jan 5, 2013

Thanks @seberg! Great job. @sandrotosi, yes I should renew my NM process. In fact I am almost done, but I got really busy and didn't have time to finish it yet.

@charris
Copy link
Member
charris commented Jan 6, 2013

Sandro, could you print out as strings the results of newbyteorder and byteswap applied separately? Maybe we can see what's going on with the bytes. You could also cheat by defining a special complex by

In [8]: cstr = arange(16, dtype=int8).tostring()

In [9]: c = fromstring(cstr)

and making arrays of that to make the results easier to understand.

@sandrotosi
Copy link
Contributor Author

@charris if I understand correctly what you asked (I simply defined first and arange() than called on it the newbyteorder() and then on the result the byteswap() ) here's the output

a arange: [ 0.0+0.0j  1.0+0.0j  2.0+0.0j  3.0+0.0j  4.0+0.0j  5.0+0.0j  6.0+0.0j
  7.0+0.0j  8.0+0.0j  9.0+0.0j]
a newbyteorder: [ 0.0+0.0j  3.0386519e-319+0.0j  3.1620201e-322+0.0j  1.0434666e-320+0.0j
  2.0553131e-320+0.0j  2.5612363e-320+0.0j  3.0671595e-320+0.0j
  3.5730828e-320+0.0j  4.079006e-320+0.0j  4.3319676e-320+0.0j]
a byteswap: [ 0.0+0.0j  1.0+0.0j  2.0+0.0j  3.0+0.0j  4.0+0.0j  5.0+0.0j  6.0+0.0j
  7.0+0.0j  8.0+0.0j  9.0+0.0j]
a.imag: [ 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
a + 2j: [ 0.0+2.0j  2.7369744e-303+2.0j  2.8480945e-306+2.0j  9.398712e-305+2.0j
  1.8512615e-304+2.0j  2.3069566e-304+2.0j  2.7626517e-304+2.0j
  3.2183468e-304+2.0j  3.674042e-304+2.0j  3.9018895e-304+2.0j]
a + 2j .imag: [ 2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0]
i:  <numpy.nditer object at 0x10b8c4f0>
0-th v: [  0.00000000e+000+4.j   6.07730388e-319+4.j   6.32404027e-322+4.j]
1-th v: [  2.08693329e-320+4.j   4.11062617e-320+4.j   5.12247262e-320+4.j]
2-th v: [  6.13431906e-320+4.j   7.14616550e-320+4.j   8.15801194e-320+4.j]
3-th v: [  8.66393517e-320+4.j]
compare:  [ 0.0+4.0j  2.0+4.0j  4.0+4.0j  6.0+4.0j  8.0+4.0j  10.0+4.0j  12.0+4.0j
  14.0+4.0j  16.0+4.0j  18.0+4.0j]
Traceback (most recent call last):
  File "issue411.py", line 29, in <module>
    test_iter_buffered_cast_byteswapped_complex()
  File "issue411.py", line 27, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 90.0%)
 x: array([ 0.0+4.0j,  5.4739487e-303+4.0j,  5.6961891e-306+4.0j,
        1.8797424e-304+4.0j,  3.7025229e-304+4.0j,  4.6139132e-304+4.0j,
        5.5253034e-304+4.0j,  6.4366937e-304+4.0j,  7.3480839e-304+4.0j,
        7.803779e-304+4.0j], dtype=complex256)
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

@charris
Copy link
Member
charris commented Jan 9, 2013

On Wed, Jan 9, 2013 at 4:14 PM, Sandro Tosi notifications@github.comwrote:

@charris https://github.com/charris if I understand correctly what you
asked (I simply defined first and arange() than called on it the
newbyteorder() and then on the result the byteswap() ) here's the output

a arange: [ 0.0+0.0j 1.0+0.0j 2.0+0.0j 3.0+0.0j 4.0+0.0j 5.0+0.0j 6.0+0.0j
7.0+0.0j 8.0+0.0j 9.0+0.0j]
a newbyteorder: [ 0.0+0.0j 3.0386519e-319+0.0j 3.1620201e-322+0.0j 1.0434666e-320+0.0j
2.0553131e-320+0.0j 2.5612363e-320+0.0j 3.0671595e-320+0.0j
3.5730828e-320+0.0j 4.079006e-320+0.0j 4.3319676e-320+0.0j]
a byteswap: [ 0.0+0.0j 1.0+0.0j 2.0+0.0j 3.0+0.0j 4.0+0.0j 5.0+0.0j 6.0+0.0j
7.0+0.0j 8.0+0.0j 9.0+0.0j]
a.imag: [ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0]
a + 2j: [ 0.0+2.0j 2.7369744e-303+2.0j 2.8480945e-306+2.0j 9.398712e-305+2.0j
1.8512615e-304+2.0j 2.3069566e-304+2.0j 2.7626517e-304+2.0j
3.2183468e-304+2.0j 3.674042e-304+2.0j 3.9018895e-304+2.0j]
a + 2j .imag: [ 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0]
i: <numpy.nditer object at 0x10b8c4f0>
0-th v: [ 0.00000000e+000+4.j 6.07730388e-319+4.j 6.32404027e-322+4.j]
1-th v: [ 2.08693329e-320+4.j 4.11062617e-320+4.j 5.12247262e-320+4.j]
2-th v: [ 6.13431906e-320+4.j 7.14616550e-320+4.j 8.15801194e-320+4.j]
3-th v: [ 8.66393517e-320+4.j]
compare: [ 0.0+4.0j 2.0+4.0j 4.0+4.0j 6.0+4.0j 8.0+4.0j 10.0+4.0j 12.0+4.0j
14.0+4.0j 16.0+4.0j 18.0+4.0j]
Traceback (most recent call last):
File "issue411.py", line 29, in
test_iter_buffered_cast_byteswapped_complex()
File "issue411.py", line 27, in test_iter_buffered_cast_byteswapped_complex
assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
File "/home/morph/python-numpy-1.7.0rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
return assert_array_equal(actual, desired, err_msg, verbose)
File "/home/morph/python-numpy-1.7.0
rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
verbose=verbose, header='Arrays are not equal')
File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 90.0%)
x: array([ 0.0+4.0j, 5.4739487e-303+4.0j, 5.6961891e-306+4.0j,
1.8797424e-304+4.0j, 3.7025229e-304+4.0j, 4.6139132e-304+4.0j,
5.5253034e-304+4.0j, 6.4366937e-304+4.0j, 7.3480839e-304+4.0j,
7.803779e-304+4.0j], dtype=complex256)
y: array([ 0.0+4.0j, 2.0+4.0j, 4.0+4.0j, 6.0+4.0j, 8.0+4.0j, 10.0+4.0j,
12.0+4.0j, 14.0+4.0j, 16.0+4.0j, 18.0+4.0j], dtype=complex256)

Actually, I wanted to see them as strings so as to see which bytes ended
up where. So something like:

In [5]: s = arange(16, dtype=int8).tostring()

In [6]: c = fromstring(s, dtype=complex128)

In [7]: c.newbyteorder().tostring()
Out[7]: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

In [8]: c.newbyteorder().byteswap().tostring()
Out[8]: '\x07\x06\x05\x04\x03\x02\x01\x00\x0f\x0e\r\x0c\x0b\n\t\x08'

You should be able to do that up to a range of 256, so 16 different complex
in total, but the printout will have a lot of letters and punctuation. You
can get better looking printout using

#convert string to hexdef toHex(s):
lst = []
for ch in s:
hv = hex(ord(ch)).replace('0x', '')
if len(hv) == 1:
hv = '0'+hv
lst.append(hv)

return reduce(lambda x,y:x+y, lst)

Chuck

@sandrotosi
Copy link
Contributor Author

So I hadn't understood :) I've modified the code I use to test to:

import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes
from numpy.testing import *

def toHex(s):
    lst = []
    for ch in s:
        hv = hex(ord(ch)).replace('0x', '')
        if len(hv) == 1:
            hv = '0'+hv
        lst.append(hv)

    return reduce(lambda x,y:x+'|'+y, lst)

def test_iter_buffered_cast_byteswapped_complex():
    a = np.arange(10, dtype=np.clongdouble)
    print "a arange:", toHex(a.tostring())
    a = a.newbyteorder()
    print "a newbyteorder:", toHex(a.tostring())
    a = a.byteswap()
    print "a byteswap:", toHex(a.tostring())
    print "a.imag:", a.imag
    a += 2j
    print "a + 2j:", a
    print "a + 2j .imag:", a.imag
    i = nditer(a, ['buffered','external_loop'],
                   [['readwrite','nbo','aligned']],
                   casting='same_kind',
                   op_dtypes=[np.dtype('c16')],
                   buffersize=3)
    print "i: ", i
    for n, v in enumerate(i):
        v[...] *= 2
        print "%s-th v: %s" % (n, v)
    print "compare: ", 2*np.arange(10, dtype=np.clongdouble) + 4j
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)

test_iter_buffered_cast_byteswapped_complex()

and it's output is now:

a arange: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|3f|f0|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|08|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|10|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|14|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|18|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|1c|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|20|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|22|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a newbyteorder: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|3f|f0|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|08|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|10|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|14|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|18|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|1c|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|20|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|22|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a byteswap: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|f0|3f|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|08|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|10|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|14|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|18|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|1c|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|20|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|22|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a.imag: [ 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
a + 2j: [ 0.0+2.0j  2.7369744e-303+2.0j  2.8480945e-306+2.0j  9.398712e-305+2.0j
  1.8512615e-304+2.0j  2.3069566e-304+2.0j  2.7626517e-304+2.0j
  3.2183468e-304+2.0j  3.674042e-304+2.0j  3.9018895e-304+2.0j]
a + 2j .imag: [ 2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0  2.0]
i:  <numpy.nditer object at 0x10d03640>
0-th v: [  0.00000000e+000+4.j   6.07730388e-319+4.j   6.32404027e-322+4.j]
1-th v: [  2.08693329e-320+4.j   4.11062617e-320+4.j   5.12247262e-320+4.j]
2-th v: [  6.13431906e-320+4.j   7.14616550e-320+4.j   8.15801194e-320+4.j]
3-th v: [  8.66393517e-320+4.j]
compare:  [ 0.0+4.0j  2.0+4.0j  4.0+4.0j  6.0+4.0j  8.0+4.0j  10.0+4.0j  12.0+4.0j
  14.0+4.0j  16.0+4.0j  18.0+4.0j]
Traceback (most recent call last):
  File "issue411.py", line 39, in <module>
    test_iter_buffered_cast_byteswapped_complex()
  File "issue411.py", line 37, in test_iter_buffered_cast_byteswapped_complex
    assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([ 0.0+4.0j,  5.4739487e-303+4.0j,  5.6961891e-306+4.0j,
        1.8797424e-304+4.0j,  3.7025229e-304+4.0j,  4.6139132e-304+4.0j,
        5.5253034e-304+4.0j,  6.4366937e-304+4.0j,  7.3480839e-304+4.0j,
        7.803779e-304+4.0j], dtype=complex256)
 y: array([ 0.0+4.0j,  2.0+4.0j,  4.0+4.0j,  6.0+4.0j,  8.0+4.0j,  10.0+4.0j,
        12.0+4.0j,  14.0+4.0j,  16.0+4.0j,  18.0+4.0j], dtype=complex256)

I split the hex number with a '|' to have the numbers clearly separated.

@charris
Copy link
Member
charris commented Jan 10, 2013

On Wed, Jan 9, 2013 at 4:52 PM, Sandro Tosi notifications@github.comwrote:

So I hadn't understood :) I've modified the code I use to test to:

import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes
from numpy.testing import *

def toHex(s):
lst = []
for ch in s:
hv = hex(ord(ch)).replace('0x', '')
if len(hv) == 1:
hv = '0'+hv
lst.append(hv)

return reduce(lambda x,y:x+'|'+y, lst)

def test_iter_buffered_cast_byteswapped_complex():
a = np.arange(10, dtype=np.clongdouble)
print "a arange:", toHex(a.tostring())
a = a.newbyteorder()
print "a newbyteorder:", toHex(a.tostring())
a = a.byteswap()
print "a byteswap:", toHex(a.tostring())
print "a.imag:", a.imag
a += 2j
print "a + 2j:", a
print "a + 2j .imag:", a.imag
i = nditer(a, ['buffered','external_loop'],
[['readwrite','nbo','aligned']],
casting='same_kind',
op_dtypes=[np.dtype('c16')],
buffersize=3)
print "i: ", i
for n, v in enumerate(i):
v[...] _= 2
print "%s-th v: %s" % (n, v)
print "compare: ", 2_np.arange(10, dtype=np.clongdouble) + 4j
assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)

test_iter_buffered_cast_byteswapped_complex()

and it's output is now:

a arange: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|3f|f0|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|08|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|10|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|14|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|18|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|1c|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|20|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|22|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a newbyteorder: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|3f|f0|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|08|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|10|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|14|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|18|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|1c|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|20|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|22|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a byteswap: 00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|f0|3f|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|08|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|10|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|14|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|18|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|1c|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|20|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|22|40|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
a.imag: [ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0]
a + 2j: [ 0.0+2.0j 2.7369744e-303+2.0j 2.8480945e-306+2.0j 9.398712e-305+2.0j
1.8512615e-304+2.0j 2.3069566e-304+2.0j 2.7626517e-304+2.0j
3.2183468e-304+2.0j 3.674042e-304+2.0j 3.9018895e-304+2.0j]
a + 2j .imag: [ 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0]
i: <numpy.nditer object at 0x10d03640>
0-th v: [ 0.00000000e+000+4.j 6.07730388e-319+4.j 6.32404027e-322+4.j]
1-th v: [ 2.08693329e-320+4.j 4.11062617e-320+4.j 5.12247262e-320+4.j]
2-th v: [ 6.13431906e-320+4.j 7.14616550e-320+4.j 8.15801194e-320+4.j]
3-th v: [ 8.66393517e-320+4.j]
compare: [ 0.0+4.0j 2.0+4.0j 4.0+4.0j 6.0+4.0j 8.0+4.0j 10.0+4.0j 12.0+4.0j
14.0+4.0j 16.0+4.0j 18.0+4.0j]
Traceback (most recent call last):
File "issue411.py", line 39, in
test_iter_buffered_cast_byteswapped_complex()
File "issue411.py", line 37, in test_iter_buffered_cast_byteswapped_complex
assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j)
File "/home/morph/python-numpy-1.7.0rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 257, in assert_equal
return assert_array_equal(actual, desired, err_msg, verbose)
File "/home/morph/python-numpy-1.7.0
rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 719, in assert_array_equal
verbose=verbose, header='Arrays are not equal')
File "/home/morph/python-numpy-1.7.0~rc1/inst/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 645, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 100.0%)
x: array([ 0.0+4.0j, 5.4739487e-303+4.0j, 5.6961891e-306+4.0j,
1.8797424e-304+4.0j, 3.7025229e-304+4.0j, 4.6139132e-304+4.0j,
5.5253034e-304+4.0j, 6.4366937e-304+4.0j, 7.3480839e-304+4.0j,
7.803779e-304+4.0j], dtype=complex256)
y: array([ 0.0+4.0j, 2.0+4.0j, 4.0+4.0j, 6.0+4.0j, 8.0+4.0j, 10.0+4.0j,
12.0+4.0j, 14.0+4.0j, 16.0+4.0j, 18.0+4.0j], dtype=complex256)

I split the hex number with a '|' to have the numbers clearly separated.

Not quite right, too many zeros :( The reason to use a range in int8 (as
in my examples) is that every byte has a different value so we know where
they started and where they ended up. So to generate an array of 8
complex256:

In [4]: c = fromstring(arange(256, dtype=int8).tostring(), dtype=complex256)

In [5]: c.shape
Out[5]: (8,)

Note that the complex numbers will look weird as complex numbers, but we
only care how they look as hex values.

Chuck

@sandrotosi
Copy link
Contributor Author

Ok, I've just used your code, without trying to adapt it to the failing test:

>>> from numpy import *
>>> def toHex(s):
...      lst = []
...      for ch in s:
...          hv = hex(ord(ch)).replace('0x', '')
...          if len(hv) == 1:
...              hv = '0'+hv
...          lst.append(hv)
...      return reduce(lambda x,y:x+'|'+y, lst)
... 
>>> s = arange(16, dtype=int8).tostring()
>>> c = fromstring(s, dtype=complex128)
>>> c.newbyteorder().tostring()
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
>>> toHex(c.newbyteorder().tostring())
'00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d|0e|0f'
>>> c.newbyteorder().byteswap().tostring()
'\x07\x06\x05\x04\x03\x02\x01\x00\x0f\x0e\r\x0c\x0b\n\t\x08'
>>> toHex(c.newbyteorder().byteswap().tostring())
'07|06|05|04|03|02|01|00|0f|0e|0d|0c|0b|0a|09|08'
>>> 

@certik
Copy link
Contributor
certik commented Feb 6, 2013

I am putting this to milestone 1.8, or if somebody sends a patch, we can release 1.7.1.

@njsmith
Copy link
Member
njsmith commented Mar 6, 2013

No progress since then, and not a blocker for 1.8, so I'm removing the milestone.

@charris
Copy link
Member 887C
charris commented Feb 16, 2014

@sandrotosi What is the status of this?

@juliantaylor
Copy link
Contributor

seems to be fixed in 1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
0