Skip to content

Commit

Permalink
model_to_pymatbridge needs scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
cdiener authored and hredestig committed Jul 6, 2017
1 parent 7640a6c commit 6f1c0f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cobra/io/mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ def model_to_pymatbridge(model, variable_name="model", matlab=None):
used in IPython magics.
"""
if scipy_sparse is None:
raise ImportError("`model_to_pymatbridge` requires scipy!")
if matlab is None: # assumed to be running an IPython magic
from IPython import get_ipython
matlab = get_ipython().magics_manager.registry["MatlabMagics"].Matlab
Expand Down

0 comments on commit 6f1c0f7

Please sign in to comment.