Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Michiel de Hoon
Without monitoring stdin, you could do the following: while True: run the event loop for a specified duration (say, 0.1 seconds) check for input on stdin; if there is any: break But you can only do this if wx has such a time-out capability. If not, you can do the following: while True:

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 11:27:51PM -0600, Ondrej Certik wrote: > and I didn't notice any speed difference --- e.g. it's as slow as > regular mayavi with ipython -wthread. :) Nice, nice! Test the volume_slicer example, with latest release, please. That should be a good test. Gaël ---

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Ondrej Certik
On Thu, Jul 16, 2009 at 11:11 PM, Ondrej Certik wrote: > On Thu, Jul 16, 2009 at 4:42 PM, Robert Kern wrote: >> On Thu, Jul 16, 2009 at 17:26, Brian Granger wrote: >>> Hi, >>> >>> I am attaching a working ctypes based prototype of a module that allows wx >>> to be used interactively from *both* pyt

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Ondrej Certik
On Thu, Jul 16, 2009 at 4:42 PM, Robert Kern wrote: > On Thu, Jul 16, 2009 at 17:26, Brian Granger wrote: >> Hi, >> >> I am attaching a working ctypes based prototype of a module that allows wx >> to be used interactively from *both* python and ipython.  It uses >> PyOS_InputHook and has been teste

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Brian Granger
Michiel, Thanks for the reply, this will help us to find a better approach. According to one of the wx devs, Robin Dunn, wx currently does not have the ability to monitor stdin in its even loop without polling. I guess there is a GSoC project to add this capability, but it is not there yet. Any

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Michiel de Hoon
The chunkiness probably comes from the fact that inputhook_wx is called repeatedly. This is different from how PyOS_InputHook is being used in Tkinter, PyGTK, and the Mac OS X backend. Schematically, this is how the Tkinter/PyGTK/MacOSX event loops work: 1) PyOS_InputHook is called when Python

Re: [matplotlib-devel] [IPython-dev] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Brian Granger
Robert, Thanks for testing this so quickly. Performance is one of the big issues that I am concerned about. I will work on a Cython based version to see if that solves the problem. Cheers, Brian > Works for me with wx 2.8.8.1 on OS X 10.5 and Chaco. Pan and zoom > interactions are substantia

Re: [matplotlib-devel] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Robert Kern
On Thu, Jul 16, 2009 at 17:26, Brian Granger wrote: > Hi, > > I am attaching a working ctypes based prototype of a module that allows wx > to be used interactively from *both* python and ipython.  It uses > PyOS_InputHook and has been tested on wx 2.8 and 2.9 (trunk) on Mac OS X > (python 2.5). > >

