diff --git a/mat73/version.py b/mat73/version.py index d1de237..dba4560 100644 --- a/mat73/version.py +++ b/mat73/version.py @@ -1 +1 @@ -__version__ = '0.62' +__version__ = '0.63' diff --git a/tests/test_mat73.py b/tests/test_mat73.py index f7e5c05..3ee9d2b 100644 --- a/tests/test_mat73.py +++ b/tests/test_mat73.py @@ -34,7 +34,7 @@ class Testing(unittest.TestCase): def setUp(self): """make links to test files and make sure they are present""" - for i in range(1, 12): + for i in range(1, 13): file = 'testfile{}.mat'.format(i) if not os.path.exists(file): file = os.path.join('./tests', file) @@ -414,6 +414,18 @@ def test_file11_specificvars_cells(self): data = mat73.loadmat(self.testfile11, only_include=['bar']) assert len(data)==0 + def test_file12_sparse_matrix_fix(self): + """some sparse matrices could not be loaded. check if it now works""" + # check regular loading works + import scipy + data = mat73.loadmat(self.testfile12) + struct_sparse = data['rec_img']['fwd_model']['stimulation'] + sparse_type = scipy.sparse.csc_matrix + assert isinstance(struct_sparse[0]['meas_pattern'], sparse_type) + assert isinstance(struct_sparse[0]['stim_pattern'], sparse_type) + assert isinstance(struct_sparse[0]['stimulation'], str) + + if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/tests/testfile12.mat b/tests/testfile12.mat new file mode 100644 index 0000000..57f9dba Binary files /dev/null and b/tests/testfile12.mat differ