[SciPy-Dev] Scipy on Python 3

Bruce Southey bsouthey@gmail....
Mon Sep 13 16:49:26 CDT 2010


  On 09/13/2010 04:25 PM, Charles R Harris wrote:
>
>
> On Mon, Sep 13, 2010 at 2:33 PM, Charles R Harris 
> <charlesr.harris@gmail.com <mailto:charlesr.harris@gmail.com>> wrote:
>
>
>
>     On Mon, Sep 13, 2010 at 2:23 PM, Charles R Harris
>     <charlesr.harris@gmail.com <mailto:charlesr.harris@gmail.com>> wrote:
>
>
>
>         On Mon, Sep 13, 2010 at 2:06 PM, Pauli Virtanen <pav@iki.fi
>         <mailto:pav@iki.fi>> wrote:
>
>             Mon, 13 Sep 2010 15:01:27 -0500, Bruce Southey wrote:
>             [clip]
>             > There are a lot of 'PendingDeprecationWarning: Please
>             use assertTrue
>             > instead.' messages resulting from the usage of
>             failUnless which is
>             > deprecated since version 2.7.
>
>             Unfortunately, we can't use assertTrue since it's not in
>             Python 2.4. Also
>             these could be changed to user assert_(), similarly how
>             Warren changed
>             recently bare asserts.
>
>
>         Numpy uses assertTrue, it is present in python2.4 but
>         undocumented. I had a sed script to make all the needed
>         replacements...
>
>
>     Here is the script
>
>     s/\<failUnless\>/assertTrue/g
>     s/\<failIf\>/assertFalse/g
>     s/\<failUnlessEqual\>/assertEqual/g
>     s/\<failUnlessRaises\>/assertRaises/g
>
>
> I made the changes in r6805. For future reference on mass changes like 
> that:
>
> find scipy -name "test*.py" -exec sed --in-place=bck 
> --file=sedfixdeprecated {} +
>
> Chuck
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
That was fast!

No warnings with Python3 and just the same weave error and reported test 
failures as before.

There are errors for Python2.4 that are not related to the depreciation 
changes (output below). I can file tickets if needed. I noticed that 
numpy svn version under Python2.4 also failed some tests but that's 
another list (and day). (But, for completeness these are also below 
since involve polynomial.)

Thanks
Bruce

