FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pylab switch by dopplershift · Pull Request #2179 · ipython/ipython · GitHub

Repository navigation

Pylab switch - #2179

Merged
fperez merged 8 commits into
ipython:masterfrom
dopplershift:pylab-switch
Jul 25, 2012
Merged

fperez merged 8 commits into
ipython:masterfrom
dopplershift:pylab-switch

Conversation

Copy link
Copy Markdown
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 commented Jul 20, 2012

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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 commented Jul 21, 2012

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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 commented Jul 21, 2012

Copy link
Copy Markdown
Member

@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?

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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 commented Jul 23, 2012

Copy link
Copy Markdown
Member

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 commented Jul 24, 2012

Copy link
Copy Markdown
Member

Note: this should close #1927

Carreau commented Jul 24, 2012

Copy link
Copy Markdown
Member

Merging tomorrow if nobody have objection ?

Copy link
Copy Markdown
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 merged commit 6dac692 into ipython:master Jul 25, 2012

fperez commented Jul 25, 2012

Copy link
Copy Markdown
Member

Done :)

fperez commented Jul 25, 2012

Copy link
Copy Markdown
Member

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

anderwm commented Jul 25, 2012

Copy link
Copy Markdown

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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL