[SciPy-Dev] matlab reading / writing changes - review anyone?

Pauli Virtanen pav at iki.fi
Tue Oct 12 17:31:56 EDT 2010


Tue, 12 Oct 2010 13:22:15 -0700, Matthew Brett wrote:
[clip]
> I'm sorry - I probably have probably made the comparison a little too
> large to be taken in in an instant, but I'd be very grateful for
> feedback before merge.

Based on a very shallow glance, looks mostly good to me, although:

- Using UserWarning sounds a bit nasty -- maybe use 
  class MatlabReaderWarning(UserWarning): pass instead?

- Is there a test for "varmats_from_mat"?

- Breaks on Python 3:

======================================================================
ERROR: test_mio.test_round_types
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.1/dist-packages/nose/case.py", line 177, 
in runTest
    self.test(*self.arg)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/tests/test_mio.py", line 825, in test_round_types
    vars = loadmat(stream)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/mio.py", line 149, in loadmat
    matfile_dict = MR.get_variables(variable_names)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/mio4.py", line 304, in get_variables
    mdict[name] = self.read_var_array(hdr)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/mio4.py", line 283, in read_var_array
    return self._matrix_reader.array_from_header(header, process)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/mio4.py", line 132, in array_from_header
    raise TypeError('No reader for class code %s' % mclass)
TypeError: No reader for class code 4

======================================================================
ERROR: test_mio5_utils.test_zero_byte_string
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.1/dist-packages/nose/case.py", line 177, 
in runTest
    self.test(*self.arg)
  File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python3.1/site-
packages/scipy/io/matlab/tests/test_mio5_utils.py", line 174, in 
test_zero_byte_string
    _write_stream(str_io, tag.tostring() + '        ')
TypeError: can't concat bytes to str

----------------------------------------------------------------------
Ran 402 tests in 2.391s

-- 
Pauli Virtanen




More information about the SciPy-Dev mailing list