-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
In optimization/verbose_optimization.py, the following code tries to check whether it's being run from within an IPython notebook:
try: # pragma: no cover
from IPython.display import display
from ipywidgets import IntProgress, HTML, Box, VBox, HBox
self.text = HTML(width='100%')
self.progress = IntProgress(min=0, max=maxiters)
#self.progresstext = Text(width='100%', disabled=True, value='0/{}'.format(maxiters))
self.model_show = HTML()
self.ipython_notebook = ipython_notebook
except:
# Not in Ipython notebook
self.ipython_notebook = False
but when I run code in my shell (not a notebook) that calls this, self.ipython_notebook is True after this block executes.
According to this stackoverflow post, a good way to do this check is
try:
get_ipython
self.ipython_notebook=True
except:
self.ipython_notebook=False
For reference:
python 3.6.7
ipython 6.5.0
ipywidgets 7.4.0
paramz 0.9.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels