Skip to content

Commit

Permalink
added notebook_mode file
Browse files Browse the repository at this point in the history
  • Loading branch information
DKilkenny committed Jan 26, 2021
1 parent 5656ea5 commit 67b9d77
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions openmdao/core/notebook_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Checking for interactive notebook mode."""


def _notebook_mode():

try:
from IPython import get_ipython
ipy = get_ipython() is not None
except ImportError:
pass
else:
try:
import tabulate
except ImportError:
print("Tabulate is not installed run `pip install openmdao[notebooks]` to install "
"required dependencies")
return ipy


if _notebook_mode():
notebook = True
else:
notebook = False

0 comments on commit 67b9d77

Please sign in to comment.