[Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

Derek Homeier derek at astro.physik.uni-goettingen.de
Mon Jun 13 10:17:10 EDT 2011


Hi Ralf,

> I am pleased to announce the availability of the first release candidate of NumPy 1.6.1. This is a bugfix release, list of fixed bugs:
> #1834   einsum fails for specific shapes
> #1837   einsum throws nan or freezes python for specific array shapes
> #1838   object <-> structured type arrays regression
> #1851   regression for SWIG based code in 1.6.0
> #1863   Buggy results when operating on array copied with astype()

there are a bunch of test failures under Python3, mostly with new datetime tests 
trivially fixed by 'str' -> asbytes('str') conversions (I can send a patch or pull request 
for that), and two more I can't provide a fix for yet:

FAIL: Test custom format function for each element in array.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/derek/lib/python3.2/site-packages/numpy/core/tests/test_arrayprint.py", line 86, in test_format_function
    "[0x0L 0x1L 0x2L]")
  File "/Users/derek/lib/python3.2/site-packages/numpy/testing/utils.py", line 313, in assert_equal
    raise AssertionError(msg)
AssertionError: 
Items are not equal:
 ACTUAL: '[0x0 0x1 0x2]'
 DESIRED: '[0x0L 0x1L 0x2L]'

- this is 
        x = np.arange(3)
        assert_(np.array2string(x, formatter={'all':_format_function}) == \
                "[. o O]")
        assert_(np.array2string(x, formatter={'int_kind':_format_function}) ==\
                "[. o O]")
        assert_(np.array2string(x, formatter={'all':lambda x: "%.4f" % x}) == \
                "[0.0000 1.0000 2.0000]")
        assert_equal(np.array2string(x, formatter={'int':lambda x: hex(x)}), \
                "[0x0L 0x1L 0x2L]")

(btw. these were all assert_(a == b) before, which do not give a useful error message 
by default - any reason not to change them to assert_equal(, b)?)

and 
FAIL: Ticket #1748
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/derek/lib/python3.2/site-packages/numpy/core/tests/test_regression.py", line 1549, in test_string_astype
    assert_equal(b.dtype, np.dtype('S5'))
  File "/Users/derek/lib/python3.2/site-packages/numpy/testing/utils.py", line 313, in assert_equal
    raise AssertionError(msg)
AssertionError: 
Items are not equal:
 ACTUAL: dtype('<U5')
 DESIRED: dtype('|S5')

for 

        s1 = asbytes('black')
        s2 = asbytes('white')
        s3 = asbytes('other')
        a = np.array([[s1],[s2],[s3]])
        assert_equal(a.dtype, np.dtype('S5'))
        b = a.astype('str')
        assert_equal(b.dtype, np.dtype('S5'))

I can get around this by changing the last lines to 

        b = a.astype(np.dtype('S5'))
        assert_equal(b.dtype, np.dtype('S5'))

but am not sure if this preserves the purpose of the test...

HTH,
							Derek




More information about the NumPy-Discussion mailing list