diff --git a/mat73/__init__.py b/mat73/__init__.py index 6763551..f2f6510 100644 --- a/mat73/__init__.py +++ b/mat73/__init__.py @@ -65,7 +65,6 @@ def mat2dict(self, hdf5, only_load=None): raise ValueError('can only unpack .mat') return d - def unpack_mat(self, hdf5, depth=0): """ unpack a h5py entry: if it's a group expand, @@ -115,15 +114,13 @@ def unpack_mat(self, hdf5, depth=0): else: raise Exception(f'Unknown hdf5 type: {key}:{type(hdf5)}') - + # @profile def _has_refs(self, dataset): - if len(dataset)==0: return False - if not isinstance(dataset[0], np.ndarray): return False + if len(dataset.shape)<2: return False if isinstance(dataset[0][0], h5py.h5r.Reference): return True return False - def convert_mat(self, dataset, depth): """ Converts h5py.dataset into python native datatypes @@ -244,5 +241,5 @@ def savemat(filename, verbose=True): # d = loadmat('../tests/testfile5.mat', use_attrdict=True) - file = '../tests/testfile7.mat' + file = '../tests/testfile8.mat' data = loadmat(file) diff --git a/setup.py b/setup.py index 2ad15f6..7559d4c 100644 --- a/setup.py +++ b/setup.py @@ -4,14 +4,14 @@ setuptools.setup( name='mat73', - version='0.52', + version='0.53', author="skjerns", author_email="nomail@nomail.com", description="Load MATLAB .mat 7.3 into Python native data types", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/skjerns/mat7.3", - download_url="https://github.com/skjerns/mat7.3/archive/v0.52.tar.gz", + download_url="https://github.com/skjerns/mat7.3/archive/v0.53.tar.gz", install_requires=['h5py', 'numpy'], license='MIT', packages=['mat73'], diff --git a/tests/test_mat73.py b/tests/test_mat73.py index fa512e8..246fbd0 100644 --- a/tests/test_mat73.py +++ b/tests/test_mat73.py @@ -31,7 +31,7 @@ class Testing(unittest.TestCase): def setUp(self): - for i in range(1,8): + for i in range(1,9): file = 'testfile{}.mat'.format(i) if not os.path.exists(file): file = os.path.join('./tests', file) @@ -337,7 +337,11 @@ def test_file6_empty_cell_array(self): def test_file7_empty_cell_array(self): data = mat73.loadmat(self.testfile7) - + def test_file8_large(self): + import stimer + with stimer: + data = mat73.loadmat(self.testfile8) + if __name__ == '__main__':