[IPython-dev] GUI support: conflicts between IPython 0.11 and Matplotlib/ETS

Fernando Perez fperez.net at gmail.com
Sun Feb 14 02:26:27 EST 2010


Hi all,

Thanks to everyone for the feedback, it's indeed very useful and we
are aware this is a hard problem.  The last thing we want to do is
cause what people will effectively see as massive regressions, no
matter how good our intentions or the reasons behind our choices.
Gael summarizes the situation very well here:

On Fri, Feb 12, 2010 at 6:39 AM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:
> Honestly, I don't really care about how things are done. I am no longer
> really involved in IPython development. All I know is that trying to
> solve impossible problems leads to hair loss and disappointment. I
> believe you are trying to solve an impossible problem: making sure a user
> can use a main event loop without being aware it is around. IPython used
> to try and solve that problem using threads. It lead to segfaults because
> every single piece of code executed had to be injected in the main loop.
> So what was supposed to be transparent worked 99.9% of the time, and the
> rest of the time forced people to modify their code in subtle ways and
> debug race conditions, which is hard. The developers have now stepped
> back and decided that they would make a choice that forces users to be
> aware of the problems upfront, but has a simple solution.
>
> I am not saying this is a good or bad choice. I haven't had time to try
> out the new IPython, and I am worried of the problems with Mayavi and
> Traits. However, I am saying that there is some reasonning behind the
> choice, and that whatever we do, we are sitting between a rock and a hard
> place.

As we go through this, I am pondering the possibility of eventually
adding the threading-style hacks back, but NOT as default.  This isn't
final by any means, I'm just thinking out loud here, about a plan
along these lines:

- non-threaded gui support with pyos_inputhook, that would require
some code changes.  If this can give a really robust solution and the
needed changes aren't too intrusive, I could see matplotlib, ETS and
possibly others adding the necessary adaptation (especially if we
provide it in ipython already so for the users it ends up being almost
a one-liner).

- adding back the threading hacks, which could be enabled with special
command-line flags.  These would carry the known fragility we are
trying to get away from, but would let users continue to use them in
codes that have not been modified, just like they do today.  No
better, but no worse either.

IPython is an eminently practical tool, so we'll definitely remember
the zen's stanza on purity and practicality, or at least we'll try.

Regards,

f



More information about the IPython-dev mailing list