diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index c2bbdd4..60dfc5c 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -423,6 +423,9 @@ class InteractiveShell(SingletonConfigurable): # Private interface _post_execute = Instance(dict) + # Tracks any GUI loop loaded for pylab + pylab_gui_select = None + def __init__(self, config=None, ipython_dir=None, profile_dir=None, user_module=None, user_ns=None, custom_exceptions=((), None)): diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 9fd9cd6..b1d0023 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -174,13 +174,16 @@ def select_figure_format(shell, fmt): #----------------------------------------------------------------------------- -def find_gui_and_backend(gui=None): +def find_gui_and_backend(gui=None, gui_select=None): """Given a gui string return the gui and mpl backend. Parameters ---------- gui : str Can be one of ('tk','gtk','wx','qt','qt4','inline'). + gui_select : str + Can be one of ('tk','gtk','wx','qt','qt4','inline'). + This is any gui already selected by the shell. Returns ------- @@ -198,6 +201,13 @@ def find_gui_and_backend(gui=None): # In this case, we need to find what the appropriate gui selection call # should be for IPython, so we can activate inputhook accordingly gui = backend2gui.get(backend, None) + + # If we have already had a gui active, we need it and inline are the + # ones allowed. + if gui_select and gui != gui_select: + gui = gui_select + backend = backends[gui] + return gui, backend @@ -205,23 +215,20 @@ def activate_matplotlib(backend): """Activate the given backend and set interactive to True.""" import matplotlib - if backend.startswith('module://'): - # Work around bug in matplotlib: matplotlib.use converts the - # backend_id to lowercase even if a module name is specified! - matplotlib.rcParams['backend'] = backend - else: - matplotlib.use(backend) matplotlib.interactive(True) + # Matplotlib had a bug where even switch_backend could not force + # the rcParam to update. This needs to be set *before* the module + # magic of switch_backend(). + matplotlib.rcParams['backend'] = backend + + import matplotlib.pyplot + matplotlib.pyplot.switch_backend(backend) + # This must be imported last in the matplotlib series, after # backend/interactivity choices have been made import matplotlib.pylab as pylab - # XXX For now leave this commented out, but depending on discussions with - # mpl-dev, we may be able to allow interactive switching... - #import matplotlib.pyplot - #matplotlib.pyplot.switch_backend(backend) - pylab.show._needmain = False # We need to detect at runtime whether show() is called by the user. # For this, we wrap it into a decorator which adds a 'called' flag. @@ -272,6 +279,7 @@ def configure_inline_support(shell, backend, user_ns=None): from IPython.zmq.pylab.backend_inline import InlineBackend except ImportError: return + from matplotlib import pyplot user_ns = shell.user_ns if user_ns is None else user_ns @@ -282,12 +290,23 @@ def configure_inline_support(shell, backend, user_ns=None): if backend == backends['inline']: from IPython.zmq.pylab.backend_inline import flush_figures - from matplotlib import pyplot shell.register_post_execute(flush_figures) + + # Save rcParams that will be overwrittern + shell._saved_rcParams = dict() + for k in cfg.rc: + shell._saved_rcParams[k] = pyplot.rcParams[k] # load inline_rc pyplot.rcParams.update(cfg.rc) # Add 'figsize' to pyplot and to the user's namespace user_ns['figsize'] = pyplot.figsize = figsize + else: + from IPython.zmq.pylab.backend_inline import flush_figures + if flush_figures in shell._post_execute: + shell._post_execute.pop(flush_figures) + if hasattr(shell, '_saved_rcParams'): + pyplot.rcParams.update(shell._saved_rcParams) + del shell._saved_rcParams # Setup the default figure format fmt = cfg.figure_format @@ -321,7 +340,18 @@ def pylab_activate(user_ns, gui=None, import_all=True, shell=None): The actual gui used (if not given as input, it was obtained from matplotlib itself, and will be needed next to configure IPython's gui integration. """ - gui, backend = find_gui_and_backend(gui) + pylab_gui_select = shell.pylab_gui_select if shell is not None else None + # Try to find the appropriate gui and backend for the settings + gui, backend = find_gui_and_backend(gui, pylab_gui_select) + if shell is not None and gui != 'inline': + # If we have our first gui selection, store it + if pylab_gui_select is None: + shell.pylab_gui_select = gui + # Otherwise if they are different + elif gui != pylab_gui_select: + print ('Warning: Cannot change to a different GUI toolkit: %s.' + ' Using %s instead.' % (gui, pylab_gui_select)) + gui, backend = find_gui_and_backend(pylab_gui_select) activate_matplotlib(backend) import_pylab(user_ns, import_all) if shell is not None: diff --git a/IPython/core/tests/test_pylabtools.py b/IPython/core/tests/test_pylabtools.py index 3c12523..5ca481a 100644 --- a/IPython/core/tests/test_pylabtools.py +++ b/IPython/core/tests/test_pylabtools.py @@ -61,3 +61,79 @@ def test_import_pylab(): pt.import_pylab(ns, import_all=False) nt.assert_true('plt' in ns) nt.assert_equal(ns['np'], np) + + +class TestPylabSwitch(object): + class Shell(object): + pylab_gui_select = None + + def setup(self): + import matplotlib + def act_mpl(backend): + matplotlib.rcParams['backend'] = backend + + # Save rcParams since they get modified + self._saved_rcParams = matplotlib.rcParams + matplotlib.rcParams = dict(backend='Qt4Agg') + + # Mock out functions + self._save_am = pt.activate_matplotlib + pt.activate_matplotlib = act_mpl + self._save_ip = pt.import_pylab + pt.import_pylab = lambda *a,**kw:None + self._save_cis = pt.configure_inline_support + pt.configure_inline_support = lambda *a,**kw:None + + def teardown(self): + pt.activate_matplotlib = self._save_am + pt.import_pylab = self._save_ip + pt.configure_inline_support = self._save_cis + import matplotlib + matplotlib.rcParams = self._saved_rcParams + + def test_qt(self): + s = self.Shell() + gui = pt.pylab_activate(dict(), None, False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui = pt.pylab_activate(dict(), 'inline', False, s) + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui = pt.pylab_activate(dict(), 'qt', False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui = pt.pylab_activate(dict(), 'inline', False, s) + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui = pt.pylab_activate(dict(), None, False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + def test_inline(self): + s = self.Shell() + gui = pt.pylab_activate(dict(), 'inline', False, s) + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, None) + + gui = pt.pylab_activate(dict(), 'inline', False, s) + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, None) + + gui = pt.pylab_activate(dict(), 'qt', False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + def test_qt_gtk(self): + s = self.Shell() + gui = pt.pylab_activate(dict(), 'qt', False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui = pt.pylab_activate(dict(), 'gtk', False, s) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + diff --git a/IPython/zmq/eventloops.py b/IPython/zmq/eventloops.py index 4df3b26..835a4e0 100644 --- a/IPython/zmq/eventloops.py +++ b/IPython/zmq/eventloops.py @@ -218,6 +218,6 @@ def enable_gui(gui, kernel=None): " and no IPython Application with a kernel appears to be running." ) loop = loop_map[gui] - if kernel.eventloop is not None and kernel.eventloop is not loop: - raise RuntimeError("Cannot activate multiple GUI eventloops") + if loop and kernel.eventloop is not None and kernel.eventloop is not loop: + raise RuntimeError("Cannot activate multiple GUI eventloops") kernel.eventloop = loop diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index 232fc38..70b9420 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -254,8 +254,6 @@ class Kernel(Configurable): self.eventloop = None break self.log.info("exiting eventloop") - # if eventloop exits, IOLoop should stop - ioloop.IOLoop.instance().stop() def start(self): """register dispatchers for streams""" diff --git a/docs/examples/tests/pylab-switch/Pylab Switching.ipynb b/docs/examples/tests/pylab-switch/Pylab Switching.ipynb new file mode 100644 index 0000000..80af27c --- /dev/null +++ b/docs/examples/tests/pylab-switch/Pylab Switching.ipynb @@ -0,0 +1,108 @@ +{ + "metadata": { + "name": "Pylab Switching" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Should pop up a GUI window\n", + "%pylab qt\n", + "plot([1,2,3])" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].\n", + "For more information, type 'help(pylab)'.\n" + ] + }, + { + "output_type": "pyout", + "prompt_number": 3, + "text": [ + "[]" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Should make an inline figure\n", + "%pylab inline\n", + "plot([1,2,3])" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n", + "For more information, type 'help(pylab)'.\n" + ] + }, + { + "output_type": "pyout", + "prompt_number": 4, + "text": [ + "[]" + ] + }, + { + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD9CAYAAACoXlzKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAESVJREFUeJzt3V9oVFcCx/HftBHqGKvmwQQmWQqNLRk1mcRCWNA6IlJi\nawhV1sqmDZqHEFatr8WHqhUpKEikIPYlIj5Y0EIDTYQ+OIpKDGK6lPpgLIZMomQNEjDQ4qhnH7Jm\nZ8xk/t6ZuX++Hxhwck/nHi53j1+ON7M+Y4wRAMA13ij1BAAA1mJhBwCXYWEHAJdhYQcAl2FhBwCX\nYWEHAJdJubD/9ddfam5uVigUUjAY1FdffZV03P79+7Vq1So1NDRoeHi4IBMFAGSmLNXBt956S1eu\nXJHf79fz58+1fv16Xb9+XevXr58b09/fr/v372tkZES3bt1Sd3e3BgcHCz5xAEByabdi/H6/JOnZ\ns2d68eKFKioqEo739fWpo6NDktTc3Kzp6WlNTk4WYKoAgEykLHZJevnypZqamvTHH3+ou7tbwWAw\n4fjExIRqamrm3ldXV2t8fFyVlZVzP/P5fBZOGQC8I5cvB0hb7G+88YZ+/fVXjY+P69q1a4pEImlP\nnGwhN8bwsuD19ddfl3wObnpxPbmednv95z9G//iH0fvv5/5tLxk/FbNs2T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y7CwA4DL/BdtJN59CWl7cgAAAABJRU5ErkJggg==\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# New GUI window--should *NOT* have the visual settings of inline\n", + "%pylab qt\n", + "plot([1,2,3])" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].\n", + "For more information, type 'help(pylab)'.\n" + ] + }, + { + "output_type": "pyout", + "prompt_number": 11, + "text": [ + "[]" + ] + } + ], + "prompt_number": 11 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file