[Scipy-tickets] [SciPy] #590: sparse.lil_matrix fails on save

SciPy scipy-tickets@scipy....
Wed Jan 16 10:02:14 CST 2008


#590: sparse.lil_matrix fails on save
--------------------------+-------------------------------------------------
 Reporter:  flatberg      |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:  0.7     
Component:  scipy.sparse  |     Version:          
 Severity:  normal        |    Keywords:          
--------------------------+-------------------------------------------------
 lil_matrix fails on method save:

 On Ubuntu Gutsy, python 2.5, scipy 0.6.0 (Andrew Straws' repos)

 {{{
 In [118]: a = sparse.lil_matrix(eye(3))

 In [119]: a.save("/tmp/tull")

 ---------------------------------------------------------------------------
 <type 'exceptions.TypeError'>             Traceback (most recent call
 last)

 /home/flatberg/repository/sandbox/<ipython console> in <module>()

 /usr/lib/python2.5/site-packages/scipy/sparse/sparse.py in save(self,
 file_name, format)
     504             ir, ic = self.rowcol(ii)
     505             data = self.getdata(ii)
 --> 506             fd.write(format % (ir, ic, data))
     507         fd.close()
     508

 <type 'exceptions.TypeError'>: int argument required
 > /usr/lib/python2.5/site-packages/scipy/sparse/sparse.py(506)save()
     505             data = self.getdata(ii)
 --> 506             fd.write(format % (ir, ic, data))
     507         fd.close()

 }}}

 I guess that due to a lacking implementation of get_data in lil_matrix,
 the save method (in spmatrix) turns to its default (returning None) which
 obviously will not work.

 Arnar Flatberg

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


More information about the Scipy-tickets mailing list