otfmi.use_backend#

use_backend(name)#

Switch the FMI backend.

Similar to matplotlib’s matplotlib.use(), this function allows switching between available FMI backends at runtime.

Parameters:
namestr

Backend name, either “pyfmi” or “fmpy”.

Raises:
ValueError

If the backend name is not recognized.

ImportError

If the requested backend is not available.

Examples

>>> import otfmi
>>> otfmi.use_backend("fmpy")
>>> otfmi.backend.BACKEND
'fmpy'