Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_to_matlab() error importing scipy.savemat() #181

Closed
darth3PO opened this issue Mar 9, 2020 · 1 comment
Closed

export_to_matlab() error importing scipy.savemat() #181

darth3PO opened this issue Mar 9, 2020 · 1 comment

Comments

@darth3PO
Copy link
Contributor

darth3PO commented Mar 9, 2020

Python version

3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]

Platform information

Windows-10-10.0.16299-SP0

Numpy version

1.16.5

mdfreader version

4.0

scipy version

1.3.1

Description

Error when trying to import savemat
from scipy import savemat

Successfully imported by changing scipy to scipy.io
from scipy.io import savemat

from mdfreader.py:

    def export_to_matlab(self, file_name=None):
        """Export mdf data into Matlab file preferrably in format 7.3

        Parameters
        ----------------
        file_name : str, optional
            file name. If no name defined, it will use original mdf name and path

        Notes
        --------
        This method will dump all data into Matlab file but you will loose below information:
        - unit and descriptions of channel
        - data structure, what is corresponding master channel to a channel.
        Channels might have then different lengths.
        Dependency: hdf5storage, scipy
        """
        # export class data structure into .mat file
        try:
            from hdf5storage import savemat
        except ImportError:
            warn('hdf5storage module not found')
            try:
                from scipy.io import savemat
            except ImportError:
                warn('scipy also module not found')
                return
ratal added a commit that referenced this issue Mar 14, 2020
@ratal
Copy link
Owner

ratal commented Mar 14, 2020

Thanks !
Corrected in master

@ratal ratal closed this as completed Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants