[Scipy-tickets] [SciPy] #1669: csgraph test failures

SciPy Trac scipy-tickets@scipy....
Wed Jun 6 15:06:52 CDT 2012


#1669: csgraph test failures
--------------------------+-------------------------------------------------
 Reporter:  rgommers      |       Owner:  jakevdp
     Type:  defect        |      Status:  new    
 Priority:  high          |   Milestone:  0.11.0 
Component:  scipy.sparse  |     Version:  devel  
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by rgommers):

 This also turned up 29 errors under Python 2.4.

 {{{
 ======================================================================
 ERROR: test_graph_laplacian.test_graph_laplacian
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/nose-1.1.2-py2.4.egg/nose/case.py", line 197, in runTest
     self.test(*self.arg)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/scipy/sparse/csgraph/tests/test_graph_laplacian.py", line
 27, in test_graph_laplacian
     csgraph.laplacian(sp_mat, normed=normed).todense())
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/scipy/sparse/base.py", line 501, in todense
     return np.asmatrix(self.toarray(order=order, out=out))
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/scipy/sparse/coo.py", line 241, in toarray
     B.ravel(order='A'), fortran)
 TypeError: ravel() takes no keyword arguments

 ...
 ...

 ======================================================================
 ERROR: test_shortest_path.test_masked_input(array([[  0.,   3.,   3.,
 5.,   7.],
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/nose-1.1.2-py2.4.egg/nose/case.py", line 197, in runTest
     self.test(*self.arg)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/numpy/testing/utils.py", line 774, in
 assert_array_almost_equal
     header='Arrays are not almost equal')
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/numpy/testing/utils.py", line 622, in assert_array_compare
     raise ValueError(msg)
 ValueError:
 Arrays are not almost equal
  x: array([[  0.,   3.,   3.,   5.,   7.],
        [  3.,   0.,   6.,   2.,   4.],
        [ inf,  inf,   0.,  inf,  inf],...
  y: array([[  0.,   3.,   3.,   5.,   7.],
        [  3.,   0.,   6.,   2.,   4.],
        [ inf,  inf,   0.,  inf,  inf],...

 ======================================================================
 ERROR: test_shortest_path.test_masked_input(array([[  0.,   3.,   3.,
 5.,   7.],
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/nose-1.1.2-py2.4.egg/nose/case.py", line 197, in runTest
     self.test(*self.arg)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/numpy/testing/utils.py", line 774, in
 assert_array_almost_equal
     header='Arrays are not almost equal')
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
 /site-packages/numpy/testing/utils.py", line 622, in assert_array_compare
     raise ValueError(msg)
 ValueError:
 Arrays are not almost equal
  x: array([[  0.,   3.,   3.,   5.,   7.],
        [  3.,   0.,   6.,   2.,   4.],
        [ inf,  inf,   0.,  inf,  inf],...
  y: array([[  0.,   3.,   3.,   5.,   7.],
        [  3.,   0.,   6.,   2.,   4.],
        [ inf,  inf,   0.,  inf,  inf],...

 ----------------------------------------------------------------------
 Ran 85 tests in 0.433s

 FAILED (errors=29)
 }}}

 The errors for arrays with infs in them will probably fail with numpy
 1.5.1 for any Python version, because the numpy.testing functions didn't
 handle infs correctly.

 The TypeError thing is because in 2.4:
 {{{
 >>> x.ravel.__doc__
 'a.ravel([order])
 ...
 >>> x.ravel('A')
 array([ 0.,  0.,  0.])
 >>> x.ravel('order=A')
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 TypeError: order not understood
 }}}

 Proposal: skip the tests with infs for {{{np.version.short_version <
 '1.6'}}}, and fix the other issue by changing line 241 of coo.py from
 {{{B.ravel(order='A')}}} to {{{B.ravel('A')}}}.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1669#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list