Re: [matplotlib-devel] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 03:26:23PM -0700, Brian Granger wrote: >I am attaching a working ctypes based prototype of a module that allows wx >to be used interactively from *both* python and ipython.� It uses >PyOS_InputHook and has been tested on wx 2.8 and 2.9 (trunk) on Mac OS X >(p

[matplotlib-devel] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

2009-07-16 Thread Brian Granger
Hi, I am attaching a working ctypes based prototype of a module that allows wx to be used interactively from *both* python and ipython. It uses PyOS_InputHook and has been tested on wx 2.8 and 2.9 (trunk) on Mac OS X (python 2.5). It can be used with an existing wx install and all versions of ip

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 02:34:01PM -0700, Brian Granger wrote: >Yes, 2.8 is latest stable, so we should support it.� How many people would >complain if 2.6 were not supported?� I take it that all of ETS is 2.8 >based? ETS works better on wx 2.8, but it also works on 2.6, with small bug

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
> For Wx, we would obviously need to support 2.8. We can toy with the idea > of not supporting 2.6, I believe. A lot of people are starting to feel > that 2.6 is depreciated. > Yes, 2.8 is latest stable, so we should support it. How many people would complain if 2.6 were not supported? I take it

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 01:36:21PM -0700, Brian Granger wrote: >What versions of what GUI toolkits do we realistically need to support >moving forward (today and beyond)?� By this, I mean that: >"unsupported" = older versions of GUIs toolkits that will have to use >older versions o

Re: [matplotlib-devel] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
After playing a bit more, I have a ctypes based prototype that can set PyOS_InputHook in an appropriate way for wx 2.9 (trunk). I think it is possible to have a ctypes based version that would work for all the major GUI toolkits that we could ship with IPython until the transition is over (i.e., e

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
OK, I just found this thread that shows how to set PyOS_InputHook from ctypes: http://osdir.com/ml/python.ctypes/2006-12/msg00045.html I tried it and it works fine. This will simplify the transition a lot. I will develop some pure ctypes prototypes for the various toolkits and then folks can be

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
I tried ctypes first, but with no luck. Here is what I tried: >>> import readline >>> import ctypes >>> ctypes.pythonapi.PyOS_InputHook <_FuncPtr object at 0x76420> >>> def my_callback(): ... print "In am here" ... return 0 ... >>> cbf = ctypes.CFUNCTYPE(ctypes.c_int)(my_callback) >>> cbf >>

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
Yes, this is also a possibility that we need to pursue as it would greatly help the transition. I do have a Cython prototype that works. But, we are currently testing all of this on wx trunk. I am not sure if what we are doing will work on previous versions. I plan on looking into this. Cheers

Re: [matplotlib-devel] scipy conference

2009-07-16 Thread Darren Dale
On Wed, Jul 1, 2009 at 9:39 AM, John Hunter wrote: > After a two year hiatus where I inadvertently scheduled my travel > plans to overlap scipy, I will finally be able to make it to the scipy > conference this year, and plan to make up for lost time by coming > early to lead a tutorial on advance

[matplotlib-devel] [OT] Question about the SVN repo

2009-07-16 Thread Gökhan SEVER
Hello, I have a little of the topic question. We have a project ( http://sourceforge.net/projects/adpaa/) setup in SF using the CVS. There when I look at the code submit logs: for instance: gsever committed patchset 219

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
> OK, that's great. It enlightens me. So, it seems you guys are on the > right track. I'll just wait for the new versions of wx to come out. You > are doing great work on that. > Thanks. > One piece of warning: Wx has a terrible upgrade path. Upgrading it breaks > stuff. As a consequence, people

Re: [matplotlib-devel] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
This is a great project and I'm sure we're all looking forward to having > "just one way to do it". > > However, do not overestimate how up-to-date these packages will be, > particularly in managed environments. For instance the RHEL4 boxes we run > at my employer still have pygtk 2.4. (Yes, that

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 10:45:04AM -0700, Brian Granger wrote: >Obviously, the creation of the IApp object should be put into the GUI >toolkit initialization code in mpl/mayavi/etc.� I will work with Robin to >get a version of wx posted that has the patched applied so people can >be

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
Good question Gael, > So, ... I am dumb, and I haven't been following things well enough (not > enough time). Concretely, what do I need to do to be able to launch > IPython, and pop up a wx dialog not blocking IPython with the new > technology? > If you have a patched version of wx (that Robin

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 10:38:56AM -0700, Brian Granger wrote: >But, at some point, we will have to say "if you want the old threaded >shells, you will have to use an older version of IPython".� We just have >to figure out what the transition looks like. As long as the packages sitting

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 08:28:11PM +0300, Ville M. Vainio wrote: > On Thu, Jul 16, 2009 at 8:20 PM, Gael > Varoquaux wrote: > > Would it be possible for IPython to expose both solutions for a while > > (say 6 month to a year), so that we all have time to adapt? > You can start adapting already, a

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
On Thu, Jul 16, 2009 at 10:20 AM, Gael Varoquaux < gael.varoqu...@normalesup.org> wrote: > On Thu, Jul 16, 2009 at 10:04:33AM -0700, Brian Granger wrote: > >So, how does affect your project? > > >* People will be able to use your project interactive from the regular > >python prompt. >

Re: [matplotlib-devel] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Michael Droettboom
This is a great project and I'm sure we're all looking forward to having "just one way to do it". However, do not overestimate how up-to-date these packages will be, particularly in managed environments. For instance the RHEL4 boxes we run at my employer still have pygtk 2.4. (Yes, that is 4

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Gael Varoquaux
On Thu, Jul 16, 2009 at 10:04:33AM -0700, Brian Granger wrote: >So, how does affect your project? >* People will be able to use your project interactive from the regular >python prompt. >* You will need to make small changes to your GUI toolkits initialization >code. >* All

[matplotlib-devel] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

2009-07-16 Thread Brian Granger
Hello all, [sent to mpl-dev, enthought-dev and ipython-dev] This summer, we are doing some major refactoring of IPython's core. One of the things I am working on is changing how IPython's works with GUI toolkits. These changes will have a significant impact (hopefully for the better) on your pr