Skip to content

Conversation

@fperez
Copy link
Member

@fperez fperez commented Nov 27, 2011

When merging #648, we inadvertently broke pretty badly the pylab support. I added a test to catch the problem and started fixing things, but quickly saw we had a pretty messy setup in our pylab support machinery, just the product of the fast development we had during the creation of the qt console and zeromq support. The only way to fix this cleanly was to refactor things a little bit, but I think it's in decent shape now.

The main problem is that we had a ton of code duplication, with several methods implemented twice in the terminal and zmq shells, but with actually minimal differences. But the duplication meant that fixing a but required hunting down a lot of stuff around.

Now all duplicate code is gone, and the only real difference is how gui event loops are integrated, which is reduced to a single static method that each relevant class grabs from its specific machinery.

Merging this is, however, very urgent because right now master is fully broken. I'm going to see if @minrk is available on IRC and can have a quick look. If not, I'll merge it immediately, but having the pull request helps to easily see what I did in isolation, and we can do a post-merge reivew. I did verify that it fixes the problem we had, added new tests, and checked that both the qt console and the notebook work fine.

…on#648.

code used it as a dict.  Updated that code to handle a dict correctly,
and added tests to catch this issue in the future (also increases test
coverage of pylab code).
Also, fix a few tests that the previous commit broke.
This avoids a circular import problem, and also organizes more cleanly
the code that is event-loop specific.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make ipython --pylab fail in the absence of zmq.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just not call this function if shell is None - no need for it to conditionally do nothing if it was given inappropriate args.

@fperez
Copy link
Member Author

fperez commented Nov 27, 2011

Merging now after detailed review with @minrk on IRC. If anyone else spots any issues let me know, and I'm happy to revisit. But at least @minrk did have a careful look, and he spotted a number of problems (all fixed now).

fperez added a commit that referenced this pull request Nov 27, 2011
Fix bug in pylab support introduced in #648, and refactor the pylab/gui support to eliminate a lot of code duplication we had in a number of places. 

Now all duplicate code is gone, and the only real difference is how gui event loops are integrated, which is reduced to a single static method that each relevant class grabs from its specific machinery.
@fperez fperez merged commit f15123a into ipython:master Nov 27, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Fix bug in pylab support introduced in ipython#648, and refactor the pylab/gui support to eliminate a lot of code duplication we had in a number of places. 

Now all duplicate code is gone, and the only real difference is how gui event loops are integrated, which is reduced to a single static method that each relevant class grabs from its specific machinery.
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.

2 participants