$ python2.4
Python 2.4.6 (#1, Sep 13 2010, 15:54:12)
[GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import scipy
 >>> scipy.test()
Running unit tests for scipy
NumPy version 2.0.0.dev8714
NumPy is installed in /usr/local/lib/python2.4/site-packages/numpy
SciPy version 0.9.0.dev6805
SciPy is installed in /usr/local/lib/python2.4/site-packages/scipy
Python version 2.4.6 (#1, Sep 13 2010, 15:54:12) [GCC 4.4.4 20100630 
(Red Hat 4.4.4-10)]
nose version 0.11.2
[snip]test_polynomial.py
======================================================================
ERROR: test_idl.TestArrayDimensions.test_2d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 133, in test_2d
     s = readsav(path.join(DATA_PATH, 'array_float32_2d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_3d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 137, in test_3d
     s = readsav(path.join(DATA_PATH, 'array_float32_3d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_4d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 141, in test_4d
     s = readsav(path.join(DATA_PATH, 'array_float32_4d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_5d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 145, in test_5d
     s = readsav(path.join(DATA_PATH, 'array_float32_5d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_6d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 149, in test_6d
     s = readsav(path.join(DATA_PATH, 'array_float32_6d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_7d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 153, in test_7d
     s = readsav(path.join(DATA_PATH, 'array_float32_7d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestArrayDimensions.test_8d
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 157, in test_8d
     s = readsav(path.join(DATA_PATH, 'array_float32_8d.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
ERROR: test_idl.TestCompressed.test_compressed
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/io/tests/test_idl.py", 
line 114, in test_compressed
     s = readsav(path.join(DATA_PATH, 'various_compressed.sav'), 
verbose=False)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
706, in readsav
     r = _read_record(f)
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
341, in _read_record
     rectypedesc['array_desc'])
   File "/usr/local/lib/python2.4/site-packages/scipy/io/idl.py", line 
294, in _read_array
     dims = array_desc['dims'][:array_desc['ndims']]
TypeError: slice indices must be integers or None

======================================================================
FAIL: line-search Newton conjugate gradient optimization routine
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/local/lib/python2.4/site-packages/scipy/optimize/tests/test_optimize.py", 
line 177, in test_ncg
     assert_(self.gradcalls == 18, self.gradcalls) # 0.8.0
   File "/usr/local/lib/python2.4/site-packages/numpy/testing/utils.py", 
line 34, in assert_
     raise AssertionError(msg)
AssertionError: 16

======================================================================
FAIL: Tests pdist(X, 'minkowski') on iris data. (float32)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/local/lib/python2.4/site-packages/scipy/spatial/tests/test_distance.py", 
line 837, in test_pdist_minkowski_3_2_iris_float32
     self.assertTrue(within_tol(Y_test1, Y_right, eps))
AssertionError

----------------------------------------------------------------------
Ran 4736 tests in 33.837s

FAILED (KNOWNFAIL=12, SKIP=40, errors=8, failures=2)
<nose.result.TextTestResult run=4736 errors=8 failures=2>


 >>> numpy.test()
Running unit tests for numpy
NumPy version 2.0.0.dev8714
NumPy is installed in /usr/local/lib/python2.4/site-packages/numpy
Python version 2.4.6 (#1, Sep 13 2010, 15:54:12) [GCC 4.4.4 20100630 
(Red Hat 4.4.4-10)]
nose version 0.11.2
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K...................................................................................................................................................................................................................................K............................................................................................K......................K............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.......................................................................................................................................................................................................................................................................................................................................................................................E..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Warning: 
divide by zero encountered in log
.........................................................................................................................................................................................................................................................................SS............
======================================================================
ERROR: test_type_check.TestDateTimeData.test_basic
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/nose/case.py", line 186, 
in runTest
     self.test(*self.arg)
   File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_type_check.py", 
line 383, in test_basic
     assert_equal(datetime_data(a.dtype), (asbytes('us'), 1, 1, 1))
   File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/type_check.py", line 
610, in datetime_data
     raise RuntimeError, "Cannot access date-time internals without 
ctypes installed"
RuntimeError: Cannot access date-time internals without ctypes installed

======================================================================
FAIL: test_doctests (test_polynomial.TestDocs)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_polynomial.py", 
line 90, in test_doctests
     return rundocs()
   File "/usr/local/lib/python2.4/site-packages/numpy/testing/utils.py", 
line 962, in rundocs
     raise AssertionError("Some doctests failed:\n%s" % "\n".join(msg))
AssertionError: Some doctests failed:
**********************************************************************
File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_polynomial.py", 
line 38, in test_polynomial
Failed example:
     p / q
Expected:
     (poly1d([ 0.33333333]), poly1d([ 1.33333333,  2.66666667]))
Got:
     (poly1d([ 0.333]), poly1d([ 1.333,  2.667]))

**********************************************************************
File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_polynomial.py", 
line 60, in test_polynomial
Failed example:
     p.integ()
Expected:
     poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])
Got:
     poly1d([ 0.333,  1.   ,  3.   ,  0.   ])

**********************************************************************
File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_polynomial.py", 
line 62, in test_polynomial
Failed example:
     p.integ(1)
Expected:
     poly1d([ 0.33333333,  1.        ,  3.        ,  0.        ])
Got:
     poly1d([ 0.333,  1.   ,  3.   ,  0.   ])

**********************************************************************
File 
"/usr/local/lib/python2.4/site-packages/numpy/lib/tests/test_polynomial.py", 
line 64, in test_polynomial
Failed example:
     p.integ(5)
Expected:
     poly1d([ 0.00039683,  0.00277778,  0.025     ,  0.        ,  
0.        ,
             0.        ,  0.        ,  0.        ])
Got:
     poly1d([ 0.   ,  0.003,  0.025,  0.   ,  0.   ,  0.   ,  0.   ,  
0.   ])


----------------------------------------------------------------------
Ran 3011 tests in 18.576s

FAILED (KNOWNFAIL=4, SKIP=2, errors=1, failures=1)
<nose.result.TextTestResult run=3011 errors=1 failures=1>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20100913/a8470133/attachment-0001.html 


More information about the SciPy-Dev mailing list