[SciPy-dev] cut-and-paste error in scipy\io\matlab\mio5.py

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Jan 13 16:03:32 EST 2009


On Tue, Jan 13, 2009 at 3:37 PM, Matthew Brett <matthew.brett at gmail.com> wrote:
> Hi,
>
>> super(Mat5ObjectMatrixGetter
>>
>> should be:
>> super(Mat5FunctionMatrixGetter
>
> Thank you, that's a good spot.
>
>> I guess this is covered by a test
>
> I think you mean 'I guess this _should_ be covered by a test'.  But
> no, there are no tests for function reading and writing.  It's just
> that I don't have easy access to matlab anymore.
>
> I'll make the change in trunk, and in the rc branch.  I'll try and add
> a test for this exact problem.
>

I tried some more after this change to my local scipy, and I got soon
stuck again. From matlab I just dumped the entire workspace, with
different structs and function handles, and I ended up with
TypeErrors, which I guess are actually not implemented types.

Loading a mat5 file that only contains data matrices and structs
without function handles works without problems. But to load the
relevant parts of the dumped workspace, I put some try except
statements in mio5 to capture type errors and replaced these elements
by None or NaN. This way types that are not implemented are just
skipped. The way I did it is a dirty hack, since I just capture any
exception in read_element, since I'm not familiar with `mio` to figure
out what the correct dummy content of an element should be.

I don't have time right now to test this properly, but since the basic
data transfer through mat5 files is working now, I will slowly switch
from csv files to mat5 and can test some more. My matlab version is
still 2006a, so mat5 is the best I can do.

Thanks,

Josef



More information about the SciPy-Dev mailing list