[SciPy-user] mio5 works?

Robert Kern robert.kern@gmail....
Fri Feb 15 11:31:55 CST 2008


On Fri, Feb 15, 2008 at 10:15 AM, Neal Becker <ndbecker2@gmail.com> wrote:
> I noticed this message:
>  http://permalink.gmane.org/gmane.comp.python.scientific.devel/6850
>
>
>  A = ones((10,20,30))
>  f = open('test.mat','wb')
>  MW = scipy.io.mio5.MatFile5Writer(f,do_compression=True,unicode_strings=True)
>  MW.put_variables({'A1':A,'A2':A+1j*A,'s1':'string1','s2':u'string2'})
>  f.close()
>
>  When I try this, I get this error:
>  /usr/tmp/python-AjDvrb.py in <module>()
>       5 f = open('test.mat','wb')
>       6 MW = scipy.io.mio5.MatFile5Writer(f,do_compression=True,unicode_strings=True)
>  ----> 7 MW.put_variables({'A1':A,'A2':A+1j*A,'s1':'string1','s2':u'string2'})
>       8 f.close()
>       9 ## data = cPickle.load (open ('fade_plots', 'r'))
>
>  /usr/lib64/python2.5/site-packages/scipy/io/mio5.py in put_variables(self, mdict)
>     735         for name, var in mdict.items():
>     736             is_global = name in self.global_vars
>  --> 737             self.writer_getter.rewind()
>     738             self.writer_getter.matrix_writer_factory(
>     739                 var,
>
>  /usr/lib64/python2.5/site-packages/scipy/io/mio5.py in rewind(self)
>     638
>     639     def rewind(self):
>  --> 640         self.stream.seek(0)
>     641
>     642     def matrix_writer_factory(self, arr, name, is_global=False):
>
>  AttributeError: 'builtin_function_or_method' object has no attribute 'seek'

This appears to have been fixed in r3435.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the SciPy-user mailing list