[SciPy-dev] sparsetools - new and (hopefully) improved!

Tim Leslie tim.leslie at gmail.com
Sat Jan 6 01:17:14 CST 2007

On 1/6/07, Nathan Bell <wnbell at gmail.com> wrote:
> I plan to commit my code to SVN later today.  Once you're up and
> running with the new sparsetools the relative costs of the
> conversions/operations will be more clear.

Hi Nathan,

I've grabbed your code from svn (thanks for putting it in!) but I'm
having a bit of a problem with the tests. Running scipy.tests()
results in 83 test failures, for example:

ERROR: check_transpose (scipy.sparse.tests.test_sparse.test_lil)
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py",
line 202, in check_transpose
    assert_array_equal(a.todense(), b)
  File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line
367, in todense
    return asmatrix(self.toarray())
  File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line
959, in toarray
    return self.tocsr().toarray()
  File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line
955, in tocsr
    indptr,colind,data =
AttributeError: 'module' object has no attribute 'csctocsr'

A lot of them have this (or similar) AttributeErrors. Looking at
dir(scipy.sparse.sparsetools) shows a different set of functions to
what appear in sparsetools.py.

>>> dir(scipy.sparse.sparsetools)
['__doc__', '__file__', '__name__', '__version__', 'ccootocsc',
'ccscadd', 'ccscextract', 'ccscgetel', 'ccscmucsc', 'ccscmucsr',
'ccscmul', 'ccscmux', 'ccscsetel', 'ccsctocoo', 'ccsctofull',
'ccsrmucsc', 'ccsrmux', 'cdiatocsc', 'cfulltocsc', 'ctransp',
'dcootocsc', 'dcscadd', 'dcscextract', 'dcscgetel', 'dcscmucsc',
'dcscmucsr', 'dcscmul', 'dcscmux', 'dcscsetel', 'dcsctocoo',
'dcsctofull', 'dcsrmucsc', 'dcsrmux', 'ddiatocsc', 'dfulltocsc',
'dtransp', 'scootocsc', 'scscadd', 'scscextract', 'scscgetel',
'scscmucsc', 'scscmucsr', 'scscmul', 'scscmux', 'scscsetel',
'scsctocoo', 'scsctofull', 'scsrmucsc', 'scsrmux', 'sdiatocsc',
'sfulltocsc', 'stransp', 'zcootocsc', 'zcscadd', 'zcscextract',
'zcscgetel', 'zcscmucsc', 'zcscmucsr', 'zcscmul', 'zcscmux',
'zcscsetel', 'zcsctocoo', 'zcsctofull', 'zcsrmucsc', 'zcsrmux',
'zdiatocsc', 'zfulltocsc', 'ztransp']

Do you have this same problem, or this something I might have done
wrong somewhere along the line.



> [1] for a 1Mx1M matrix with 5M nnz, the conversion takes 1.02 seconds, while
> a copy alone takes 0.53 seconds
> --
> Nathan Bell wnbell at gmail.com
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev

More information about the Scipy-dev mailing list