modelon-community / PyFMI

PyFMI is a package for loading and interacting with Functional Mock-Up Units (FMUs) both for Model Exchange and Co-Simulation, which are compiled dynamic models compliant with the Functional Mock-Up Interface (FMI)
http://jmodelica.org/pyfmi
GNU Lesser General Public License v3.0
160 stars 38 forks source link

Updated import in io.py to avoid deprecation warnings #154

Closed modelonrobinandersson closed 2 years ago

modelonrobinandersson commented 2 years ago

This PR is created from https://github.com/modelon-community/PyFMI/issues/153#issuecomment-1249099179.

Due to changes in scipy and what is considered to be part of the public API, the change done to the imports for scipy 1.8.0 and newer did not work. See below (using scipy 1.8.0):
` In [1]: from scipy.io.matlab.mio4 import MatFile4Reader

:1: DeprecationWarning: Please use 'MatFile4Reader' from the 'scipy.io.matlab' namespace, the 'scipy.io.matlab.mio4' namespace is deprecated. ` However if you instead try to import `MatFile4Reader` from `scipy.io.matlab` you get an exception because the class does not exist there, see related https://github.com/modelon-community/PyFMI/issues/153#issuecomment-1249099179.
PeterMeisrimelModelon commented 2 years ago

Looks ok!