Skip to content

Commit

Permalink
Use is_jupyter from util and remove run_event_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
adryyan committed Dec 13, 2024
1 parent 6e56da0 commit 5c866ae
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/iminuit/minuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,6 @@ def interactive(
self,
plot: Callable = None,
raise_on_exception=False,
run_event_loop=True,
**kwargs,
):
"""
Expand Down Expand Up @@ -2352,29 +2351,15 @@ def interactive(
--------
Minuit.visualize
"""
try:
from IPython import get_ipython

if (
get_ipython().__class__.__name__ == "ZMQInteractiveShell"
and "IPKernelApp" in get_ipython().config
):
is_jupyter = True
else:
is_jupyter = False
except Exception:
is_jupyter = False

plot = self._visualize(plot)

if is_jupyter:
if mutil.is_jupyter():
from iminuit.ipywidget import make_widget

return make_widget(self, plot, kwargs, raise_on_exception)
else:
from iminuit.qtwidget import make_widget

return make_widget(self, plot, kwargs, raise_on_exception, run_event_loop)
return make_widget(self, plot, kwargs, raise_on_exception)

def _free_parameters(self) -> Set[str]:
return set(mp.name for mp in self._last_state if not mp.is_fixed)
Expand Down

0 comments on commit 5c866ae

Please sign in to comment.