Skip to content

Conversation

@dopplershift
Copy link
Contributor

This series of commits enables switching between inline and a single gui mode in a single notebook.

Only issue an error if we attempt to active a new *GUI* event loop.
Allow the inline eventloop, None, to be set.
This makes switching backends work on the matplotlib side.
Save the rcParameters before activating inline mode. Then unwind all the
changes when activating a different mode.
@Carreau
Copy link
Member

Carreau commented Jul 20, 2012

Test results for commit 0899853 merged into master
Platform: darwin

  • python2.6: OK
  • python2.7: OK (libraries not available: oct2py pymongo rpy2 wx wx.aui)

Not available for testing: python3.2

@bfroehle
Copy link
Contributor

How should I test this? Can you paste some code from a sample notebook?

@bfroehle
Copy link
Contributor

This patch is not playing nice with Matplotlib in Python 3.2, but I can't get tools/post_pr_test.py to actually post the log file.

@dopplershift
Copy link
Contributor Author

That at least adds a notebook for testing and fixes a problem with the event loop crapping out. Still trying to test 3.2.

@bfroehle
Copy link
Contributor

Okay, test failure log at https://gist.github.com/3153959

@bfroehle
Copy link
Contributor

Looks like the test log failure is due to a problem with 2to3 (or matplotlib).

Since there isn't an official matplotlib release supporting Python 3 I'm not too concerned.

@fperez
Copy link
Member

fperez commented Jul 21, 2012

Test results for commit 6d627f5 merged into master
Platform: linux2

  • python2.7: OK
  • python3.2: OK (libraries not available: cython matplotlib oct2py pygments pymongo rpy2 wx wx.aui)

Not available for testing: python2.6, python3.1

@bfroehle
Copy link
Contributor

Matplotlib py3k reload bug forwarded upstream to matplotlib/matplotlib#1033.

@bfroehle
Copy link
Contributor

Thanks for the sample notebook, will confirm that running through it in Python 2.7 works great. Things seem to randomly fail in Python 3.2 (in such a way that the kernel dies and needs to be restarted) but I don't know how to debug it.

@fperez
Copy link
Member

fperez commented Jul 21, 2012

@dopplershift, do you think MPL on 3.2 is solid enough to worry about the failures, or should we focus only on the py2 functionality, and presume that any issues there are solely mpl's?

@dopplershift
Copy link
Contributor Author

I haven't been running on 3.2 so I really don't have a good handle on how well matplotlib runs on it. My gut says to let matplotlib run on 3.2 in the wild for a few months before worrying too much.

@bfroehle
Copy link
Contributor

I agree... Matplotlib in Python 3 works, but it isn't polished, nor is there even an official release with Python 3 support.

The crashes, by the way, were quite odd. For example, executing the %pylab and plot statements in different cells worked fine.

@takluyver
Copy link
Member

Matplotlib with Python 3 is pretty stable, and is tentatively scheduled for an October release, so it would be good to be working out of the gate. But if it's inconsistent crashy bugs, and they could even be in matplotlib itself, we don't need to spend too long hunting them down.

@Carreau
Copy link
Member

Carreau commented Jul 23, 2012

My take on this one would be to merge it, and just not advertise that it exists.

If problematic, we would then just disable it with a configurable traits until we catch the corner cases if any.

@fperez
Copy link
Member

fperez commented Jul 24, 2012

Note: this should close #1927

@Carreau
Copy link
Member

Carreau commented Jul 24, 2012

Merging tomorrow if nobody have objection ?

@bfroehle
Copy link
Contributor

Fine with me.

fperez added a commit that referenced this pull request Jul 25, 2012
Enable switching %pylab mode between inline and a single gui mode in a single notebook.

With this merge, `%pylab` can be called interactively to toggle inline/GUI (matplotlib floating windows) mode.  After initializing `%pylab inline`, now one can call `%pylab` without arguments to activate the default GUI or ask for a specific one as usual.

IPython will detect if a different GUI is requested if one was already activated and will refuse to do so (to prevent multiple event loops from running concurrently, which often leads to problems).
@fperez fperez merged commit 6dac692 into ipython:master Jul 25, 2012
@fperez
Copy link
Member

fperez commented Jul 25, 2012

Done :)

@fperez
Copy link
Member

fperez commented Jul 25, 2012

Thanks a lot @dopplershift. It was your calling in life :)

@anderwm
Copy link

anderwm commented Jul 25, 2012

This works brilliantly, nice work

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Enable switching %pylab mode between inline and a single gui mode in a single notebook.

With this merge, `%pylab` can be called interactively to toggle inline/GUI (matplotlib floating windows) mode.  After initializing `%pylab inline`, now one can call `%pylab` without arguments to activate the default GUI or ask for a specific one as usual.

IPython will detect if a different GUI is requested if one was already activated and will refuse to do so (to prevent multiple event loops from running concurrently, which often leads to problems).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants