From zeitlinie at yahoo.de Thu May 1 03:48:58 2014 From: zeitlinie at yahoo.de (Zeitlinie) Date: Thu, 01 May 2014 09:48:58 +0200 Subject: [IPython-dev] Mayavi broken TraitError Message-ID: <5361FC6A.1090502@yahoo.de> Does anyone on this list use Mayavi for 3D visualization? For me the new version I had to move to is broken. Trying to just open a figure like from mayavi import mlab as ml ml.figure() fails with the error msgs. appended. If you need a more detailed traceback pls. let me know. I'm running opensuse 13.1 with the following p Mayavi related packages installed: python-mayavi-4.3.1-1.6.x86_64 python-mayavi-doc-4.3.1-1.6.x86_64 vtk-6.0.0-3.1.4.x86_64 python-tvtk-4.3.1-1.6.x86_64 vtkdata-6.0.0-2.1.2.noarch python-vtk-qt-6.0.0-3.1.4.x86_64 python-evtk-0.2.0-1.6.x86_64 python-vtk-6.0.0-3.1.4.x86_64 vtk-java-6.0.0-3.1.4.x86_64 vtk-devel-6.0.0-3.1.4.x86_64 vtk-qt-6.0.0-3.1.4.x86_64 vtk-tcl-6.0.0-3.1.4.x86_64 vtk-examples-6.0.0-3.1.4.x86_64 python-traits-4.3.0-4.3.x86_64 python-traitsui-4.3.0-4.25.noarch Any help would be most appreciated. Mark ========== Error msgs. ================= TraitError: The 'input' trait of a PolyDataMapper instance is 'read only'. In [3]: Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/tvtk/messenger.py", line 308, in send _messenger.send(obj, event, *args, **kw_args) File "/usr/lib64/python2.7/site-packages/tvtk/messenger.py", line 249, in send getattr(inst, meth)(source, event, *args, **kw_args) File "/usr/lib64/python2.7/site-packages/tvtk/tvtk_base.py", line 456, in update_traits setattr(self, name, val) File "/usr/lib64/python2.7/site-packages/traits/trait_handlers.py", line 170, in error value ) TraitError: The 'alpha_bit_planes' trait of a XOpenGLRenderWindow instance must be 'f' or 'false' or 'n' or 'no' or 'off' or 'on' or 't' or 'true' or 'y' or 'yes' or 0 or 1, but a value of 8 <type 'int'> was specified. If you suspect this is an IPython bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev at scipy.org You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it. Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/tvtk/pyface/ui/wx/scene.py", line 535, in OnPaint self.light_manager = light_manager.LightManager(self) File "/usr/lib64/python2.7/site-packages/tvtk/pyface/light_manager.py", line 351, in __init__ light = CameraLight(self.renwin) File "/usr/lib64/python2.7/site-packages/tvtk/pyface/light_manager.py", line 167, in __init__ self.glyph = LightGlyph() File "/usr/lib64/python2.7/site-packages/tvtk/pyface/light_manager.py", line 59, in __init__ tf.input = arrow.output File "/usr/lib64/python2.7/site-packages/traits/trait_handlers.py", line 102, in _read_only name, class_of( object ) ) TraitError: The 'input' trait of a TransformFilter instance is 'read only'. If you suspect this is an IPython bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev at scipy.org You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it. Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True From arnd.baecker at web.de Thu May 1 04:26:16 2014 From: arnd.baecker at web.de (Arnd Baecker) Date: Thu, 1 May 2014 10:26:16 +0200 (CEST) Subject: [IPython-dev] Mayavi broken TraitError In-Reply-To: <5361FC6A.1090502@yahoo.de> References: <5361FC6A.1090502@yahoo.de> Message-ID: <alpine.DEB.2.02.1405011001210.18848@ptpcp8> Hi, On Thu, 1 May 2014, Zeitlinie wrote: > Does anyone on this list use Mayavi for 3D visualization? A better place to ask is MayaVi users <mayavi-users at lists.sourceforge.net> enthought-dev <enthought-dev at enthought.com> > For me the new version I had to move to is broken. On a SUSE machine of a colleage we also had problems installing MayaVi as somehow a recent vtk (ver 6) was installed, while the provided tvtk version did not support vtk 6. In the end installing the whole ETS (http://code.enthought.com/projects/) and a downgraded vtk did solve it somehow; I don't have the details and would not really recommmend that approach... (Note that I never encountered such type of dependency problems with *ubuntu or debian ..) Support for VTK-6.x was announced two weeks ago, so you could give installing the development version of ETS a try, see http://code.enthought.com/source/ To install this without root access to an arbitrary place you can do: export PYTHONPATH=/MYDEST/lib/python2.7/site-packages/:$PYTHONPATH python ets.py python setup.py develop --prefix=/MYDEST BTW: It seems that the bug you encounter is already described here: https://github.com/enthought/mayavi/issues/127 Best, Arnd From doug.blank at gmail.com Thu May 1 12:58:12 2014 From: doug.blank at gmail.com (Doug Blank) Date: Thu, 1 May 2014 12:58:12 -0400 Subject: [IPython-dev] Two frontends, one kernel Message-ID: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> Devs, I have been trying to find the cause of this bug for some time, and I thought that someone might be able to provide a hint as to where to look to find the issue. We have an external kernel that works very well when you connect onto it with a single frontend. But when you connect two frontends (console or notebook), then the conversation gets confused. More detail: Terminal 1: ipython console --profile calico works fine. Terminal 2: ipython console --profile calico --existing starts, but now things are confused. Now, each terminal takes turns being able to get the prompt. If run in notebook, then code execution never signals the end of computing (the [*] never turns to a number, but you can still enter and get results back). In the console, output is received, but the prompt is in the other terminal. It works fine with a single front end. Any ideas appreciated! -Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/3b42daca/attachment.html> From benjaminrk at gmail.com Thu May 1 14:37:11 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 1 May 2014 11:37:11 -0700 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> Message-ID: <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> What are your socket types on the Kernel side? On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com> wrote: > Devs, I have been trying to find the cause of this bug for some time, and > I thought that someone might be able to provide a hint as to where to look > to find the issue. > > We have an external kernel that works very well when you connect onto it > with a single frontend. But when you connect two frontends (console or > notebook), then the conversation gets confused. > > More detail: > > Terminal 1: > > ipython console --profile calico > > works fine. > > Terminal 2: > > ipython console --profile calico --existing > > starts, but now things are confused. Now, each terminal takes turns being > able to get the prompt. If run in notebook, then code execution never > signals the end of computing (the [*] never turns to a number, but you can > still enter and get results back). In the console, output is received, but > the prompt is in the other terminal. > > It works fine with a single front end. > > Any ideas appreciated! > > -Doug > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/d8dc917a/attachment.html> From doug.blank at gmail.com Thu May 1 15:45:40 2014 From: doug.blank at gmail.com (Doug Blank) Date: Thu, 1 May 2014 15:45:40 -0400 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> Message-ID: <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: > What are your socket types on the Kernel side? > Here is the definitions for our channels: public class ShellChannel : Channel { base(session, auth, transport, address, port, SocketType.DEALER) { } } public class IOPubChannel : Channel { base(session, auth, transport, address, port, SocketType.PUB) { } } public class ControlChannel : Channel { base(session, auth, transport, address, port, SocketType.DEALER) { } } public class StdInChannel : Channel { base(session, auth, transport, address, port, SocketType.DEALER) { } } public class HeartBeatChannel : Channel { base(session, auth, transport, address, port, SocketType.REP) { } } Could that really effect multi-frontend, but not single? -Doug > > > On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com> wrote: > >> Devs, I have been trying to find the cause of this bug for some time, and >> I thought that someone might be able to provide a hint as to where to look >> to find the issue. >> >> We have an external kernel that works very well when you connect onto it >> with a single frontend. But when you connect two frontends (console or >> notebook), then the conversation gets confused. >> >> More detail: >> >> Terminal 1: >> >> ipython console --profile calico >> >> works fine. >> >> Terminal 2: >> >> ipython console --profile calico --existing >> >> starts, but now things are confused. Now, each terminal takes turns being >> able to get the prompt. If run in notebook, then code execution never >> signals the end of computing (the [*] never turns to a number, but you can >> still enter and get results back). In the console, output is received, but >> the prompt is in the other terminal. >> >> It works fine with a single front end. >> >> Any ideas appreciated! >> >> -Doug >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/f7686f02/attachment.html> From benjaminrk at gmail.com Thu May 1 16:01:59 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 1 May 2014 13:01:59 -0700 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> Message-ID: <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> All of those DEALER sockets should be ROUTER sockets. The DEALER behavior is correct for only one peer, but it will round-robin replies if there is more than one. Clearly some documentation is wrong. Where did you get the suggestion that they should be DEALER sockets? -MinRK On Thu, May 1, 2014 at 12:45 PM, Doug Blank <doug.blank at gmail.com> wrote: > On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: > >> What are your socket types on the Kernel side? >> > > Here is the definitions for our channels: > > public class ShellChannel : Channel { > base(session, auth, transport, address, port, SocketType.DEALER) { > } > } > public class IOPubChannel : Channel { > base(session, auth, transport, address, port, SocketType.PUB) { > } > } > public class ControlChannel : Channel { > base(session, auth, transport, address, port, SocketType.DEALER) { > } > } > public class StdInChannel : Channel { > base(session, auth, transport, address, port, SocketType.DEALER) { > } > } > public class HeartBeatChannel : Channel { > base(session, auth, transport, address, port, SocketType.REP) { > } > } > > Could that really effect multi-frontend, but not single? > > -Doug > > > >> >> >> On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com> wrote: >> >>> Devs, I have been trying to find the cause of this bug for some time, >>> and I thought that someone might be able to provide a hint as to where to >>> look to find the issue. >>> >>> We have an external kernel that works very well when you connect onto it >>> with a single frontend. But when you connect two frontends (console or >>> notebook), then the conversation gets confused. >>> >>> More detail: >>> >>> Terminal 1: >>> >>> ipython console --profile calico >>> >>> works fine. >>> >>> Terminal 2: >>> >>> ipython console --profile calico --existing >>> >>> starts, but now things are confused. Now, each terminal takes turns >>> being able to get the prompt. If run in notebook, then code execution never >>> signals the end of computing (the [*] never turns to a number, but you can >>> still enter and get results back). In the console, output is received, but >>> the prompt is in the other terminal. >>> >>> It works fine with a single front end. >>> >>> Any ideas appreciated! >>> >>> -Doug >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/a26a1cc9/attachment.html> From doug.blank at gmail.com Thu May 1 16:24:11 2014 From: doug.blank at gmail.com (Doug Blank) Date: Thu, 1 May 2014 16:24:11 -0400 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> Message-ID: <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> On Thu, May 1, 2014 at 4:01 PM, MinRK <benjaminrk at gmail.com> wrote: > All of those DEALER sockets should be ROUTER sockets. The DEALER behavior > is correct for only one peer, but it will round-robin replies if there is > more than one. > If I change the ShellChannel to ROUTER then the kernel will no longer respond. If I change the others to ROUTER, then I don't see a difference with prior behavior. > Clearly some documentation is wrong. Where did you get the suggestion > that they should be DEALER sockets? > Probably a combination of finding what would work, and looking at other code (it is sometimes hard to translate code and docs between different ZMQ libraries). Thank you for helping me track this down! -Doug > > -MinRK > > > On Thu, May 1, 2014 at 12:45 PM, Doug Blank <doug.blank at gmail.com> wrote: > >> On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: >> >>> What are your socket types on the Kernel side? >>> >> >> Here is the definitions for our channels: >> >> public class ShellChannel : Channel { >> base(session, auth, transport, address, port, SocketType.DEALER) { >> } >> } >> public class IOPubChannel : Channel { >> base(session, auth, transport, address, port, SocketType.PUB) { >> } >> } >> public class ControlChannel : Channel { >> base(session, auth, transport, address, port, SocketType.DEALER) { >> } >> } >> public class StdInChannel : Channel { >> base(session, auth, transport, address, port, SocketType.DEALER) { >> } >> } >> public class HeartBeatChannel : Channel { >> base(session, auth, transport, address, port, SocketType.REP) { >> } >> } >> >> Could that really effect multi-frontend, but not single? >> >> -Doug >> >> >> >>> >>> >>> On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com> wrote: >>> >>>> Devs, I have been trying to find the cause of this bug for some time, >>>> and I thought that someone might be able to provide a hint as to where to >>>> look to find the issue. >>>> >>>> We have an external kernel that works very well when you connect onto >>>> it with a single frontend. But when you connect two frontends (console or >>>> notebook), then the conversation gets confused. >>>> >>>> More detail: >>>> >>>> Terminal 1: >>>> >>>> ipython console --profile calico >>>> >>>> works fine. >>>> >>>> Terminal 2: >>>> >>>> ipython console --profile calico --existing >>>> >>>> starts, but now things are confused. Now, each terminal takes turns >>>> being able to get the prompt. If run in notebook, then code execution never >>>> signals the end of computing (the [*] never turns to a number, but you can >>>> still enter and get results back). In the console, output is received, but >>>> the prompt is in the other terminal. >>>> >>>> It works fine with a single front end. >>>> >>>> Any ideas appreciated! >>>> >>>> -Doug >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/9f01a085/attachment.html> From benjaminrk at gmail.com Thu May 1 17:35:14 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 1 May 2014 14:35:14 -0700 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> Message-ID: <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> ROUTER sockets use an IDENTITY prefix to determine who the recipient should be. In an IPython message, this would be the frames prior to the '<IDS|MSG>' delimiter. You must send these as the beginning of the reply in order for the reply to arrive at the correct peer. -MinRK On Thu, May 1, 2014 at 1:24 PM, Doug Blank <doug.blank at gmail.com> wrote: > On Thu, May 1, 2014 at 4:01 PM, MinRK <benjaminrk at gmail.com> wrote: > >> All of those DEALER sockets should be ROUTER sockets. The DEALER behavior >> is correct for only one peer, but it will round-robin replies if there is >> more than one. >> > > If I change the ShellChannel to ROUTER then the kernel will no longer > respond. > > If I change the others to ROUTER, then I don't see a difference with prior > behavior. > > > >> Clearly some documentation is wrong. Where did you get the suggestion >> that they should be DEALER sockets? >> > > Probably a combination of finding what would work, and looking at other > code (it is sometimes hard to translate code and docs between different ZMQ > libraries). > > Thank you for helping me track this down! > > -Doug > > >> >> -MinRK >> >> >> On Thu, May 1, 2014 at 12:45 PM, Doug Blank <doug.blank at gmail.com> wrote: >> >>> On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: >>> >>>> What are your socket types on the Kernel side? >>>> >>> >>> Here is the definitions for our channels: >>> >>> public class ShellChannel : Channel { >>> base(session, auth, transport, address, port, SocketType.DEALER) { >>> } >>> } >>> public class IOPubChannel : Channel { >>> base(session, auth, transport, address, port, SocketType.PUB) { >>> } >>> } >>> public class ControlChannel : Channel { >>> base(session, auth, transport, address, port, SocketType.DEALER) { >>> } >>> } >>> public class StdInChannel : Channel { >>> base(session, auth, transport, address, port, SocketType.DEALER) { >>> } >>> } >>> public class HeartBeatChannel : Channel { >>> base(session, auth, transport, address, port, SocketType.REP) { >>> } >>> } >>> >>> Could that really effect multi-frontend, but not single? >>> >>> -Doug >>> >>> >>> >>>> >>>> >>>> On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com>wrote: >>>> >>>>> Devs, I have been trying to find the cause of this bug for some time, >>>>> and I thought that someone might be able to provide a hint as to where to >>>>> look to find the issue. >>>>> >>>>> We have an external kernel that works very well when you connect onto >>>>> it with a single frontend. But when you connect two frontends (console or >>>>> notebook), then the conversation gets confused. >>>>> >>>>> More detail: >>>>> >>>>> Terminal 1: >>>>> >>>>> ipython console --profile calico >>>>> >>>>> works fine. >>>>> >>>>> Terminal 2: >>>>> >>>>> ipython console --profile calico --existing >>>>> >>>>> starts, but now things are confused. Now, each terminal takes turns >>>>> being able to get the prompt. If run in notebook, then code execution never >>>>> signals the end of computing (the [*] never turns to a number, but you can >>>>> still enter and get results back). In the console, output is received, but >>>>> the prompt is in the other terminal. >>>>> >>>>> It works fine with a single front end. >>>>> >>>>> Any ideas appreciated! >>>>> >>>>> -Doug >>>>> >>>>> _______________________________________________ >>>>> IPython-dev mailing list >>>>> IPython-dev at scipy.org >>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140501/160a0975/attachment.html> From doug.blank at gmail.com Fri May 2 12:04:53 2014 From: doug.blank at gmail.com (Doug Blank) Date: Fri, 2 May 2014 12:04:53 -0400 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> Message-ID: <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> On Thu, May 1, 2014 at 5:35 PM, MinRK <benjaminrk at gmail.com> wrote: > ROUTER sockets use an IDENTITY prefix to determine who the recipient > should be. > Ok, I think I understand, but still not working. Here is some wording that (if correct) could be inserted in an expanded discussion of the wire protocol (which doesn't yet mention socket type): http://ipython.org/ipython-doc/dev/development/messaging.html#the-wire-protocol """ If you only want to implement basic functionality (one frontend per kernel, no parallel or cluster support) then using DEALER instead of ROUTER is fine, and a good place to start because you don't need the complexity of the routing protocol. You can simply leave out the routing prefixes before the <IDS|MSG> delimiter in the wire protocol. If you do want more than the basic functionality (such as allowing two frontends to a kernel) then you must use the ROUTER socket type, and must have the correct routing prefixes. """ The problem is that I haven't gotten the routing to work, and it seems like it deserves some documentation. For example, watching the IPython kernel, I appear to see the following kinds of routing: message type: "kernel_info_reply", routing appears to be "SESSION_ID": *** KERNEL SENT: "['860e49d1-3852-4d9a-a623-01271cc95f21', '<IDS|MSG>', '1832e7dad75f76550782d188b01d902c259da4b1d12ad9aa51c11bb756176065', '{"date":"2014-05-02T11:36:54.231974","username":"kernel","session":"a97ba32b-b539-4b37-ab2e-08076f5a9bd6","msg_id":"e4cc180a-d262-4ac8-b4e0-fbc9e49855fb","msg_type":"kernel_info_reply"}', '{"date":"2014-05-02T11:36:53.956564","username":"dblank","session":"860e49d1-3852-4d9a-a623-01271cc95f21","msg_id":"08428883-db50-401d-8601-e62fadcf38ba","msg_type":"kernel_info_request"}', '{}', '{"protocol_version":[4,1],"language_version":[2,7,5],"language":"python","ipython_version":[2,0,0,""]}']" message type: "status", routing appears to be "kernel.KERNEL_ID.status": *** KERNEL SENT: "['kernel.a5092211-ccf1-4017-bab9-58bab7d8eb52.status', '<IDS|MSG>', '1a3ac6b69c87a4e5c30ea95001c86868ee1af08b4e6d953f0478f117ac6f6124', '{"date":"2014-05-02T11:37:56.826835","username":"kernel","session":"a97ba32b-b539-4b37-ab2e-08076f5a9bd6","msg_id":"fefb1c9c-8c93-4a7e-85a0-6440eda8af99","msg_type":"status"}', '{"date":"2014-05-02T11:37:56.824306","username":"dblank","session":"860e49d1-3852-4d9a-a623-01271cc95f21","msg_id":"335597c6-2101-4343-8d64-2a9d328617ef","msg_type":"execute_request"}', '{}', '{"execution_state":"busy"}']" message type: "execute_repl", routing is "execute_reply", raw data (end of message) is list of session ids: *** KERNEL SENT: "[u'execute_reply', {'status': u'ok', 'execution_count': 2, 'user_variables': {}, 'payload': [], 'user_expressions': {}}, {'parent_header': {}, 'msg_type': 'execute_request', 'msg_id': '4a153840-c5f1-4f24-813f-4585c9eb776f', 'content': {'code': '1 + 1\n', 'silent': False, 'user_variables': [], 'store_history': True, 'user_expressions': {}, 'allow_stdin': True}, 'header': {'date': datetime.datetime(2014, 5, 2, 11, 42, 50, 892870), 'username': 'dblank', 'session': '1a402950-a0bf-417d-88d3-13b6d58506c3', 'msg_id': '4a153840-c5f1-4f24-813f-4585c9eb776f', 'msg_type': 'execute_request'}, 'buffers': [], 'metadata': {}}, {'dependencies_met': True, 'engine': u'a5092211-ccf1-4017-bab9-58bab7d8eb52', 'status': u'ok', 'started': datetime.datetime(2014, 5, 2, 11, 42, 50, 896000)}, ['1a402950-a0bf-417d-88d3-13b6d58506c3']]" Am I reading this correctly? If so, then many kernel developers may stop at basic communication and use DEALER (which is fine, I guess). For those of us you want to implement the full spec (with the expectation of having parallel engines working), each of these cases will need to be dealt with, right? Thanks again! -Doug > In an IPython message, this would be the frames prior to the '<IDS|MSG>' > delimiter. You must send these as the beginning of the reply in order for > the reply to arrive at the correct peer. > > -MinRK > > > On Thu, May 1, 2014 at 1:24 PM, Doug Blank <doug.blank at gmail.com> wrote: > >> On Thu, May 1, 2014 at 4:01 PM, MinRK <benjaminrk at gmail.com> wrote: >> >>> All of those DEALER sockets should be ROUTER sockets. The DEALER >>> behavior is correct for only one peer, but it will round-robin replies if >>> there is more than one. >>> >> >> If I change the ShellChannel to ROUTER then the kernel will no longer >> respond. >> >> If I change the others to ROUTER, then I don't see a difference with >> prior behavior. >> >> >> >>> Clearly some documentation is wrong. Where did you get the suggestion >>> that they should be DEALER sockets? >>> >> >> Probably a combination of finding what would work, and looking at other >> code (it is sometimes hard to translate code and docs between different ZMQ >> libraries). >> >> Thank you for helping me track this down! >> >> -Doug >> >> >>> >>> -MinRK >>> >>> >>> On Thu, May 1, 2014 at 12:45 PM, Doug Blank <doug.blank at gmail.com>wrote: >>> >>>> On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: >>>> >>>>> What are your socket types on the Kernel side? >>>>> >>>> >>>> Here is the definitions for our channels: >>>> >>>> public class ShellChannel : Channel { >>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>> } >>>> } >>>> public class IOPubChannel : Channel { >>>> base(session, auth, transport, address, port, SocketType.PUB) { >>>> } >>>> } >>>> public class ControlChannel : Channel { >>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>> } >>>> } >>>> public class StdInChannel : Channel { >>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>> } >>>> } >>>> public class HeartBeatChannel : Channel { >>>> base(session, auth, transport, address, port, SocketType.REP) { >>>> } >>>> } >>>> >>>> Could that really effect multi-frontend, but not single? >>>> >>>> -Doug >>>> >>>> >>>> >>>>> >>>>> >>>>> On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com>wrote: >>>>> >>>>>> Devs, I have been trying to find the cause of this bug for some time, >>>>>> and I thought that someone might be able to provide a hint as to where to >>>>>> look to find the issue. >>>>>> >>>>>> We have an external kernel that works very well when you connect onto >>>>>> it with a single frontend. But when you connect two frontends (console or >>>>>> notebook), then the conversation gets confused. >>>>>> >>>>>> More detail: >>>>>> >>>>>> Terminal 1: >>>>>> >>>>>> ipython console --profile calico >>>>>> >>>>>> works fine. >>>>>> >>>>>> Terminal 2: >>>>>> >>>>>> ipython console --profile calico --existing >>>>>> >>>>>> starts, but now things are confused. Now, each terminal takes turns >>>>>> being able to get the prompt. If run in notebook, then code execution never >>>>>> signals the end of computing (the [*] never turns to a number, but you can >>>>>> still enter and get results back). In the console, output is received, but >>>>>> the prompt is in the other terminal. >>>>>> >>>>>> It works fine with a single front end. >>>>>> >>>>>> Any ideas appreciated! >>>>>> >>>>>> -Doug >>>>>> >>>>>> _______________________________________________ >>>>>> IPython-dev mailing list >>>>>> IPython-dev at scipy.org >>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> IPython-dev mailing list >>>>> IPython-dev at scipy.org >>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140502/73fa60b6/attachment.html> From benjaminrk at gmail.com Fri May 2 13:04:51 2014 From: benjaminrk at gmail.com (MinRK) Date: Fri, 2 May 2014 10:04:51 -0700 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> Message-ID: <CAHNn8BXC-BOxyapNYDBP3+6n03WZHWAegD8Q3X+hzy0vJB=HqA@mail.gmail.com> On Fri, May 2, 2014 at 9:04 AM, Doug Blank <doug.blank at gmail.com> wrote: On Thu, May 1, 2014 at 5:35 PM, MinRK <benjaminrk at gmail.com> wrote: > >> ROUTER sockets use an IDENTITY prefix to determine who the recipient >> should be. >> > > Ok, I think I understand, but still not working. Here is some wording that > (if correct) could be inserted in an expanded discussion of the wire > protocol (which doesn't yet mention socket type): > > http://ipython.org/ipython-doc/dev/development/messaging.html#the-wire-protocol > > """ > If you only want to implement basic functionality (one frontend per > kernel, no parallel or cluster support) then using DEALER instead of ROUTER > is fine, and a good place to start because you don't need the complexity of > the routing protocol. You can simply leave out the routing prefixes before > the <IDS|MSG> delimiter in the wire protocol. > > If you do want more than the basic functionality (such as allowing two > frontends to a kernel) then you must use the ROUTER socket type, and must > have the correct routing prefixes. > """ > I would not add this. I would consider it purely an accident that any kernel with DEALER sockets sometimes appears to work, and no kernel should ever use DEALER sockets on the kernel. I think suggesting that DEALER sockets might work in simple cases would only increase the likelihood that new kernels use dealer sockets, when none should. The addition of a kernel_info request at startup, which is about to go into IPython master, will mean that no kernel using DEALER sockets will work in any frontend, because there will be a minimum of two client sockets connected to the kernel?s shell channel. > The problem is that I haven't gotten the routing to work, and it seems > like it deserves some documentation. For example, watching the IPython > kernel, I appear to see the following kinds of routing: > > message type: "kernel_info_reply", routing appears to be "SESSION_ID": > > *** KERNEL SENT: "['860e49d1-3852-4d9a-a623-01271cc95f21', '<IDS|MSG>', > '1832e7dad75f76550782d188b01d902c259da4b1d12ad9aa51c11bb756176065', > '{"date":"2014-05-02T11:36:54.231974","username":"kernel","session":"a97ba32b-b539-4b37-ab2e-08076f5a9bd6","msg_id":"e4cc180a-d262-4ac8-b4e0-fbc9e49855fb","msg_type":"kernel_info_reply"}', > '{"date":"2014-05-02T11:36:53.956564","username":"dblank","session":"860e49d1-3852-4d9a-a623-01271cc95f21","msg_id":"08428883-db50-401d-8601-e62fadcf38ba","msg_type":"kernel_info_request"}', > '{}', > '{"protocol_version":[4,1],"language_version":[2,7,5],"language":"python","ipython_version":[2,0,0,""]}']" > > message type: "status", routing appears to be "kernel.KERNEL_ID.status": > > *** KERNEL SENT: "['kernel.a5092211-ccf1-4017-bab9-58bab7d8eb52.status', > '<IDS|MSG>', > '1a3ac6b69c87a4e5c30ea95001c86868ee1af08b4e6d953f0478f117ac6f6124', > '{"date":"2014-05-02T11:37:56.826835","username":"kernel","session":"a97ba32b-b539-4b37-ab2e-08076f5a9bd6","msg_id":"fefb1c9c-8c93-4a7e-85a0-6440eda8af99","msg_type":"status"}', > '{"date":"2014-05-02T11:37:56.824306","username":"dblank","session":"860e49d1-3852-4d9a-a623-01271cc95f21","msg_id":"335597c6-2101-4343-8d64-2a9d328617ef","msg_type":"execute_request"}', > '{}', '{"execution_state":"busy"}']" > > message type: "execute_repl", routing is "execute_reply", raw data (end of > message) is list of session ids: > > *** KERNEL SENT: "[u'execute_reply', {'status': u'ok', 'execution_count': > 2, 'user_variables': {}, 'payload': [], 'user_expressions': {}}, > {'parent_header': {}, 'msg_type': 'execute_request', 'msg_id': > '4a153840-c5f1-4f24-813f-4585c9eb776f', 'content': {'code': '1 + 1\n', > 'silent': False, 'user_variables': [], 'store_history': True, > 'user_expressions': {}, 'allow_stdin': True}, 'header': {'date': > datetime.datetime(2014, 5, 2, 11, 42, 50, 892870), 'username': 'dblank', > 'session': '1a402950-a0bf-417d-88d3-13b6d58506c3', 'msg_id': > '4a153840-c5f1-4f24-813f-4585c9eb776f', 'msg_type': 'execute_request'}, > 'buffers': [], 'metadata': {}}, {'dependencies_met': True, 'engine': > u'a5092211-ccf1-4017-bab9-58bab7d8eb52', 'status': u'ok', 'started': > datetime.datetime(2014, 5, 2, 11, 42, 50, 896000)}, > ['1a402950-a0bf-417d-88d3-13b6d58506c3']]" > > Am I reading this correctly? If so, then many kernel developers may stop > at basic communication and use DEALER (which is fine, I guess). For those > of us you want to implement the full spec (with the expectation of having > parallel engines working), each of these cases will need to be dealt with, > right? > I suppose I should add a bit of a zmq primer to the message spec. The relevant bits: ROUTER sockets use IDENTITIES to pick the peer to send messages to. This is the part of the message preceding the ?? delimiter. A ROUTER *must* send replies with the same routing prefix as the requests it receives. A simple (Python) example: DELIM = b'<IDS|MSG>'# request_msg normally constructed by router_socket.recv_multipart() request_msg = [ b'blob', b'other blob', DELIM, b'message frame 0', b'message frame 1'] delim_idx = request_msg.index(DELIM) identities = msg[:delim_idx] msg_frames = msg[delim_idx + 1:] # handle msg.... # build reply_frames with the same routing prefix as the request: reply_frames = [ b'reply 0', b'reply 1' ] reply_msg = identities + [DELIM] + reply_frames router_socket.send_multipart(reply_msg) PUB sockets are different. PUB sockets use only the first message part as a TOPIC, on which sub sockets can filter. In IPython, this is generally ignored, but the message spec describes what IPython does with pub topics. The PUB topic should *not* be the routing prefix used by the ROUTER socket. -MinRK > Thanks again! > > -Doug > > > >> In an IPython message, this would be the frames prior to the '<IDS|MSG>' >> delimiter. You must send these as the beginning of the reply in order for >> the reply to arrive at the correct peer. >> >> -MinRK >> >> >> On Thu, May 1, 2014 at 1:24 PM, Doug Blank <doug.blank at gmail.com> wrote: >> >>> On Thu, May 1, 2014 at 4:01 PM, MinRK <benjaminrk at gmail.com> wrote: >>> >>>> All of those DEALER sockets should be ROUTER sockets. The DEALER >>>> behavior is correct for only one peer, but it will round-robin replies if >>>> there is more than one. >>>> >>> >>> If I change the ShellChannel to ROUTER then the kernel will no longer >>> respond. >>> >>> If I change the others to ROUTER, then I don't see a difference with >>> prior behavior. >>> >>> >>> >>>> Clearly some documentation is wrong. Where did you get the suggestion >>>> that they should be DEALER sockets? >>>> >>> >>> Probably a combination of finding what would work, and looking at other >>> code (it is sometimes hard to translate code and docs between different ZMQ >>> libraries). >>> >>> Thank you for helping me track this down! >>> >>> -Doug >>> >>> >>>> >>>> -MinRK >>>> >>>> >>>> On Thu, May 1, 2014 at 12:45 PM, Doug Blank <doug.blank at gmail.com>wrote: >>>> >>>>> On Thu, May 1, 2014 at 2:37 PM, MinRK <benjaminrk at gmail.com> wrote: >>>>> >>>>>> What are your socket types on the Kernel side? >>>>>> >>>>> >>>>> Here is the definitions for our channels: >>>>> >>>>> public class ShellChannel : Channel { >>>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>>> } >>>>> } >>>>> public class IOPubChannel : Channel { >>>>> base(session, auth, transport, address, port, SocketType.PUB) { >>>>> } >>>>> } >>>>> public class ControlChannel : Channel { >>>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>>> } >>>>> } >>>>> public class StdInChannel : Channel { >>>>> base(session, auth, transport, address, port, SocketType.DEALER) { >>>>> } >>>>> } >>>>> public class HeartBeatChannel : Channel { >>>>> base(session, auth, transport, address, port, SocketType.REP) { >>>>> } >>>>> } >>>>> >>>>> Could that really effect multi-frontend, but not single? >>>>> >>>>> -Doug >>>>> >>>>> >>>>> >>>>>> >>>>>> >>>>>> On Thu, May 1, 2014 at 9:58 AM, Doug Blank <doug.blank at gmail.com>wrote: >>>>>> >>>>>>> Devs, I have been trying to find the cause of this bug for some >>>>>>> time, and I thought that someone might be able to provide a hint as to >>>>>>> where to look to find the issue. >>>>>>> >>>>>>> We have an external kernel that works very well when you connect >>>>>>> onto it with a single frontend. But when you connect two frontends (console >>>>>>> or notebook), then the conversation gets confused. >>>>>>> >>>>>>> More detail: >>>>>>> >>>>>>> Terminal 1: >>>>>>> >>>>>>> ipython console --profile calico >>>>>>> >>>>>>> works fine. >>>>>>> >>>>>>> Terminal 2: >>>>>>> >>>>>>> ipython console --profile calico --existing >>>>>>> >>>>>>> starts, but now things are confused. Now, each terminal takes turns >>>>>>> being able to get the prompt. If run in notebook, then code execution never >>>>>>> signals the end of computing (the [*] never turns to a number, but you can >>>>>>> still enter and get results back). In the console, output is received, but >>>>>>> the prompt is in the other terminal. >>>>>>> >>>>>>> It works fine with a single front end. >>>>>>> >>>>>>> Any ideas appreciated! >>>>>>> >>>>>>> -Doug >>>>>>> >>>>>>> _______________________________________________ >>>>>>> IPython-dev mailing list >>>>>>> IPython-dev at scipy.org >>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> IPython-dev mailing list >>>>>> IPython-dev at scipy.org >>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> IPython-dev mailing list >>>>> IPython-dev at scipy.org >>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140502/3d453315/attachment.html> From doug.blank at gmail.com Fri May 2 17:31:58 2014 From: doug.blank at gmail.com (Doug Blank) Date: Fri, 2 May 2014 17:31:58 -0400 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAHNn8BXC-BOxyapNYDBP3+6n03WZHWAegD8Q3X+hzy0vJB=HqA@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> <CAHNn8BXC-BOxyapNYDBP3+6n03WZHWAegD8Q3X+hzy0vJB=HqA@mail.gmail.com> Message-ID: <CAAusYCjbQbnh-nx3v038ba9cN5vxPMD5pHW-CkbMTsm76jRdaw@mail.gmail.com> On Fri, May 2, 2014 at 1:04 PM, MinRK <benjaminrk at gmail.com> wrote: > On Fri, May 2, 2014 at 9:04 AM, Doug Blank <doug.blank at gmail.com> wrote: > > On Thu, May 1, 2014 at 5:35 PM, MinRK <benjaminrk at gmail.com> wrote: >> >>> ROUTER sockets use an IDENTITY prefix to determine who the recipient >>> should be. >>> >> >> Ok, I think I understand, but still not working. Here is some wording >> that (if correct) could be inserted in an expanded discussion of the wire >> protocol (which doesn't yet mention socket type): >> > >> http://ipython.org/ipython-doc/dev/development/messaging.html#the-wire-protocol >> >> """ >> If you only want to implement basic functionality (one frontend per >> kernel, no parallel or cluster support) then using DEALER instead of ROUTER >> is fine, and a good place to start because you don't need the complexity of >> the routing protocol. You can simply leave out the routing prefixes before >> the <IDS|MSG> delimiter in the wire protocol. >> >> If you do want more than the basic functionality (such as allowing two >> frontends to a kernel) then you must use the ROUTER socket type, and must >> have the correct routing prefixes. >> """ >> > I would not add this. I would consider it purely an accident that any > kernel with DEALER sockets sometimes appears to work, and no kernel should > ever use DEALER sockets on the kernel. > Just to be clear, using DEALER always works without any routing identifiers, with all of the frontends (only one at a time, or course). IPython may not have been design to work this way, may have security issues, and may not work in the future. But with IPython 1, and 2, it works. But now to my question: > I think suggesting that DEALER sockets might work in simple cases would > only increase the likelihood that new kernels use dealer sockets, when none > should. > > The addition of a kernel_info request at startup, which is about to go > into IPython master, will mean that no kernel using DEALER sockets will > work in any frontend, because there will be a minimum of two client sockets > connected to the kernel?s shell channel. > > >> The problem is that I haven't gotten the routing to work, and it seems >> like it deserves some documentation. For example, watching the IPython >> kernel, I appear to see the following kinds of routing: >> >> message type: "kernel_info_reply", routing appears to be "SESSION_ID": >> >> >> message type: "status", routing appears to be "kernel.KERNEL_ID.status": >> >> >> message type: "execute_repl", routing is "execute_reply", raw data (end >> of message) is list of session ids: >> >> >> Am I reading this correctly? If so, then many kernel developers may stop >> at basic communication and use DEALER (which is fine, I guess). For those >> of us you want to implement the full spec (with the expectation of having >> parallel engines working), each of these cases will need to be dealt with, >> right? >> > I suppose I should add a bit of a zmq primer to the message spec. The > relevant bits: > > ROUTER sockets use IDENTITIES to pick the peer to send messages to. This > is the part of the message preceding the ?? delimiter. A ROUTER *must*send replies with the same routing prefix as the requests it receives. > That is an important bit of info! The IPython section on the wire protocol is very misleading in this routing section. > PUB sockets are different. PUB sockets use only the first message part as a TOPIC, on which sub sockets can filter. In IPython, this is generally ignored, but the message spec describes what IPython does with pub topics. The PUB topic should *not* be the routing prefix used by the ROUTER socket. > > What is the "first message part"? Rather than a primer on zmq, I'd rather see something very specific with respect to IPython. What does the request look like? What should the PUB response look like? What would a ROUTER response look like? Is it true that all kernel sends are in response to a request, except for the very first "starting" status message? In that case, it creates a routing identity from scratch? Thanks so much... I feel I am getting close! -Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140502/a6e16606/attachment.html> From benjaminrk at gmail.com Fri May 2 18:25:17 2014 From: benjaminrk at gmail.com (Min RK) Date: Fri, 2 May 2014 15:25:17 -0700 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <CAAusYCjbQbnh-nx3v038ba9cN5vxPMD5pHW-CkbMTsm76jRdaw@mail.gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> <CAHNn8BXC-BOxyapNYDBP3+6n03WZHWAegD8Q3X+hzy0vJB=HqA@mail.gmail.com> <CAAusYCjbQbnh-nx3v038ba9cN5vxPMD5pHW-CkbMTsm76jRdaw@mail.gmail.com> Message-ID: <D054EFEC-BD5D-41A4-9D79-FCEEEA54DC6B@gmail.com> > On May 2, 2014, at 14:31, Doug Blank <doug.blank at gmail.com> wrote: > >> On Fri, May 2, 2014 at 1:04 PM, MinRK <benjaminrk at gmail.com> wrote: >>> On Fri, May 2, 2014 at 9:04 AM, Doug Blank <doug.blank at gmail.com> wrote: >>> >>>> On Thu, May 1, 2014 at 5:35 PM, MinRK <benjaminrk at gmail.com> wrote: >>>> ROUTER sockets use an IDENTITY prefix to determine who the recipient should be. >>> >>> Ok, I think I understand, but still not working. Here is some wording that (if correct) could be inserted in an expanded discussion of the wire protocol (which doesn't yet mention socket type): >> >>> http://ipython.org/ipython-doc/dev/development/messaging.html#the-wire-protocol >>> >>> """ >>> If you only want to implement basic functionality (one frontend per kernel, no parallel or cluster support) then using DEALER instead of ROUTER is fine, and a good place to start because you don't need the complexity of the routing protocol. You can simply leave out the routing prefixes before the <IDS|MSG> delimiter in the wire protocol. >>> >>> If you do want more than the basic functionality (such as allowing two frontends to a kernel) then you must use the ROUTER socket type, and must have the correct routing prefixes. >>> """ >> >> I would not add this. I would consider it purely an accident that any kernel with DEALER sockets sometimes appears to work, and no kernel should ever use DEALER sockets on the kernel. >> > Just to be clear, using DEALER always works without any routing identifiers, with all of the frontends (only one at a time, or course). IPython may not have been design to work this way, may have security issues, and may not work in the future. But with IPython 1, and 2, it works. Also to be clear: this will stop being true in master next week, which is why I don't think it's worth mentioning that DEALER sockets sort of work sometimes, because it is always the wrong thing to use. > But now to my question: > >> I think suggesting that DEALER sockets might work in simple cases would only increase the likelihood that new kernels use dealer sockets, when none should. >> >> The addition of a kernel_info request at startup, which is about to go into IPython master, will mean that no kernel using DEALER sockets will work in any frontend, because there will be a minimum of two client sockets connected to the kernel?s shell channel. >> >>> >>> The problem is that I haven't gotten the routing to work, and it seems like it deserves some documentation. For example, watching the IPython kernel, I appear to see the following kinds of routing: >>> >>> message type: "kernel_info_reply", routing appears to be "SESSION_ID": >>> >>> >>> message type: "status", routing appears to be "kernel.KERNEL_ID.status": >>> >>> >>> message type: "execute_repl", routing is "execute_reply", raw data (end of message) is list of session ids: >>> >>> >>> Am I reading this correctly? If so, then many kernel developers may stop at basic communication and use DEALER (which is fine, I guess). For those of us you want to implement the full spec (with the expectation of having parallel engines working), each of these cases will need to be dealt with, right? >> >> I suppose I should add a bit of a zmq primer to the message spec. The relevant bits: >> >> ROUTER sockets use IDENTITIES to pick the peer to send messages to. This is the part of the message preceding the ?? delimiter. A ROUTER must send replies with the same routing prefix as the requests it receives. >> > That is an important bit of info! The IPython section on the wire protocol is very misleading in this routing section. >> PUB sockets are different. PUB sockets use only the first message part as a TOPIC, on which sub sockets can filter. In IPython, this is generally ignored, but the message spec describes what IPython does with pub topics. The PUB topic should not be the routing prefix used by the ROUTER socket. > What is the "first message part"? > > Rather than a primer on zmq, I'd rather see something very specific with respect to IPython. What does the request look like? What should the PUB response look like? What would a ROUTER response look like? > > Is it true that all kernel sends are in response to a request, except for the very first "starting" status message? In that case, it creates a routing identity from scratch? Adding an example request/iopub/reply cycle in the wire format is a good idea. I will try to draft one this weekend. The general principal: one request has one reply. the routing identity is relevant only to that one reply, and the reply's routing prefix should be identical to the request's. Side effect messages on IOPub do not use routing identities. But they do have a slightly analogous behavior called a subscription topic. This value should not be influenced by the routing prefix, and in practice has no effect because frontends subscribe to all topics (this last statement is already in the msg spec doc). -MinRK > > Thanks so much... I feel I am getting close! > > -Doug > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140502/62f1cb64/attachment.html> From doug.blank at gmail.com Sat May 3 00:11:54 2014 From: doug.blank at gmail.com (Doug Blank) Date: Sat, 3 May 2014 00:11:54 -0400 Subject: [IPython-dev] Two frontends, one kernel In-Reply-To: <D054EFEC-BD5D-41A4-9D79-FCEEEA54DC6B@gmail.com> References: <CAAusYChS6XRNdUdzceOf6j7cKPuoN2Fq=emn2SJRnq01rCQxaA@mail.gmail.com> <CAHNn8BUURPbqdrUew7X9n+vZti_wtzHCVw96_Nh4ycgvSMGAmA@mail.gmail.com> <CAAusYCg6gi4UtMnHo=CjModDrUBGnxE-w5WiuO2D-LrXGG5jMA@mail.gmail.com> <CAHNn8BXE6rjMPBjEuMEh7C6Ts=L7ue1izybCCmu-Eu010-hFog@mail.gmail.com> <CAAusYCjf_KYyMoJQ9RL0ahwHjEWH6pXKnCrdWCawpJ6q+xaYNQ@mail.gmail.com> <CAHNn8BV_Gp=T-BftsU4W7DxYbaY-e5TpJL2qA_0iWw2PSq=_=Q@mail.gmail.com> <CAAusYCivnEfJZLe5PnzBEn=PUAS7r7-cxD1AETsg6xkNoR4KOA@mail.gmail.com> <CAHNn8BXC-BOxyapNYDBP3+6n03WZHWAegD8Q3X+hzy0vJB=HqA@mail.gmail.com> <CAAusYCjbQbnh-nx3v038ba9cN5vxPMD5pHW-CkbMTsm76jRdaw@mail.gmail.com> <D054EFEC-BD5D-41A4-9D79-FCEEEA54DC6B@gmail.com> Message-ID: <CAAusYCi6Tq7-pct2R3=gYccQu7CpoSs674i7a0utd1xiWzGM7A@mail.gmail.com> Got this stage working; it was largely just getting that identity on the front of the shell ROUTER packets. I suspect that there will be things to expand and refine once we can start using the kernel as an engine in a cluster... I hope that using 3rd-party kernels in a parallel cluster is still on the TODO list. I'd be glad to look over any new docs. Thanks again! -Doug > Adding an example request/iopub/reply cycle in the wire format is a good > idea. I will try to draft one this weekend. The general principal: one > request has one reply. the routing identity is relevant only to that one > reply, and the reply's routing prefix should be identical to the request's. > Side effect messages on IOPub do not use routing identities. But they do > have a slightly analogous behavior called a subscription topic. This value > should not be influenced by the routing prefix, and in practice has no > effect because frontends subscribe to all topics (this last statement is > already in the msg spec doc). > > -MinRK > > > Thanks so much... I feel I am getting close! > > -Doug > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140503/81234731/attachment.html> From prabhu at aero.iitb.ac.in Sat May 3 04:09:05 2014 From: prabhu at aero.iitb.ac.in (Prabhu Ramachandran) Date: Sat, 03 May 2014 13:39:05 +0530 Subject: [IPython-dev] Mayavi broken TraitError In-Reply-To: <alpine.DEB.2.02.1405011001210.18848@ptpcp8> References: <5361FC6A.1090502@yahoo.de> <alpine.DEB.2.02.1405011001210.18848@ptpcp8> Message-ID: <5364A421.3070308@aero.iitb.ac.in> On 5/1/14 1:56 PM, Arnd Baecker wrote: > On Thu, 1 May 2014, Zeitlinie wrote: > >> Does anyone on this list use Mayavi for 3D visualization? > > A better place to ask is > MayaVi users<mayavi-users at lists.sourceforge.net> > enthought-dev<enthought-dev at enthought.com> Indeed, that is the right forum to ask as this question is not IPython related at all. > Support for VTK-6.x was announced two weeks ago, > so you could give installing the development version > of ETS a try, see http://code.enthought.com/source/ > To install this without root access to an arbitrary place > you can do: > export PYTHONPATH=/MYDEST/lib/python2.7/site-packages/:$PYTHONPATH > python ets.py python setup.py develop --prefix=/MYDEST > > BTW: It seems that the bug you encounter is already described here: > https://github.com/enthought/mayavi/issues/127 Yes, all this is fixed in master, so using master is the best bet until we finish some further cleanup and cut a new release. cheers, Prabhu From clyde.fare at gmail.com Sat May 3 11:00:24 2014 From: clyde.fare at gmail.com (Clyde Fare) Date: Sat, 3 May 2014 16:00:24 +0100 Subject: [IPython-dev] Execute python code from the notebook dashboard Message-ID: <CAA3Z2fO-r-yg8XvREOBmuq6Sj8aRF59kmAFE3mAcoGv4fFJLug@mail.gmail.com> Hi, I'm trying to create a graphical IPython notebook dashboard that represents a collection of notebooks as a network, where nodes are the notebooks and the links between them are links between notebooks specified in markdown cells. I've got something that kind of works ( https://github.com/Clyde-fare/ipython_graphdash) but it requires manual execution of some python code in the directory that IPython is launched from. I'd like to get rid of this requirement by having this python code execute when people click the refresh notebook list icon on the dashboard. I'm very much a beginner javascript wise but as far as I can tell when we open a notebook a python kernel is launched but at the dashboard there is no kernel active and so in order to execute some python code I would have to first launch a kernel and then pass it the code I want to run. I think I can probably go away and figure out how to do that but I wanted to check whether this was the right idea, or whether there was a simpler way? Cheers Clyde -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140503/8d9badd4/attachment.html> From klonuo at gmail.com Sat May 3 12:31:22 2014 From: klonuo at gmail.com (klo uo) Date: Sat, 3 May 2014 18:31:22 +0200 Subject: [IPython-dev] Html object graph Message-ID: <CAA-8Ld_DHsN8ptHV30erT85wdNiAh4cMHm0yV6dW96qg+VxH0A@mail.gmail.com> Hey guys, are you are familiar with LinqPad?<https://www.linqpad.net/CodeSnippetIDE.aspx> If not, just to say it's a lightweight code scratchpad, that can connect to various databases and allow immediate Linq execution. It can also interpret any kind of .Net code (although currently without IronPython/Ruby). I thought to ask you about main output result pane - it's a very interesting Html table representation of dumped object(s), that adapts on the object type - allows collapsible nested levels, navigable deep Exception tree, can display images, rawhtml, hyperlinqs - user defined lambda functions that are executed on user click, ... Do you think something similar would fit in IPython? As object inspection magic, or Qtconsole output pane, or else...? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140503/39717308/attachment.html> From damontallen at gmail.com Mon May 5 08:07:22 2014 From: damontallen at gmail.com (Damon Allen) Date: Mon, 5 May 2014 08:07:22 -0400 Subject: [IPython-dev] NBVierer Down? Message-ID: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> Hello, Is anyone working on NBViewer? The Site itself is up by I cannot get any notebooks to render. I went to HipChat a couple of times trying to ask, but no one was there. I thought someone might want to look into it. Damon -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/5ecfd6ae/attachment.html> From doug.blank at gmail.com Mon May 5 08:10:58 2014 From: doug.blank at gmail.com (Doug Blank) Date: Mon, 5 May 2014 08:10:58 -0400 Subject: [IPython-dev] NBVierer Down? In-Reply-To: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> References: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> Message-ID: <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> This works for me: http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Calico%20Overview.ipynb -Doug On Mon, May 5, 2014 at 8:07 AM, Damon Allen <damontallen at gmail.com> wrote: > Hello, > > Is anyone working on NBViewer? The Site itself is up by I cannot get any > notebooks to render. I went to HipChat a couple of times trying to ask, > but no one was there. I thought someone might want to look into it. > > Damon > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/b5593f12/attachment.html> From damontallen at gmail.com Mon May 5 08:15:12 2014 From: damontallen at gmail.com (Damon Allen) Date: Mon, 5 May 2014 08:15:12 -0400 Subject: [IPython-dev] NBVierer Down? In-Reply-To: <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> References: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> Message-ID: <CAMYKURZ13AqAzV6er+qptT2rQLqyd2pw_FjvZR-ZVmNPpw7wNg@mail.gmail.com> That is odd. I keep getting error screens until now. Now other notebooks are loading... Damon On Mon, May 5, 2014 at 8:10 AM, Doug Blank <doug.blank at gmail.com> wrote: > This works for me: > > > http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Calico%20Overview.ipynb > > -Doug > > > On Mon, May 5, 2014 at 8:07 AM, Damon Allen <damontallen at gmail.com> wrote: > >> Hello, >> >> Is anyone working on NBViewer? The Site itself is up by I cannot get >> any notebooks to render. I went to HipChat a couple of times trying to >> ask, but no one was there. I thought someone might want to look into it. >> >> Damon >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/7c67465e/attachment.html> From rgbkrk at gmail.com Mon May 5 08:32:00 2014 From: rgbkrk at gmail.com (Kyle Kelley) Date: Mon, 5 May 2014 07:32:00 -0500 Subject: [IPython-dev] NBVierer Down? In-Reply-To: <CAMYKURZ13AqAzV6er+qptT2rQLqyd2pw_FjvZR-ZVmNPpw7wNg@mail.gmail.com> References: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> <CAMYKURZ13AqAzV6er+qptT2rQLqyd2pw_FjvZR-ZVmNPpw7wNg@mail.gmail.com> Message-ID: <CA+tbMaWM=DMjH0k-dXe+_Xf3aMLgK=ao=3Q5-bsJOG52mwZ_Jw@mail.gmail.com> Yeah, I just fixed it. Detailed summary: nbviewer currently pulls from IPython's master branch on deployments. My guess is that on the last deployment, the git submodules were out of sync and salt+supervisor were unable to rectify the situation. I updated the submodules manually then made sure to fix the deployment setup in the salt states so this isn't an issue again. -- Kyle On Mon, May 5, 2014 at 7:15 AM, Damon Allen <damontallen at gmail.com> wrote: > That is odd. I keep getting error screens until now. Now other notebooks > are loading... > > Damon > > > > > On Mon, May 5, 2014 at 8:10 AM, Doug Blank <doug.blank at gmail.com> wrote: > >> This works for me: >> >> >> http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Calico%20Overview.ipynb >> >> -Doug >> >> >> On Mon, May 5, 2014 at 8:07 AM, Damon Allen <damontallen at gmail.com>wrote: >> >>> Hello, >>> >>> Is anyone working on NBViewer? The Site itself is up by I cannot get >>> any notebooks to render. I went to HipChat a couple of times trying to >>> ask, but no one was there. I thought someone might want to look into it. >>> >>> Damon >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/32443ee0/attachment.html> From bussonniermatthias at gmail.com Mon May 5 08:48:46 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 5 May 2014 14:48:46 +0200 Subject: [IPython-dev] NBVierer Down? In-Reply-To: <CA+tbMaWM=DMjH0k-dXe+_Xf3aMLgK=ao=3Q5-bsJOG52mwZ_Jw@mail.gmail.com> References: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> <CAMYKURZ13AqAzV6er+qptT2rQLqyd2pw_FjvZR-ZVmNPpw7wNg@mail.gmail.com> <CA+tbMaWM=DMjH0k-dXe+_Xf3aMLgK=ao=3Q5-bsJOG52mwZ_Jw@mail.gmail.com> Message-ID: <0E81B261-727D-4FAB-A21C-D3F115F3E3C4@gmail.com> Thanks Kyle you are awesome. https://www.youtube.com/watch?v=StTqXEQ2l-Y -- M Le 5 mai 2014 ? 14:32, Kyle Kelley a ?crit : > Yeah, I just fixed it. > > Detailed summary: nbviewer currently pulls from IPython's master branch on deployments. My guess is that on the last deployment, the git submodules were out of sync and salt+supervisor were unable to rectify the situation. I updated the submodules manually then made sure to fix the deployment setup in the salt states so this isn't an issue again. > > -- Kyle > > > > On Mon, May 5, 2014 at 7:15 AM, Damon Allen <damontallen at gmail.com> wrote: > That is odd. I keep getting error screens until now. Now other notebooks are loading... > > Damon > > > > > On Mon, May 5, 2014 at 8:10 AM, Doug Blank <doug.blank at gmail.com> wrote: > This works for me: > > http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Calico%20Overview.ipynb > > -Doug > > > On Mon, May 5, 2014 at 8:07 AM, Damon Allen <damontallen at gmail.com> wrote: > Hello, > > Is anyone working on NBViewer? The Site itself is up by I cannot get any notebooks to render. I went to HipChat a couple of times trying to ask, but no one was there. I thought someone might want to look into it. > > Damon > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/2e96261a/attachment.html> From fperez.net at gmail.com Mon May 5 08:49:37 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 5 May 2014 13:49:37 +0100 Subject: [IPython-dev] NBVierer Down? In-Reply-To: <0E81B261-727D-4FAB-A21C-D3F115F3E3C4@gmail.com> References: <CAMYKURbX6dPBKwoecs8sebv0=HmH8npH5FUimz+28_83j8Yo6A@mail.gmail.com> <CAAusYCgNC_viVSoxUxYL7BfDjkiBjrss8t=zyZe5fPFA2wNLHw@mail.gmail.com> <CAMYKURZ13AqAzV6er+qptT2rQLqyd2pw_FjvZR-ZVmNPpw7wNg@mail.gmail.com> <CA+tbMaWM=DMjH0k-dXe+_Xf3aMLgK=ao=3Q5-bsJOG52mwZ_Jw@mail.gmail.com> <0E81B261-727D-4FAB-A21C-D3F115F3E3C4@gmail.com> Message-ID: <CAHAreOqmmaRST8cd8yaZezBV+=L28pq0TZVyiD_r_9PvXjCohA@mail.gmail.com> +1000,thanks so much. On May 5, 2014 5:46 AM, "Matthias BUSSONNIER" <bussonniermatthias at gmail.com> wrote: > Thanks Kyle you are awesome. > > > https://www.youtube.com/watch?v=StTqXEQ2l-Y > > -- > M > Le 5 mai 2014 ? 14:32, Kyle Kelley a ?crit : > > Yeah, I just fixed it. > > Detailed summary: nbviewer currently pulls from IPython's master branch on > deployments. My guess is that on the last deployment, the git submodules > were out of sync and salt+supervisor were unable to rectify the situation. > I updated the submodules manually then made sure to fix the deployment > setup in the salt states so this isn't an issue again. > > -- Kyle > > > > On Mon, May 5, 2014 at 7:15 AM, Damon Allen <damontallen at gmail.com> wrote: > >> That is odd. I keep getting error screens until now. Now other >> notebooks are loading... >> >> Damon >> >> >> >> >> On Mon, May 5, 2014 at 8:10 AM, Doug Blank <doug.blank at gmail.com> wrote: >> >>> This works for me: >>> >>> >>> http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Calico%20Overview.ipynb >>> >>> -Doug >>> >>> >>> On Mon, May 5, 2014 at 8:07 AM, Damon Allen <damontallen at gmail.com>wrote: >>> >>>> Hello, >>>> >>>> Is anyone working on NBViewer? The Site itself is up by I cannot get >>>> any notebooks to render. I went to HipChat a couple of times trying to >>>> ask, but no one was there. I thought someone might want to look into it. >>>> >>>> Damon >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/b1c3e2ff/attachment.html> From mgadbois at gmail.com Mon May 5 11:00:07 2014 From: mgadbois at gmail.com (Martin Gadbois) Date: Mon, 5 May 2014 11:00:07 -0400 Subject: [IPython-dev] SQLite kernel Message-ID: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> Hi! I would like to develop a SQLite kernel for IPython. Keyword, table and column completion would help building queries, and a dynamic output could resize text columns and have a proper notebook table output. To achieve that, I see two main directions: 1- Have an external kernel (like http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) coded in Python since there are no 0MQ bindings for SQLite. 2- Extend IPython itself to support SQLite, since I will need to write Python code anyway to support SQLite. What would this list recommend as an implementation strategy? Any example of creating an external kernel by reusing a subset of IPython itself? Thanks! -- Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/8e0a0e44/attachment.html> From doug.blank at gmail.com Mon May 5 11:28:50 2014 From: doug.blank at gmail.com (Doug Blank) Date: Mon, 5 May 2014 11:28:50 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> Message-ID: <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com> wrote: > Hi! > > I would like to develop a SQLite kernel for IPython. > > Keyword, table and column completion would help building queries, and a > dynamic output could resize text columns and have a proper notebook table > output. > > To achieve that, I see two main directions: > 1- Have an external kernel (like > http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) coded > in Python since there are no 0MQ bindings for SQLite. > 2- Extend IPython itself to support SQLite, since I will need to write > Python code anyway to support SQLite. > I've wanted something like this for a while! I would like to incorporate SQL as a language that could easily be used in a variety of educational settings and other open source projects. But the utility of such a project lies in the details of implementation. There are pros and cons to both approaches. But you could perhaps develop it in a manner that could be used in either situation. What would generally be useful would be to replicate the SQLite shell. It would be great if the parser was written in pure Python, and had an interpreter, also as much written in pure Python as possible. That is, it would be great if the low-level C-based sqlite API was limited, and could be swapped out. That would allow other implementations of Python (Jython, PyPy, IronPython) could use it with their own sqlite wrappers. But also, that might make it useful for interfacing other data storages (for example, CSV files, Django databases, etc.) The SQLite shell is actually a bit hairy. Here is a port of the C code to C# for example: http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell You could also use the simple-kernel [1] as a way of quickly turning a Python program into a kernel. (simple-kernel was just updated by Min, so now it is correct; thanks, Min!) This might also have connections to the ADODB API [2]... they have worked hard to make their connections be Python-implementation agnostic. Looking forward to see what you develop! -Doug [1] https://github.com/dsblank/simple_kernel [2] https://sourceforge.net/projects/adodbapi > > What would this list recommend as an implementation strategy? > Any example of creating an external kernel by reusing a subset of IPython > itself? > > Thanks! > > -- > Martin > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/bdd9a803/attachment.html> From jhamrick at berkeley.edu Mon May 5 11:52:40 2014 From: jhamrick at berkeley.edu (Jessica B. Hamrick) Date: Mon, 5 May 2014 08:52:40 -0700 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> Message-ID: <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> Hi all, I jut wanted to throw out there a link to the SQL magic, which may be relevant: https://github.com/catherinedevlin/ipython-sql I know it's not a whole kernel, but may be a good starting place for at least seeing what other people have been thinking about along the same directions. Cheers, Jess -- UC Berkeley, Department of Psychology Computational Cognitive Science Lab http://www.jesshamrick.com On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com> wrote: > On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com>wrote: > >> Hi! >> >> I would like to develop a SQLite kernel for IPython. >> >> Keyword, table and column completion would help building queries, and a >> dynamic output could resize text columns and have a proper notebook table >> output. >> >> To achieve that, I see two main directions: >> 1- Have an external kernel (like >> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >> coded in Python since there are no 0MQ bindings for SQLite. >> 2- Extend IPython itself to support SQLite, since I will need to write >> Python code anyway to support SQLite. >> > > I've wanted something like this for a while! I would like to incorporate > SQL as a language that could easily be used in a variety of educational > settings and other open source projects. But the utility of such a project > lies in the details of implementation. > > There are pros and cons to both approaches. But you could perhaps develop > it in a manner that could be used in either situation. What would generally > be useful would be to replicate the SQLite shell. It would be great if the > parser was written in pure Python, and had an interpreter, also as much > written in pure Python as possible. That is, it would be great if the > low-level C-based sqlite API was limited, and could be swapped out. > > That would allow other implementations of Python (Jython, PyPy, > IronPython) could use it with their own sqlite wrappers. But also, that > might make it useful for interfacing other data storages (for example, CSV > files, Django databases, etc.) > > The SQLite shell is actually a bit hairy. Here is a port of the C code to > C# for example: > > http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell > > You could also use the simple-kernel [1] as a way of quickly turning a > Python program into a kernel. (simple-kernel was just updated by Min, so > now it is correct; thanks, Min!) > > This might also have connections to the ADODB API [2]... they have worked > hard to make their connections be Python-implementation agnostic. > > Looking forward to see what you develop! > > -Doug > > [1] https://github.com/dsblank/simple_kernel > [2] https://sourceforge.net/projects/adodbapi > > >> >> What would this list recommend as an implementation strategy? >> Any example of creating an external kernel by reusing a subset of IPython >> itself? >> >> Thanks! >> >> -- >> Martin >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/3a356247/attachment.html> From takowl at gmail.com Mon May 5 12:04:43 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 5 May 2014 09:04:43 -0700 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> Message-ID: <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> Hi Martin, On 5 May 2014 08:00, Martin Gadbois <mgadbois at gmail.com> wrote: > I would like to develop a SQLite kernel for IPython. > > Keyword, table and column completion would help building queries, and a > dynamic output could resize text columns and have a proper notebook table > output. > > To achieve that, I see two main directions: > 1- Have an external kernel (like > http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) coded > in Python since there are no 0MQ bindings for SQLite. > 2- Extend IPython itself to support SQLite, since I will need to write > Python code anyway to support SQLite. > We're actually planning to refactor the IPython kernel machinery in the next few weeks to make it easier to write kernels in Python. Once this is done, you'll be able to create a new kernel by inheriting from a class in IPython, and defining methods for execution and completion. So unless you need to do it urgently, I'd recommend waiting for that infrastructure, and then it will be quite simple. Best wishes, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/76e18d1a/attachment.html> From sylvain.corlay at gmail.com Mon May 5 12:40:32 2014 From: sylvain.corlay at gmail.com (Sylvain Corlay) Date: Mon, 5 May 2014 12:40:32 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> Message-ID: <CAK=Phk6SpZWXc_G0UAPa3izeM=cr-trWQGsGqM-QV+58kuhx+A@mail.gmail.com> Hi Thomas, I did not see a PR open . Do you have a link to the discussion on this? I have done some experiments with kernels implemented in Python and I am very interested in this. Sylvain On Mon, May 5, 2014 at 12:04 PM, Thomas Kluyver <takowl at gmail.com> wrote: > Hi Martin, > > On 5 May 2014 08:00, Martin Gadbois <mgadbois at gmail.com> wrote: > >> I would like to develop a SQLite kernel for IPython. >> >> Keyword, table and column completion would help building queries, and a >> dynamic output could resize text columns and have a proper notebook table >> output. >> >> To achieve that, I see two main directions: >> 1- Have an external kernel (like >> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >> coded in Python since there are no 0MQ bindings for SQLite. >> 2- Extend IPython itself to support SQLite, since I will need to write >> Python code anyway to support SQLite. >> > > We're actually planning to refactor the IPython kernel machinery in the > next few weeks to make it easier to write kernels in Python. Once this is > done, you'll be able to create a new kernel by inheriting from a class in > IPython, and defining methods for execution and completion. So unless you > need to do it urgently, I'd recommend waiting for that infrastructure, and > then it will be quite simple. > > Best wishes, > Thomas > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/d5613f86/attachment.html> From takowl at gmail.com Mon May 5 13:18:34 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 5 May 2014 10:18:34 -0700 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAK=Phk6SpZWXc_G0UAPa3izeM=cr-trWQGsGqM-QV+58kuhx+A@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> <CAK=Phk6SpZWXc_G0UAPa3izeM=cr-trWQGsGqM-QV+58kuhx+A@mail.gmail.com> Message-ID: <CAOvn4qhc_fA_iZQJqjXJsbr7o+0iQ1HNUTU7=ieP5Odt8VR1CA@mail.gmail.com> Hi Sylvain, On 5 May 2014 09:40, Sylvain Corlay <sylvain.corlay at gmail.com> wrote: > Hi Thomas, > I did not see a PR open . Do you have a link to the discussion on this? I > have done some experiments with kernels implemented in Python and I am very > interested in this. > There's no PR yet - I'm due to work on it after #4536 (message spec changes) has been merged. I think we might have discussed it in one of the weekly dev meetings, but I don't remember how long ago. I'll make sure to ping you when there's something to show for it. Best wishes, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/ad6a9725/attachment.html> From mgadbois at gmail.com Mon May 5 13:55:28 2014 From: mgadbois at gmail.com (Martin Gadbois) Date: Mon, 5 May 2014 13:55:28 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> Message-ID: <CAN1QFFQZLS3EXhcNNVHQARFAB9eGBPjbN0zYWWE5HMaNwfsSxA@mail.gmail.com> Wow that was there but not found by Google... nice! I will take a close look, thanks! On Mon, May 5, 2014 at 11:52 AM, Jessica B. Hamrick <jhamrick at berkeley.edu>wrote: > Hi all, > > I jut wanted to throw out there a link to the SQL magic, which may be > relevant: > > https://github.com/catherinedevlin/ipython-sql > > I know it's not a whole kernel, but may be a good starting place for at > least seeing what other people have been thinking about along the same > directions. > > Cheers, > Jess > > -- > UC Berkeley, Department of Psychology > Computational Cognitive Science Lab > http://www.jesshamrick.com > > > On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com> wrote: > >> On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com>wrote: >> >>> Hi! >>> >>> I would like to develop a SQLite kernel for IPython. >>> >>> Keyword, table and column completion would help building queries, and a >>> dynamic output could resize text columns and have a proper notebook table >>> output. >>> >>> To achieve that, I see two main directions: >>> 1- Have an external kernel (like >>> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >>> coded in Python since there are no 0MQ bindings for SQLite. >>> 2- Extend IPython itself to support SQLite, since I will need to write >>> Python code anyway to support SQLite. >>> >> >> I've wanted something like this for a while! I would like to incorporate >> SQL as a language that could easily be used in a variety of educational >> settings and other open source projects. But the utility of such a project >> lies in the details of implementation. >> >> There are pros and cons to both approaches. But you could perhaps develop >> it in a manner that could be used in either situation. What would generally >> be useful would be to replicate the SQLite shell. It would be great if the >> parser was written in pure Python, and had an interpreter, also as much >> written in pure Python as possible. That is, it would be great if the >> low-level C-based sqlite API was limited, and could be swapped out. >> >> That would allow other implementations of Python (Jython, PyPy, >> IronPython) could use it with their own sqlite wrappers. But also, that >> might make it useful for interfacing other data storages (for example, CSV >> files, Django databases, etc.) >> >> The SQLite shell is actually a bit hairy. Here is a port of the C code to >> C# for example: >> >> http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell >> >> You could also use the simple-kernel [1] as a way of quickly turning a >> Python program into a kernel. (simple-kernel was just updated by Min, so >> now it is correct; thanks, Min!) >> >> This might also have connections to the ADODB API [2]... they have worked >> hard to make their connections be Python-implementation agnostic. >> >> Looking forward to see what you develop! >> >> -Doug >> >> [1] https://github.com/dsblank/simple_kernel >> [2] https://sourceforge.net/projects/adodbapi >> >> >>> >>> What would this list recommend as an implementation strategy? >>> Any example of creating an external kernel by reusing a subset of >>> IPython itself? >>> >>> Thanks! >>> >>> -- >>> Martin >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/643c5ded/attachment.html> From mgadbois at gmail.com Mon May 5 14:28:14 2014 From: mgadbois at gmail.com (Martin Gadbois) Date: Mon, 5 May 2014 14:28:14 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAOvn4qhytm2PBqC6d+sS3EbcLs++K0wHdUAoxq6f1ZqP2itUAw@mail.gmail.com> Message-ID: <CAN1QFFQ+jOyC0bp8=4B6vV+TCAcn8MVrDm_uonpoO2nTefbMpA@mail.gmail.com> Good to know! i can wait, this seems promising. Thanks! On Mon, May 5, 2014 at 12:04 PM, Thomas Kluyver <takowl at gmail.com> wrote: > Hi Martin, > > On 5 May 2014 08:00, Martin Gadbois <mgadbois at gmail.com> wrote: > >> I would like to develop a SQLite kernel for IPython. >> >> Keyword, table and column completion would help building queries, and a >> dynamic output could resize text columns and have a proper notebook table >> output. >> >> To achieve that, I see two main directions: >> 1- Have an external kernel (like >> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >> coded in Python since there are no 0MQ bindings for SQLite. >> 2- Extend IPython itself to support SQLite, since I will need to write >> Python code anyway to support SQLite. >> > > We're actually planning to refactor the IPython kernel machinery in the > next few weeks to make it easier to write kernels in Python. Once this is > done, you'll be able to create a new kernel by inheriting from a class in > IPython, and defining methods for execution and completion. So unless you > need to do it urgently, I'd recommend waiting for that infrastructure, and > then it will be quite simple. > > Best wishes, > Thomas > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/3ee90034/attachment.html> From modi.konark at gmail.com Mon May 5 15:08:26 2014 From: modi.konark at gmail.com (konark modi) Date: Tue, 6 May 2014 00:38:26 +0530 Subject: [IPython-dev] [Create and last update]Notebook dashboard ! Message-ID: <CAPhs5j9S8TTRvsQzBp2n4TVffjR85xj8AodeShm-xpWF7k0Utw@mail.gmail.com> Hi Not sure if this is implemented / planned, but I was wanting to contribute to IPython and thought if it would be good to start by adding created/updated time along with notebook name on the dashboard. Regards Konark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/3fbdde66/attachment.html> From gvwilson at third-bit.com Mon May 5 15:19:41 2014 From: gvwilson at third-bit.com (Greg Wilson) Date: Mon, 05 May 2014 15:19:41 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CAN1QFFQZLS3EXhcNNVHQARFAB9eGBPjbN0zYWWE5HMaNwfsSxA@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> <CAN1QFFQZLS3EXhcNNVHQARFAB9eGBPjbN0zYWWE5HMaNwfsSxA@mail.gmail.com> Message-ID: <5367E44D.1040207@third-bit.com> http://github.com/gvwilson/sqlitemagic may also be of interest - it's what we use to produce the Software Carpentry lesson on SQL. thx, G On 2014-05-05 1:55 PM, Martin Gadbois wrote: > Wow that was there but not found by Google... nice! I will take a > close look, thanks! > > > On Mon, May 5, 2014 at 11:52 AM, Jessica B. Hamrick > <jhamrick at berkeley.edu <mailto:jhamrick at berkeley.edu>> wrote: > > Hi all, > > I jut wanted to throw out there a link to the SQL magic, which may > be relevant: > > https://github.com/catherinedevlin/ipython-sql > > I know it's not a whole kernel, but may be a good starting place > for at least seeing what other people have been thinking about > along the same directions. > > Cheers, > Jess > > -- > UC Berkeley, Department of Psychology > Computational Cognitive Science Lab > http://www.jesshamrick.com <http://www.jesshamrick.com/> > > > On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com > <mailto:doug.blank at gmail.com>> wrote: > > On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois > <mgadbois at gmail.com <mailto:mgadbois at gmail.com>> wrote: > > Hi! > > I would like to develop a SQLite kernel for IPython. > > Keyword, table and column completion would help building > queries, and a dynamic output could resize text columns > and have a proper notebook table output. > > To achieve that, I see two main directions: > 1- Have an external kernel (like > http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) > coded in Python since there are no 0MQ bindings for SQLite. > 2- Extend IPython itself to support SQLite, since I will > need to write Python code anyway to support SQLite. > > > I've wanted something like this for a while! I would like to > incorporate SQL as a language that could easily be used in a > variety of educational settings and other open source > projects. But the utility of such a project lies in the > details of implementation. > > There are pros and cons to both approaches. But you could > perhaps develop it in a manner that could be used in either > situation. What would generally be useful would be to > replicate the SQLite shell. It would be great if the parser > was written in pure Python, and had an interpreter, also as > much written in pure Python as possible. That is, it would be > great if the low-level C-based sqlite API was limited, and > could be swapped out. > > That would allow other implementations of Python (Jython, > PyPy, IronPython) could use it with their own sqlite wrappers. > But also, that might make it useful for interfacing other data > storages (for example, CSV files, Django databases, etc.) > > The SQLite shell is actually a bit hairy. Here is a port of > the C code to C# for example: > > http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell > > You could also use the simple-kernel [1] as a way of quickly > turning a Python program into a kernel. (simple-kernel was > just updated by Min, so now it is correct; thanks, Min!) > > This might also have connections to the ADODB API [2]... they > have worked hard to make their connections be > Python-implementation agnostic. > > Looking forward to see what you develop! > > -Doug > > [1] https://github.com/dsblank/simple_kernel > [2] https://sourceforge.net/projects/adodbapi > <https://sourceforge.net/projects/adodbapi> > > > What would this list recommend as an implementation strategy? > Any example of creating an external kernel by reusing a > subset of IPython itself? > > Thanks! > > -- > Martin > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org <mailto:IPython-dev at scipy.org> > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org <mailto:IPython-dev at scipy.org> > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org <mailto:IPython-dev at scipy.org> > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > -- > Martin > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/903c1fc6/attachment.html> From takowl at gmail.com Mon May 5 15:37:20 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 5 May 2014 12:37:20 -0700 Subject: [IPython-dev] [Create and last update]Notebook dashboard ! In-Reply-To: <CAPhs5j9S8TTRvsQzBp2n4TVffjR85xj8AodeShm-xpWF7k0Utw@mail.gmail.com> References: <CAPhs5j9S8TTRvsQzBp2n4TVffjR85xj8AodeShm-xpWF7k0Utw@mail.gmail.com> Message-ID: <CAOvn4qgY36_4g2XZNNT6NuKUyyYHENJTxw5eSUtayDSgK2yQFA@mail.gmail.com> Hi Konark, On 5 May 2014 12:08, konark modi <modi.konark at gmail.com> wrote: > Not sure if this is implemented / planned, but I was wanting to contribute > to IPython and thought if it would be good to start by adding > created/updated time along with notebook name on the dashboard. Be aware that we're planning a bigger refactoring of the dashboard some time before IPython 3, so code you write now might be pulled out again before long. If you don't mind that risk, go for it. You might want to make sure you're not treading on Susan Tan's toes - I know she was also thinking about this. Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/cca8f184/attachment.html> From sylvain.corlay at gmail.com Mon May 5 19:44:41 2014 From: sylvain.corlay at gmail.com (Sylvain Corlay) Date: Mon, 5 May 2014 19:44:41 -0400 Subject: [IPython-dev] Markdown MathJaX and Serif Message-ID: <CAK=Phk5gk5Z48jwgyL2qwvmKmLmbmQCK9LrWs106hgdhgGZiNQ@mail.gmail.com> Hi all, We traditionally use sans-serif fonts for text meant to be displayed on a screen while serif is generally used for print. For example, default latex-beamer themes use sans-serif flavors of the computer modern font. Shouldn't Mathjax do the same, especially in the context of the IPython notebook, where the default fonts for markdown are sans-serif? Best, Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/7f3674b3/attachment.html> From fperez.net at gmail.com Mon May 5 21:09:39 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 6 May 2014 02:09:39 +0100 Subject: [IPython-dev] Markdown MathJaX and Serif In-Reply-To: <CAK=Phk5gk5Z48jwgyL2qwvmKmLmbmQCK9LrWs106hgdhgGZiNQ@mail.gmail.com> References: <CAK=Phk5gk5Z48jwgyL2qwvmKmLmbmQCK9LrWs106hgdhgGZiNQ@mail.gmail.com> Message-ID: <CAHAreOod2_gBM_-ca-8tFfeXFendsOstZgZCHuZ7GMj9Bw6XxQ@mail.gmail.com> To the best of my understanding and some rather hasty googling, mathjax doesn't provide sans-serif mathematical fonts. I'm also pretty sure that in Beamer, in most themes even though it uses sans-serif CM variants, it still renders the math using serifed CM (or at least it used to years ago). You have to switch to special packages to get sans-serifed math, such as the cmbright one. In summary, the business of getting proper sans-serif math rendering is highly non-trivial, and ultimately it's a question for the MathJax lists. If mathjax supports it, we can too simply because we use unadulterated mathjax. But if it's not something that mathjax can do by itself, IPython isn't going to help... Cheers f On Tue, May 6, 2014 at 12:44 AM, Sylvain Corlay <sylvain.corlay at gmail.com>wrote: > Hi all, > > We traditionally use sans-serif fonts for text meant to be displayed on a > screen while serif is generally used for print. For example, default > latex-beamer themes use sans-serif flavors of the computer modern font. > Shouldn't Mathjax do the same, especially in the context of the IPython > notebook, where the default fonts for markdown are sans-serif? > > Best, > Sylvain > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Fernando Perez (@fperez_org; http://fperez.org) fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) fernando.perez-at-berkeley: contact me here for any direct mail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/c5271d5b/attachment.html> From roberto.colistete at gmail.com Tue May 6 01:24:15 2014 From: roberto.colistete at gmail.com (Roberto Colistete Jr.) Date: Tue, 06 May 2014 02:24:15 -0300 Subject: [IPython-dev] IPython (terminal & Notebook) 2.0.0 on Sailfish OS In-Reply-To: <510EC481.5060604@gmail.com> References: <510EC481.5060604@gmail.com> Message-ID: <536871FF.7030905@gmail.com> Hi, New release of IPython for Sailfish OS (used by the Jolla smartphone <http://jolla.com/>, Nokia N9 and Nexus 4), as well as for Mer & Nemo Mobile & Plasma Active. IPython 2.0.0 is released with full terminal and Notebook interfaces. See this post in topic "IPython (terminal, Notebook) 2.0.0 for Sailfish " of Talk Maemo.org forum, it also includes screenshots : http://talk.maemo.org/showthread.php?t=93139 SymPy 0.7.5 : http://talk.maemo.org/showthread.php?p=1424146#post1424146 and NumPy 1.7.1 : https://openrepos.net/content/rcolistete/numpy-sailfish-os are also available on Sailfish OS. Best regards from Brazil, Roberto -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/7996b443/attachment.html> From fperez.net at gmail.com Tue May 6 01:35:21 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 5 May 2014 22:35:21 -0700 Subject: [IPython-dev] IPython (terminal & Notebook) 2.0.0 on Sailfish OS In-Reply-To: <536871FF.7030905@gmail.com> References: <510EC481.5060604@gmail.com> <536871FF.7030905@gmail.com> Message-ID: <CAHAreOqVotTOFtOXsquphJy+VARKbT8cNKM1EJp6nry4xod1jg@mail.gmail.com> Great!! Thanks for keeping us updated and continuing this work. On Mon, May 5, 2014 at 10:24 PM, Roberto Colistete Jr. < roberto.colistete at gmail.com> wrote: > Hi, > > New release of IPython for Sailfish OS (used by the Jolla smartphone<http://jolla.com/>, > Nokia N9 and Nexus 4), as well as for Mer & Nemo Mobile & Plasma Active. > > IPython 2.0.0 is released with full terminal and Notebook interfaces. > See this post in topic "IPython (terminal, Notebook) 2.0.0 for Sailfish " > of Talk Maemo.org forum, it also includes screenshots : > http://talk.maemo.org/showthread.php?t=93139 > > SymPy 0.7.5 : > http://talk.maemo.org/showthread.php?p=1424146#post1424146 > and NumPy 1.7.1 : > https://openrepos.net/content/rcolistete/numpy-sailfish-os > are also available on Sailfish OS. > > Best regards from Brazil, > > Roberto > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Fernando Perez (@fperez_org; http://fperez.org) fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) fernando.perez-at-berkeley: contact me here for any direct mail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140505/df12845d/attachment.html> From jason.roberts at duke.edu Tue May 6 14:35:49 2014 From: jason.roberts at duke.edu (Jason Roberts) Date: Tue, 6 May 2014 14:35:49 -0400 Subject: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server Message-ID: <035b01cf695a$010b61d0$03222570$@duke.edu> I have a situation where I have to use MS Windows for a big parallel processing job, due to Windows dependencies on some steps in the job. I have successfully used iPython on a single 16-processor machine for this purpose. Thank you very much for making this so easy to use! It has saved me a huge amount of time. Now, if possible, I would like to set up a cluster that has multiple Windows servers (Windows Server 2008 R2 Standard). The iPython documentation (http://ipython.org/ipython-doc/dev/parallel/parallel_process.html) describes several options. The one that seems best oriented for Windows, at least under the assumption that Microsoft technologies are the best choice for Windows, is to use Microsoft HPC Pack 2008 (http://ipython.org/ipython-doc/dev/parallel/parallel_winhpc.html). I tried this. Unfortunately HPC Pack appears to require Active Directory to be deployed. My shop runs a mixture of different operating systems, and while we have LDAP, we do not have a full-blown deployment of Active Directory. This appears to rule out the HPC Pack option. Are there other alternatives for running an iPython cluster composed of multiple Windows servers, and which is best? Should I look at mpiexec with Open MPI? Is there some way to do it with SSH, despite the iPython documentation saying not? Thanks for any advice you can provide, and thanks again for iPython's parallel processing infrastructure. It truly is a time saver. Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/926e4afe/attachment.html> From sylvain.corlay at gmail.com Tue May 6 14:58:55 2014 From: sylvain.corlay at gmail.com (Sylvain Corlay) Date: Tue, 6 May 2014 14:58:55 -0400 Subject: [IPython-dev] Markdown MathJaX and Serif In-Reply-To: <CAHAreOod2_gBM_-ca-8tFfeXFendsOstZgZCHuZ7GMj9Bw6XxQ@mail.gmail.com> References: <CAK=Phk5gk5Z48jwgyL2qwvmKmLmbmQCK9LrWs106hgdhgGZiNQ@mail.gmail.com> <CAHAreOod2_gBM_-ca-8tFfeXFendsOstZgZCHuZ7GMj9Bw6XxQ@mail.gmail.com> Message-ID: <CAK=Phk7XCoHEsXq3PxgaeF_CG+mQnwz8hfqygwpWUBG=kkns4g@mail.gmail.com> Hi Fernando, Thank you for your reply. In the versions of Latex/Beamer that I have used lately, the default math fonts are sans-serif, but I don't know whether this is a recent change. I have looked into a few threads on MathJax and their seem to be a few tricks to get sans-serif fonts in MathJax but indeed it is not really supported. Best, Sylvain On Mon, May 5, 2014 at 9:09 PM, Fernando Perez <fperez.net at gmail.com> wrote: > To the best of my understanding and some rather hasty googling, mathjax > doesn't provide sans-serif mathematical fonts. > > I'm also pretty sure that in Beamer, in most themes even though it uses > sans-serif CM variants, it still renders the math using serifed CM (or at > least it used to years ago). You have to switch to special packages to get > sans-serifed math, such as the cmbright one. > > In summary, the business of getting proper sans-serif math rendering is > highly non-trivial, and ultimately it's a question for the MathJax lists. > If mathjax supports it, we can too simply because we use unadulterated > mathjax. But if it's not something that mathjax can do by itself, IPython > isn't going to help... > > Cheers > > f > > > On Tue, May 6, 2014 at 12:44 AM, Sylvain Corlay <sylvain.corlay at gmail.com>wrote: > >> Hi all, >> >> We traditionally use sans-serif fonts for text meant to be displayed on a >> screen while serif is generally used for print. For example, default >> latex-beamer themes use sans-serif flavors of the computer modern font. >> Shouldn't Mathjax do the same, especially in the context of the IPython >> notebook, where the default fonts for markdown are sans-serif? >> >> Best, >> Sylvain >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > > -- > Fernando Perez (@fperez_org; http://fperez.org) > fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) > fernando.perez-at-berkeley: contact me here for any direct mail > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/fc17e3de/attachment.html> From tritemio at gmail.com Tue May 6 15:23:34 2014 From: tritemio at gmail.com (Antonino Ingargiola) Date: Tue, 6 May 2014 12:23:34 -0700 Subject: [IPython-dev] Notebook and Qt dialog issue Message-ID: <CANn2QUwtgpm_ivH2pXkEs4tBQj4bGWc-+dBS3ER4u1qgH1bcMg@mail.gmail.com> Hi, I have a problem opening a Qt dialog from a notebook if the magic %gui qt (or %matplotlib qt) is executed on the same cell as the dialog call. Seems a problem similar to this closed bug: https://github.com/ipython/ipython/issues/4997 but both in ipython 2.0 and on current master I have a kernel crash when executing the gui magic and the dialog call on the same cell. The issue is shown here: http://nbviewer.ipython.org/gist/tritemio/430d68d8b0efbbb13462 Can others reproduce the problem? If yes, should I open a new issue? Thanks, Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/d3ec48a8/attachment.html> From benjaminrk at gmail.com Tue May 6 15:36:31 2014 From: benjaminrk at gmail.com (MinRK) Date: Tue, 6 May 2014 12:36:31 -0700 Subject: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server In-Reply-To: <035b01cf695a$010b61d0$03222570$@duke.edu> References: <035b01cf695a$010b61d0$03222570$@duke.edu> Message-ID: <CAHNn8BUofG-SRZT0cEK-mHGOyHTzGBxfkK1khZuC+HZFdT6+-g@mail.gmail.com> An important thing to note about ipcluster is that it?s a very complicated way to do something that?s not very complicated. All it sets out to do is: 1. start a controller with ipcontroller 2. start 0-many engines with ipengine All of the complexity comes from abstracting how processes actually start, including where machines are, batch systems, etc. But in the end, it?s just doing: $> ipcluster $> for i in {1..n}; do ipengine; done ipcluster makes some simple cases easier, but if it doesn?t do what you want, you can always start the controller and engines yourself, with no loss of functionality. Plus, a tool that only deploys a cluster on your own system is much simpler than one that tries to work in a wide variety of contexts like ipcluster. The basic steps in getting a cluster up and running: 1. configure the controller to listen on an IP visible to the other machines (c.HubFactory.ip = '1.2.3.4' in ipcontroller_config.py on the controller machine. 2. start the controller with ipcontroller 3. copy .ipython/profile_default/security/ipcontroller-*.json to all of the various machines on which you plan to start engines. 4. start ipengine as many times as is appropriate on each machine. Step 3. is unnecessary if your systems are on a shared filesystem. For instance, here is a simple version that starts a controller and engines with ssh on Linux or OS X machines, putting processes in the background with screen: $> ssh controller_host screen -dmS ipcontroller $> for host in host1 host2; do > scp ~/.ipython/profile_default/security/ipcontroller-*.json $host:.ipython/profile_default/security/ > ssh $host 'for n in {1..3}; do screen -dmS ipengine; done' > done Which is *a lot* simpler than the hundreds of lines of ipcluster, and, frankly, better behaved than the SSH launchers that ship with IPython. If you have Windows analogues for ?tell machine X to run command Y,? you can make a similar script, tailored to your use. -MinRK On Tue, May 6, 2014 at 11:35 AM, Jason Roberts <jason.roberts at duke.edu> wrote: I have a situation where I have to use MS Windows for a big parallel > processing job, due to Windows dependencies on some steps in the job. I > have successfully used iPython on a single 16-processor machine for this > purpose. Thank you very much for making this so easy to use! It has saved > me a huge amount of time. > > > > Now, if possible, I would like to set up a cluster that has multiple > Windows servers (Windows Server 2008 R2 Standard). The iPython > documentation ( > http://ipython.org/ipython-doc/dev/parallel/parallel_process.html) > describes several options. The one that seems best oriented for Windows, at > least under the assumption that Microsoft technologies are the best choice > for Windows, is to use Microsoft HPC Pack 2008 ( > http://ipython.org/ipython-doc/dev/parallel/parallel_winhpc.html). I > tried this. Unfortunately HPC Pack appears to require Active Directory to > be deployed. My shop runs a mixture of different operating systems, and > while we have LDAP, we do not have a full-blown deployment of Active > Directory. This appears to rule out the HPC Pack option. > > > > Are there other alternatives for running an iPython cluster composed of > multiple Windows servers, and which is best? Should I look at mpiexec with > Open MPI? Is there some way to do it with SSH, despite the iPython > documentation saying not? > > > > Thanks for any advice you can provide, and thanks again for iPython?s > parallel processing infrastructure. It truly is a time saver. > > > > Jason > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/f3c8dd7a/attachment.html> From jgill at tokiomillennium.com Tue May 6 16:47:41 2014 From: jgill at tokiomillennium.com (John Gill) Date: Tue, 6 May 2014 20:47:41 +0000 Subject: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server In-Reply-To: <CAHNn8BUofG-SRZT0cEK-mHGOyHTzGBxfkK1khZuC+HZFdT6+-g@mail.gmail.com> References: <035b01cf695a$010b61d0$03222570$@duke.edu> <CAHNn8BUofG-SRZT0cEK-mHGOyHTzGBxfkK1khZuC+HZFdT6+-g@mail.gmail.com> Message-ID: <CEA58BDE8F3913468BE4A3F1F32C370C2B068275@TMREXMB01.tokiomillennium.com> Thanks MinRK ? that is a very helpful explanation + suggestions. This question was pretty timely. I actually had ipython 1.x running fine with HPC, but was unable to get it to work under ipython2.0. I am working towards using ssh to start the cluster up, but as you point out with a shared file system that is a whole lot easier + I think the HPC is a pretty big hammer to crack a tiny nut ? and it tends to make a mess of the nut ;) As mentioned in a previous post I am also interested in creating non-homogeneous clusters eg engines with different cpu and memory resources, on different OS?es and with different software installed + have the scheduler deal with task dependencies whilst at the same time respecting any restrictions tasks have as to what kind of engine they need run on. John From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of MinRK Sent: Tuesday, May 06, 2014 4:37 PM To: IPython developers list Subject: Re: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server An important thing to note about ipcluster is that it?s a very complicated way to do something that?s not very complicated. All it sets out to do is: 1. start a controller with ipcontroller 2. start 0-many engines with ipengine All of the complexity comes from abstracting how processes actually start, including where machines are, batch systems, etc. But in the end, it?s just doing: $> ipcluster $> for i in {1..n}; do ipengine; done ipcluster makes some simple cases easier, but if it doesn?t do what you want, you can always start the controller and engines yourself, with no loss of functionality. Plus, a tool that only deploys a cluster on your own system is much simpler than one that tries to work in a wide variety of contexts like ipcluster. The basic steps in getting a cluster up and running: 1. configure the controller to listen on an IP visible to the other machines (c.HubFactory.ip = '1.2.3.4' in ipcontroller_config.py on the controller machine. 2. start the controller with ipcontroller 3. copy .ipython/profile_default/security/ipcontroller-*.json to all of the various machines on which you plan to start engines. 4. start ipengine as many times as is appropriate on each machine. Step 3. is unnecessary if your systems are on a shared filesystem. For instance, here is a simple version that starts a controller and engines with ssh on Linux or OS X machines, putting processes in the background with screen: $> ssh controller_host screen -dmS ipcontroller $> for host in host1 host2; do > scp ~/.ipython/profile_default/security/ipcontroller-*.json $host:.ipython/profile_default/security/ > ssh $host 'for n in {1..3}; do screen -dmS ipengine; done' > done Which is a lot simpler than the hundreds of lines of ipcluster, and, frankly, better behaved than the SSH launchers that ship with IPython. If you have Windows analogues for ?tell machine X to run command Y,? you can make a similar script, tailored to your use. -MinRK On Tue, May 6, 2014 at 11:35 AM, Jason Roberts <jason.roberts at duke.edu<mailto:jason.roberts at duke.edu>> wrote: I have a situation where I have to use MS Windows for a big parallel processing job, due to Windows dependencies on some steps in the job. I have successfully used iPython on a single 16-processor machine for this purpose. Thank you very much for making this so easy to use! It has saved me a huge amount of time. Now, if possible, I would like to set up a cluster that has multiple Windows servers (Windows Server 2008 R2 Standard). The iPython documentation (http://ipython.org/ipython-doc/dev/parallel/parallel_process.html) describes several options. The one that seems best oriented for Windows, at least under the assumption that Microsoft technologies are the best choice for Windows, is to use Microsoft HPC Pack 2008 (http://ipython.org/ipython-doc/dev/parallel/parallel_winhpc.html). I tried this. Unfortunately HPC Pack appears to require Active Directory to be deployed. My shop runs a mixture of different operating systems, and while we have LDAP, we do not have a full-blown deployment of Active Directory. This appears to rule out the HPC Pack option. Are there other alternatives for running an iPython cluster composed of multiple Windows servers, and which is best? Should I look at mpiexec with Open MPI? Is there some way to do it with SSH, despite the iPython documentation saying not? Thanks for any advice you can provide, and thanks again for iPython?s parallel processing infrastructure. It truly is a time saver. Jason _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster at tokiomillennium.com and then permanently delete the email and any attachments from your system. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses. ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/07777cf7/attachment.html> From jason.roberts at duke.edu Tue May 6 16:51:54 2014 From: jason.roberts at duke.edu (Jason Roberts) Date: Tue, 6 May 2014 16:51:54 -0400 Subject: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server In-Reply-To: <CAHNn8BUofG-SRZT0cEK-mHGOyHTzGBxfkK1khZuC+HZFdT6+-g@mail.gmail.com> References: <035b01cf695a$010b61d0$03222570$@duke.edu> <CAHNn8BUofG-SRZT0cEK-mHGOyHTzGBxfkK1khZuC+HZFdT6+-g@mail.gmail.com> Message-ID: <050d01cf696d$039a7680$0acf6380$@duke.edu> Thank you, MinRK. I have no problem configuring and starting the controller and engines manually. I will look into that. Jason From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of MinRK Sent: Tuesday, May 06, 2014 3:37 PM To: IPython developers list Subject: Re: [IPython-dev] iPython cluster on multiple Windows servers, without Windows HPC Server An important thing to note about ipcluster is that it?s a very complicated way to do something that?s not very complicated. All it sets out to do is: 1. start a controller with ipcontroller 2. start 0-many engines with ipengine All of the complexity comes from abstracting how processes actually start, including where machines are, batch systems, etc. But in the end, it?s just doing: $> ipcluster $> for i in {1..n}; do ipengine; done ipcluster makes some simple cases easier, but if it doesn?t do what you want, you can always start the controller and engines yourself, with no loss of functionality. Plus, a tool that only deploys a cluster on your own system is much simpler than one that tries to work in a wide variety of contexts like ipcluster. The basic steps in getting a cluster up and running: 1. configure the controller to listen on an IP visible to the other machines (c.HubFactory.ip = '1.2.3.4' in ipcontroller_config.py on the controller machine. 2. start the controller with ipcontroller 3. copy .ipython/profile_default/security/ipcontroller-*.json to all of the various machines on which you plan to start engines. 4. start ipengine as many times as is appropriate on each machine. Step 3. is unnecessary if your systems are on a shared filesystem. For instance, here is a simple version that starts a controller and engines with ssh on Linux or OS X machines, putting processes in the background with screen: $> ssh controller_host screen -dmS ipcontroller $> for host in host1 host2; do > scp ~/.ipython/profile_default/security/ipcontroller-*.json $host:.ipython/profile_default/security/ > ssh $host 'for n in {1..3}; do screen -dmS ipengine; done' > done Which is a lot simpler than the hundreds of lines of ipcluster, and, frankly, better behaved than the SSH launchers that ship with IPython. If you have Windows analogues for ?tell machine X to run command Y,? you can make a similar script, tailored to your use. -MinRK On Tue, May 6, 2014 at 11:35 AM, Jason Roberts <jason.roberts at duke.edu <mailto:jason.roberts at duke.edu> > wrote: I have a situation where I have to use MS Windows for a big parallel processing job, due to Windows dependencies on some steps in the job. I have successfully used iPython on a single 16-processor machine for this purpose. Thank you very much for making this so easy to use! It has saved me a huge amount of time. Now, if possible, I would like to set up a cluster that has multiple Windows servers (Windows Server 2008 R2 Standard). The iPython documentation (http://ipython.org/ipython-doc/dev/parallel/parallel_process.html) describes several options. The one that seems best oriented for Windows, at least under the assumption that Microsoft technologies are the best choice for Windows, is to use Microsoft HPC Pack 2008 (http://ipython.org/ipython-doc/dev/parallel/parallel_winhpc.html). I tried this. Unfortunately HPC Pack appears to require Active Directory to be deployed. My shop runs a mixture of different operating systems, and while we have LDAP, we do not have a full-blown deployment of Active Directory. This appears to rule out the HPC Pack option. Are there other alternatives for running an iPython cluster composed of multiple Windows servers, and which is best? Should I look at mpiexec with Open MPI? Is there some way to do it with SSH, despite the iPython documentation saying not? Thanks for any advice you can provide, and thanks again for iPython?s parallel processing infrastructure. It truly is a time saver. Jason _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org <mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/e9baddb3/attachment.html> From moorepants at gmail.com Tue May 6 17:31:39 2014 From: moorepants at gmail.com (Jason Moore) Date: Tue, 6 May 2014 17:31:39 -0400 Subject: [IPython-dev] How to have independent call backs for single widget Message-ID: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> If I have a function that makes a plot, for example: def plot_something(parameter=1.0, view=1.0): axes = expensive_function(plt.gca(), parameter) less_expensive_function(axes, view) And I make it interactive: interactive(plot_something, parameter=(0.0, 1.0), view=(0.0, 1.0)) As it stands, both the expensive_function and the less_expensive_function run whether I drag the slider for either parameter, even though if I only drag the view parameter I could theoretically only call the less_expensive_function, thus making the widget respond faster. What is a good design to have a widget depend on two or more parameters and be able to have internal knowledge in the callback function on what parameter changed? So that you can avoid overhead in computation? Jason moorepants.info +01 530-601-9791 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/78f56f16/attachment.html> From fperez.net at gmail.com Tue May 6 21:40:43 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 7 May 2014 02:40:43 +0100 Subject: [IPython-dev] Notebook and Qt dialog issue In-Reply-To: <CANn2QUwtgpm_ivH2pXkEs4tBQj4bGWc-+dBS3ER4u1qgH1bcMg@mail.gmail.com> References: <CANn2QUwtgpm_ivH2pXkEs4tBQj4bGWc-+dBS3ER4u1qgH1bcMg@mail.gmail.com> Message-ID: <CAHAreOr66606v9XkO-q_CqQjD4Uq9ffi5RAaB+nqaVqhAwY5ng@mail.gmail.com> Yes, please do so. I can replicate the problem here. You might want to update the example with a try/except so it runs with either pyside or pyqt, it will make it easier for others to replicate. The pyqt import line should be: from PyQt4 import QtCore, QtGui Cheers f On Tue, May 6, 2014 at 8:23 PM, Antonino Ingargiola <tritemio at gmail.com>wrote: > Hi, > > I have a problem opening a Qt dialog from a notebook if the magic %gui qt > (or %matplotlib qt) is executed on the same cell as the dialog call. > > Seems a problem similar to this closed bug: > > https://github.com/ipython/ipython/issues/4997 > > but both in ipython 2.0 and on current master I have a kernel crash when > executing the gui magic and the dialog call on the same cell. > > The issue is shown here: > > http://nbviewer.ipython.org/gist/tritemio/430d68d8b0efbbb13462 > > Can others reproduce the problem? > > If yes, should I open a new issue? > > Thanks, > Antonio > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Fernando Perez (@fperez_org; http://fperez.org) fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) fernando.perez-at-berkeley: contact me here for any direct mail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/4e5079d1/attachment.html> From teresa-stout at uiowa.edu Tue May 6 22:25:37 2014 From: teresa-stout at uiowa.edu (Stout, Teresa M) Date: Wed, 7 May 2014 02:25:37 +0000 Subject: [IPython-dev] Help printing and converting to pdf ipython notebook Message-ID: <DCF06C423DFA72439379047D7AEC1EBF52088927@itsnt443.iowa.uiowa.edu> Hi there, I am using your ipython notebook interface to work on a class project. I need to turn the notebook in by paper form. Therefore I would like to print off the notebook or convert it into a pdf and print it. Currently I am getting the error 500:Internal Server Error when I try to print a preview. Please help. Thank you. Kind Regards, Teresa Stout -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/64d01268/attachment.html> From tritemio at gmail.com Tue May 6 23:52:41 2014 From: tritemio at gmail.com (Antonino Ingargiola) Date: Tue, 6 May 2014 20:52:41 -0700 Subject: [IPython-dev] Notebook and Qt dialog issue In-Reply-To: <CAHAreOr66606v9XkO-q_CqQjD4Uq9ffi5RAaB+nqaVqhAwY5ng@mail.gmail.com> References: <CANn2QUwtgpm_ivH2pXkEs4tBQj4bGWc-+dBS3ER4u1qgH1bcMg@mail.gmail.com> <CAHAreOr66606v9XkO-q_CqQjD4Uq9ffi5RAaB+nqaVqhAwY5ng@mail.gmail.com> Message-ID: <CANn2QUxCv49=KjTCcjKK1VNrfEq-pJjFuheUf1VxR5Ac_sNCgg@mail.gmail.com> Done. https://github.com/ipython/ipython/issues/5798 Antonio On Tue, May 6, 2014 at 6:40 PM, Fernando Perez <fperez.net at gmail.com> wrote: > Yes, please do so. I can replicate the problem here. You might want to > update the example with a try/except so it runs with either pyside or pyqt, > it will make it easier for others to replicate. The pyqt import line should > be: > > from PyQt4 import QtCore, QtGui > > > Cheers > > f > > > On Tue, May 6, 2014 at 8:23 PM, Antonino Ingargiola <tritemio at gmail.com>wrote: > >> Hi, >> >> I have a problem opening a Qt dialog from a notebook if the magic %gui qt >> (or %matplotlib qt) is executed on the same cell as the dialog call. >> >> Seems a problem similar to this closed bug: >> >> https://github.com/ipython/ipython/issues/4997 >> >> but both in ipython 2.0 and on current master I have a kernel crash when >> executing the gui magic and the dialog call on the same cell. >> >> The issue is shown here: >> >> http://nbviewer.ipython.org/gist/tritemio/430d68d8b0efbbb13462 >> >> Can others reproduce the problem? >> >> If yes, should I open a new issue? >> >> Thanks, >> Antonio >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > > -- > Fernando Perez (@fperez_org; http://fperez.org) > fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) > fernando.perez-at-berkeley: contact me here for any direct mail > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140506/6b52806d/attachment.html> From dketch at gmail.com Wed May 7 03:24:14 2014 From: dketch at gmail.com (David Ketcheson) Date: Wed, 7 May 2014 10:24:14 +0300 Subject: [IPython-dev] Load custom.js file that is not in my ipython profile directory Message-ID: <CAPdrMXjjXmRT3r0585-yV5FLWbPyX+1PWtqZqr=GD45iHa5Lxg@mail.gmail.com> I'd like to load some javascript into the notebook from a .js file that is not in my ipython profile directory. This would allow me to distribute the notebook and the .js file together and have users get the benefit of the .js file in the notebook. I know how to do the analogous thing with .css files, based on the content of the last cell in this notebook: http://nbviewer.ipython.org/github/barbagroup/AeroPython/blob/master/lessons/01_Lesson01_sourceSink.ipynb How can I do the same for javascript? -David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/b43078c0/attachment.html> From bussonniermatthias at gmail.com Wed May 7 04:07:36 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 7 May 2014 10:07:36 +0200 Subject: [IPython-dev] Help printing and converting to pdf ipython notebook In-Reply-To: <DCF06C423DFA72439379047D7AEC1EBF52088927@itsnt443.iowa.uiowa.edu> References: <DCF06C423DFA72439379047D7AEC1EBF52088927@itsnt443.iowa.uiowa.edu> Message-ID: <D50EDCC3-0383-4C74-A818-32641CC68B3E@gmail.com> Hi, I suppose you are on IPython 2.0. can you directly try from the command line ? $ ipython nbconvert <yournotebook.ipynb> You should get a more informative message of why this is not working. -- Matthias Le 7 mai 2014 ? 04:25, Stout, Teresa M a ?crit : > Hi there, > > I am using your ipython notebook interface to work on a class project. I need to turn the notebook in by paper form. Therefore I would like to print off the notebook or convert it into a pdf and print it. Currently I am getting the error 500:Internal Server Error when I try to print a preview. Please help. Thank you. > > Kind Regards, > > Teresa Stout > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/9b11d0f7/attachment.html> From bussonniermatthias at gmail.com Wed May 7 04:41:10 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 7 May 2014 10:41:10 +0200 Subject: [IPython-dev] How to have independent call backs for single widget In-Reply-To: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> References: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> Message-ID: <B54F4748-CF0D-47FF-839A-77ABF4813434@gmail.com> Le 6 mai 2014 ? 23:31, Jason Moore a ?crit : > If I have a function that makes a plot, for example: > > def plot_something(parameter=1.0, view=1.0): > axes = expensive_function(plt.gca(), parameter) > less_expensive_function(axes, view) > > And I make it interactive: > > interactive(plot_something, parameter=(0.0, 1.0), view=(0.0, 1.0)) > > As it stands, both the expensive_function and the less_expensive_function run whether I drag the slider for either parameter, even though if I only drag the view parameter I could theoretically only call the less_expensive_function, thus making the widget respond faster. > > What is a good design to have a widget depend on two or more parameters and be able to have internal knowledge in the callback function on what parameter changed? So that you can avoid overhead in computation? I suppose this is possible by doing custom widget and/or using the comm architecture directly. But that would be a **lot** of work. But couldn't you just use classic memoization of the expensive_function so that recalling it becomes less expensive ? -- M From bussonniermatthias at gmail.com Wed May 7 05:56:01 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 7 May 2014 11:56:01 +0200 Subject: [IPython-dev] Html object graph In-Reply-To: <CAA-8Ld_DHsN8ptHV30erT85wdNiAh4cMHm0yV6dW96qg+VxH0A@mail.gmail.com> References: <CAA-8Ld_DHsN8ptHV30erT85wdNiAh4cMHm0yV6dW96qg+VxH0A@mail.gmail.com> Message-ID: <74CB9B8B-35F3-4435-BC1C-D70058DEDD30@gmail.com> Hy, Le 3 mai 2014 ? 18:31, klo uo a ?crit : > Hey guys, > > are you are familiar with LinqPad? Thanks for the link. > If not, just to say it's a lightweight code scratchpad, that can connect to various databases and allow immediate Linq execution. It can also interpret any kind of .Net code (although currently without IronPython/Ruby). > > I thought to ask you about main output result pane - it's a very interesting Html table representation of dumped object(s), that adapts on the object type - allows collapsible nested levels, navigable deep Exception tree, can display images, rawhtml, hyperlinqs - user defined lambda functions that are executed on user click, ? I suppose each of theses features should be discussed independently. Most should Imho be directly implemented by library, like cyrile rossant HandsonTable for panda dataframe. Some other like Traceback could definitively be integrate din the core, have already been discussed, but pushed to a later point by lack of manpower. > Do you think something similar would fit in IPython? > As object inspection magic, or Qtconsole output pane, or else?? The response will depend on the exact feature, but instead of targeting a specific frontend I would suggest to think on how to get this into the object _repr_*_ or in the message spec if it is really impossible to do otherwise. -- M > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/38a5c779/attachment.html> From bussonniermatthias at gmail.com Wed May 7 05:59:46 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 7 May 2014 11:59:46 +0200 Subject: [IPython-dev] Execute python code from the notebook dashboard In-Reply-To: <CAA3Z2fO-r-yg8XvREOBmuq6Sj8aRF59kmAFE3mAcoGv4fFJLug@mail.gmail.com> References: <CAA3Z2fO-r-yg8XvREOBmuq6Sj8aRF59kmAFE3mAcoGv4fFJLug@mail.gmail.com> Message-ID: <165D1E19-760E-45C0-B33A-BCB69ADE3357@gmail.com> Le 3 mai 2014 ? 17:00, Clyde Fare a ?crit : > Hi, > > I'm trying to create a graphical IPython notebook dashboard that represents a collection of notebooks as a network, where nodes are the notebooks and the links between them are links between notebooks specified in markdown cells. > > I've got something that kind of works (https://github.com/Clyde-fare/ipython_graphdash) but it requires manual execution of some python code in the directory that IPython is launched from. I'd like to get rid of this requirement by having this python code execute when people click the refresh notebook list icon on the dashboard. > > I'm very much a beginner javascript wise but as far as I can tell when we open a notebook a python kernel is launched but at the dashboard there is no kernel active and so in order to execute some python code I would have to first launch a kernel and then pass it the code I want to run. I think I can probably go away and figure out how to do that but I wanted to check whether this was the right idea, or whether there was a simpler way? In IPython 2.0 you can access the list of notebook and kernels using the rest API under /api/* https://localhost:8888/api/notebooks https://localhost:8888/api/kernels ? So you can start notebook-less kernel to do whatever you like, and stop it afterward. You can also get notebook content through this way. So I would suggest building an alternative dashboard the use this API -- M > > Cheers > > Clyde > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/3ebe491b/attachment.html> From aron at ahmadia.net Wed May 7 09:15:23 2014 From: aron at ahmadia.net (Aron Ahmadia) Date: Wed, 7 May 2014 08:15:23 -0500 Subject: [IPython-dev] Load custom.js file that is not in my ipython profile directory In-Reply-To: <CAPdrMXjjXmRT3r0585-yV5FLWbPyX+1PWtqZqr=GD45iHa5Lxg@mail.gmail.com> References: <CAPdrMXjjXmRT3r0585-yV5FLWbPyX+1PWtqZqr=GD45iHa5Lxg@mail.gmail.com> Message-ID: <CAPhiW4hTaXQcoAgh886Li-JV_TU-AoZUEgd9rXFCEpgcRyJ4OQ@mail.gmail.com> %% javascript That and the profile are the two most common methods for enabling custom js. The previous method of embedding in Markdown is no longer allowed. A On Wednesday, May 7, 2014, David Ketcheson <dketch at gmail.com> wrote: > I'd like to load some javascript into the notebook from a .js file that is > not in my ipython profile directory. This would allow me to distribute the > notebook and the .js file together and have users get the benefit of the > .js file in the notebook. > > I know how to do the analogous thing with .css files, based on the content > of the last cell in this notebook: > > > http://nbviewer.ipython.org/github/barbagroup/AeroPython/blob/master/lessons/01_Lesson01_sourceSink.ipynb > > How can I do the same for javascript? > > -David > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/470db0a8/attachment.html> From moorepants at gmail.com Wed May 7 12:35:55 2014 From: moorepants at gmail.com (Jason Moore) Date: Wed, 7 May 2014 12:35:55 -0400 Subject: [IPython-dev] How to have independent call backs for single widget In-Reply-To: <B54F4748-CF0D-47FF-839A-77ABF4813434@gmail.com> References: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> <B54F4748-CF0D-47FF-839A-77ABF4813434@gmail.com> Message-ID: <CAP7f1AjNYRdac2Cg7cO780Z6XBfQUqKV6066Z5Pj_iqNgmhOfA@mail.gmail.com> What would be classic memoization in this application? Just store axes globally or something? Jason moorepants.info +01 530-601-9791 On Wed, May 7, 2014 at 4:41 AM, Matthias BUSSONNIER < bussonniermatthias at gmail.com> wrote: > > Le 6 mai 2014 ? 23:31, Jason Moore a ?crit : > > > If I have a function that makes a plot, for example: > > > > def plot_something(parameter=1.0, view=1.0): > > axes = expensive_function(plt.gca(), parameter) > > less_expensive_function(axes, view) > > > > And I make it interactive: > > > > interactive(plot_something, parameter=(0.0, 1.0), view=(0.0, 1.0)) > > > > As it stands, both the expensive_function and the > less_expensive_function run whether I drag the slider for either parameter, > even though if I only drag the view parameter I could theoretically only > call the less_expensive_function, thus making the widget respond faster. > > > > What is a good design to have a widget depend on two or more parameters > and be able to have internal knowledge in the callback function on what > parameter changed? So that you can avoid overhead in computation? > > I suppose this is possible by doing custom widget and/or using the comm > architecture directly. > But that would be a **lot** of work. > But couldn't you just use classic memoization of the expensive_function so > that recalling it becomes less expensive ? > > -- > M > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/459ff79d/attachment.html> From doug.blank at gmail.com Wed May 7 12:55:12 2014 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 7 May 2014 12:55:12 -0400 Subject: [IPython-dev] How to have independent call backs for single widget In-Reply-To: <CAP7f1AjNYRdac2Cg7cO780Z6XBfQUqKV6066Z5Pj_iqNgmhOfA@mail.gmail.com> References: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> <B54F4748-CF0D-47FF-839A-77ABF4813434@gmail.com> <CAP7f1AjNYRdac2Cg7cO780Z6XBfQUqKV6066Z5Pj_iqNgmhOfA@mail.gmail.com> Message-ID: <CAAusYCjQeCO4i0+zgZ_3hWjKyQ_PbMN23pRb-CNfByyYFS5GdA@mail.gmail.com> On Wed, May 7, 2014 at 12:35 PM, Jason Moore <moorepants at gmail.com> wrote: > What would be classic memoization in this application? Just store axes > globally or something? > Maybe something like: http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Python/Memoizing%20Fibs.ipynb -Doug > > > Jason > moorepants.info > +01 530-601-9791 > > > On Wed, May 7, 2014 at 4:41 AM, Matthias BUSSONNIER < > bussonniermatthias at gmail.com> wrote: > >> >> Le 6 mai 2014 ? 23:31, Jason Moore a ?crit : >> >> > If I have a function that makes a plot, for example: >> > >> > def plot_something(parameter=1.0, view=1.0): >> > axes = expensive_function(plt.gca(), parameter) >> > less_expensive_function(axes, view) >> > >> > And I make it interactive: >> > >> > interactive(plot_something, parameter=(0.0, 1.0), view=(0.0, 1.0)) >> > >> > As it stands, both the expensive_function and the >> less_expensive_function run whether I drag the slider for either parameter, >> even though if I only drag the view parameter I could theoretically only >> call the less_expensive_function, thus making the widget respond faster. >> > >> > What is a good design to have a widget depend on two or more parameters >> and be able to have internal knowledge in the callback function on what >> parameter changed? So that you can avoid overhead in computation? >> >> I suppose this is possible by doing custom widget and/or using the comm >> architecture directly. >> But that would be a **lot** of work. >> But couldn't you just use classic memoization of the expensive_function >> so that recalling it becomes less expensive ? >> >> -- >> M >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/534abbc9/attachment.html> From moorepants at gmail.com Wed May 7 14:24:13 2014 From: moorepants at gmail.com (Jason Moore) Date: Wed, 7 May 2014 14:24:13 -0400 Subject: [IPython-dev] How to have independent call backs for single widget In-Reply-To: <CAAusYCjQeCO4i0+zgZ_3hWjKyQ_PbMN23pRb-CNfByyYFS5GdA@mail.gmail.com> References: <CAP7f1Agod+6-y5QTP3p9AEf0fLfY3vFvVf+yHMwFPbAN7ZGvhA@mail.gmail.com> <B54F4748-CF0D-47FF-839A-77ABF4813434@gmail.com> <CAP7f1AjNYRdac2Cg7cO780Z6XBfQUqKV6066Z5Pj_iqNgmhOfA@mail.gmail.com> <CAAusYCjQeCO4i0+zgZ_3hWjKyQ_PbMN23pRb-CNfByyYFS5GdA@mail.gmail.com> Message-ID: <CAP7f1Ai7S3GnEWxs8zsn-150FwfTBY3Jr=3Fi2+D=LxzK0SbMA@mail.gmail.com> Thank's Doug. Perfect simple example. Jason moorepants.info +01 530-601-9791 On Wed, May 7, 2014 at 12:55 PM, Doug Blank <doug.blank at gmail.com> wrote: > On Wed, May 7, 2014 at 12:35 PM, Jason Moore <moorepants at gmail.com> wrote: > >> What would be classic memoization in this application? Just store axes >> globally or something? >> > > Maybe something like: > > > http://nbviewer.ipython.org/urls/bitbucket.org/ipre/calico/raw/master/notebooks/Python/Memoizing%20Fibs.ipynb > > -Doug > > >> >> >> Jason >> moorepants.info >> +01 530-601-9791 >> >> >> On Wed, May 7, 2014 at 4:41 AM, Matthias BUSSONNIER < >> bussonniermatthias at gmail.com> wrote: >> >>> >>> Le 6 mai 2014 ? 23:31, Jason Moore a ?crit : >>> >>> > If I have a function that makes a plot, for example: >>> > >>> > def plot_something(parameter=1.0, view=1.0): >>> > axes = expensive_function(plt.gca(), parameter) >>> > less_expensive_function(axes, view) >>> > >>> > And I make it interactive: >>> > >>> > interactive(plot_something, parameter=(0.0, 1.0), view=(0.0, 1.0)) >>> > >>> > As it stands, both the expensive_function and the >>> less_expensive_function run whether I drag the slider for either parameter, >>> even though if I only drag the view parameter I could theoretically only >>> call the less_expensive_function, thus making the widget respond faster. >>> > >>> > What is a good design to have a widget depend on two or more >>> parameters and be able to have internal knowledge in the callback function >>> on what parameter changed? So that you can avoid overhead in computation? >>> >>> I suppose this is possible by doing custom widget and/or using the comm >>> architecture directly. >>> But that would be a **lot** of work. >>> But couldn't you just use classic memoization of the expensive_function >>> so that recalling it becomes less expensive ? >>> >>> -- >>> M >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/43217c98/attachment.html> From takowl at gmail.com Wed May 7 14:46:32 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Wed, 7 May 2014 11:46:32 -0700 Subject: [IPython-dev] IPython 'office hours', 17:00 UTC, Tuesday 13 May Message-ID: <CAOvn4qjmBcu_oQChmS8BiBWsf_7J0DNUS0GF1iEaT9NMMJL19w@mail.gmail.com> Next Tuesday, we'll be running another IPython office hours, a chance for anyone who's interested to chat with the core team about IPython development. Tuesday 13 May, 17:00 UTC (6pm BST, 10am PDT) https://plus.google.com/b/117293602899680632636/events/ckor559veeqg1ioqa38kqr9d2k8 Come and ask us about developing interactive widgets, the message spec changes for the next version of IPython, the new kernel spec system, or anything else about extending or working on IPython. E-mail me with your Google e-mail address if you'd like to join us in the video chat - we'll try to get as many people as possible into the Hangout. If we have a lot of people, or you're on a slow connection, join our development chat room, which we'll be logged into at the same time: http://www.hipchat.com/ghtNzvmfC Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/801d2abc/attachment.html> From doug.blank at gmail.com Wed May 7 15:35:06 2014 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 7 May 2014 15:35:06 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <5367E44D.1040207@third-bit.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> <CAN1QFFQZLS3EXhcNNVHQARFAB9eGBPjbN0zYWWE5HMaNwfsSxA@mail.gmail.com> <5367E44D.1040207@third-bit.com> Message-ID: <CAAusYCgPR2TRrxjRNSwmo0hEEfWLsCVTnAM_Nc3yf5RdKj8qLw@mail.gmail.com> On Mon, May 5, 2014 at 3:19 PM, Greg Wilson <gvwilson at third-bit.com> wrote: > http://github.com/gvwilson/sqlitemagic may also be of interest - it's > what we use to produce the Software Carpentry lesson on SQL. > That is a ridiculously simple and effective 50 lines of code. It isn't a SQLite shell, but it does 80% of what one would want from a SQLite kernel. Thanks for that! -Doug > thx, > G > > > On 2014-05-05 1:55 PM, Martin Gadbois wrote: > > Wow that was there but not found by Google... nice! I will take a close > look, thanks! > > > On Mon, May 5, 2014 at 11:52 AM, Jessica B. Hamrick <jhamrick at berkeley.edu > > wrote: > >> Hi all, >> >> I jut wanted to throw out there a link to the SQL magic, which may be >> relevant: >> >> https://github.com/catherinedevlin/ipython-sql >> >> I know it's not a whole kernel, but may be a good starting place for at >> least seeing what other people have been thinking about along the same >> directions. >> >> Cheers, >> Jess >> >> -- >> UC Berkeley, Department of Psychology >> Computational Cognitive Science Lab >> http://www.jesshamrick.com >> >> >> On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com> wrote: >> >>> On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com>wrote: >>> >>>> Hi! >>>> >>>> I would like to develop a SQLite kernel for IPython. >>>> >>>> Keyword, table and column completion would help building queries, and a >>>> dynamic output could resize text columns and have a proper notebook table >>>> output. >>>> >>>> To achieve that, I see two main directions: >>>> 1- Have an external kernel (like >>>> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >>>> coded in Python since there are no 0MQ bindings for SQLite. >>>> 2- Extend IPython itself to support SQLite, since I will need to >>>> write Python code anyway to support SQLite. >>>> >>> >>> I've wanted something like this for a while! I would like to >>> incorporate SQL as a language that could easily be used in a variety of >>> educational settings and other open source projects. But the utility of >>> such a project lies in the details of implementation. >>> >>> There are pros and cons to both approaches. But you could perhaps >>> develop it in a manner that could be used in either situation. What would >>> generally be useful would be to replicate the SQLite shell. It would be >>> great if the parser was written in pure Python, and had an interpreter, >>> also as much written in pure Python as possible. That is, it would be great >>> if the low-level C-based sqlite API was limited, and could be swapped out. >>> >>> That would allow other implementations of Python (Jython, PyPy, >>> IronPython) could use it with their own sqlite wrappers. But also, that >>> might make it useful for interfacing other data storages (for example, CSV >>> files, Django databases, etc.) >>> >>> The SQLite shell is actually a bit hairy. Here is a port of the C code >>> to C# for example: >>> >>> http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell >>> >>> You could also use the simple-kernel [1] as a way of quickly turning a >>> Python program into a kernel. (simple-kernel was just updated by Min, so >>> now it is correct; thanks, Min!) >>> >>> This might also have connections to the ADODB API [2]... they have >>> worked hard to make their connections be Python-implementation agnostic. >>> >>> Looking forward to see what you develop! >>> >>> -Doug >>> >>> [1] https://github.com/dsblank/simple_kernel >>> [2] https://sourceforge.net/projects/adodbapi >>> >>> >>>> >>>> What would this list recommend as an implementation strategy? >>>> Any example of creating an external kernel by reusing a subset of >>>> IPython itself? >>>> >>>> Thanks! >>>> >>>> -- >>>> Martin >>>> >>>> _______________________________________________ >>>> IPython-dev mailing list >>>> IPython-dev at scipy.org >>>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>>> >>>> >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > > -- > Martin > > > _______________________________________________ > IPython-dev mailing listIPython-dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/046b41df/attachment.html> From doug.blank at gmail.com Wed May 7 15:42:02 2014 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 7 May 2014 15:42:02 -0400 Subject: [IPython-dev] SQLite kernel In-Reply-To: <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> References: <CAN1QFFQEmVTYio5FpkVnAkgEVbmmwb0wRxDUJgJeA1AwqWV_Nw@mail.gmail.com> <CAAusYCjCB0sQW4QiOYwRzmznDr62pc6bNu0hgxfKTnZOZV3jeg@mail.gmail.com> <CALUXcByY8F6G34rQ0K9fC5pVoMwdOx3=PqG3et1mNSO34FotOw@mail.gmail.com> Message-ID: <CAAusYCjCj=qxPd=N4ovt+uyDquFSp_NU1q1Q5UcSGGB7bvT3Tw@mail.gmail.com> On Mon, May 5, 2014 at 11:52 AM, Jessica B. Hamrick <jhamrick at berkeley.edu>wrote: > Hi all, > > I jut wanted to throw out there a link to the SQL magic, which may be > relevant: > > https://github.com/catherinedevlin/ipython-sql > > I know it's not a whole kernel, but may be a good starting place for at > least seeing what other people have been thinking about along the same > directions. > That is a nicely integrated set of extensions... make good connections with the IPython python stack (pandas and matplotlib). Thanks for development, and sharing! -Doug > > Cheers, > Jess > > -- > UC Berkeley, Department of Psychology > Computational Cognitive Science Lab > http://www.jesshamrick.com > > > On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com> wrote: > >> On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com>wrote: >> >>> Hi! >>> >>> I would like to develop a SQLite kernel for IPython. >>> >>> Keyword, table and column completion would help building queries, and a >>> dynamic output could resize text columns and have a proper notebook table >>> output. >>> >>> To achieve that, I see two main directions: >>> 1- Have an external kernel (like >>> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb) >>> coded in Python since there are no 0MQ bindings for SQLite. >>> 2- Extend IPython itself to support SQLite, since I will need to write >>> Python code anyway to support SQLite. >>> >> >> I've wanted something like this for a while! I would like to incorporate >> SQL as a language that could easily be used in a variety of educational >> settings and other open source projects. But the utility of such a project >> lies in the details of implementation. >> >> There are pros and cons to both approaches. But you could perhaps develop >> it in a manner that could be used in either situation. What would generally >> be useful would be to replicate the SQLite shell. It would be great if the >> parser was written in pure Python, and had an interpreter, also as much >> written in pure Python as possible. That is, it would be great if the >> low-level C-based sqlite API was limited, and could be swapped out. >> >> That would allow other implementations of Python (Jython, PyPy, >> IronPython) could use it with their own sqlite wrappers. But also, that >> might make it useful for interfacing other data storages (for example, CSV >> files, Django databases, etc.) >> >> The SQLite shell is actually a bit hairy. Here is a port of the C code to >> C# for example: >> >> http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell >> >> You could also use the simple-kernel [1] as a way of quickly turning a >> Python program into a kernel. (simple-kernel was just updated by Min, so >> now it is correct; thanks, Min!) >> >> This might also have connections to the ADODB API [2]... they have worked >> hard to make their connections be Python-implementation agnostic. >> >> Looking forward to see what you develop! >> >> -Doug >> >> [1] https://github.com/dsblank/simple_kernel >> [2] https://sourceforge.net/projects/adodbapi >> >> >>> >>> What would this list recommend as an implementation strategy? >>> Any example of creating an external kernel by reusing a subset of >>> IPython itself? >>> >>> Thanks! >>> >>> -- >>> Martin >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/ipython-dev >>> >>> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/eb8f89df/attachment.html> From tshead at sandia.gov Wed May 7 19:01:20 2014 From: tshead at sandia.gov (Shead, Timothy) Date: Wed, 7 May 2014 23:01:20 +0000 Subject: [IPython-dev] How can tell if code is executing within ipython / ipython notebook? Message-ID: <52EBD146-A6D6-4336-AF3C-3886A3146501@sandia.gov> I have some code that I?d like to execute only when run from within ipython ? is there any way to know? I?m already importing the required ipython modules in a try ? catch block, so my code handles the case where IPython isn?t installed, but that doesn?t address the case where ipython is installed but not in use. Thanks in advance, Tim Timothy M. Shead Sandia National Laboratories 1461, Scalable Analysis and Visualization -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3216 bytes Desc: not available URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/11b6cd53/attachment.bin> From pi at berkeley.edu Wed May 7 19:25:04 2014 From: pi at berkeley.edu (Paul Ivanov) Date: Wed, 7 May 2014 16:25:04 -0700 Subject: [IPython-dev] How can tell if code is executing within ipython / ipython notebook? In-Reply-To: <52EBD146-A6D6-4336-AF3C-3886A3146501@sandia.gov> References: <52EBD146-A6D6-4336-AF3C-3886A3146501@sandia.gov> Message-ID: <20140507232504.GA5961@HbI-OTOH.berkeley.edu> Shead, Timothy, on 2014-05-07 23:01, wrote: > I have some code that I?d like to execute only when run from > within ipython ? is there any way to know? I?m already > importing the required ipython modules in a try ? catch block, > so my code handles the case where IPython isn?t installed, but > that doesn?t address the case where ipython is installed but > not in use. When running ipython, we expose the function `get_ipython` to get a handle on the current IPython instance. So in an interactive setting, you could just check for that and catch a name error. More generally, you can do this: from IPython import get_ipython Calling get_ipython() will return None if IPython isn't running, otherwise it will return an IPython shell object. best, -- _ / \ A* \^ - ,./ _.`\\ / \ / ,--.S \/ \ / `"~,_ \ \ __o ? _ \<,_ /:\ --(_)/-(_)----.../ | \ --------------.......J Paul Ivanov http://pirsquared.org From tshead at sandia.gov Wed May 7 23:33:56 2014 From: tshead at sandia.gov (Shead, Timothy) Date: Thu, 8 May 2014 03:33:56 +0000 Subject: [IPython-dev] [EXTERNAL] How can tell if code is executing within ipython / ipython notebook? In-Reply-To: <20140507232504.GA5961@HbI-OTOH.berkeley.edu> References: <52EBD146-A6D6-4336-AF3C-3886A3146501@sandia.gov> <20140507232504.GA5961@HbI-OTOH.berkeley.edu> Message-ID: <98FACE25-FC58-4872-A5A4-81F1719B9A84@sandia.gov> Paul: Works like a charm, many thanks! Cheers, Tim Timothy M. Shead Sandia National Laboratories 1461, Scalable Analysis and Visualization On May 7, 2014, at 5:25 PM, Paul Ivanov <pi at berkeley.edu<mailto:pi at berkeley.edu>> wrote: Shead, Timothy, on 2014-05-07 23:01, wrote: I have some code that I?d like to execute only when run from within ipython ? is there any way to know? I?m already importing the required ipython modules in a try ? catch block, so my code handles the case where IPython isn?t installed, but that doesn?t address the case where ipython is installed but not in use. When running ipython, we expose the function `get_ipython` to get a handle on the current IPython instance. So in an interactive setting, you could just check for that and catch a name error. More generally, you can do this: from IPython import get_ipython Calling get_ipython() will return None if IPython isn't running, otherwise it will return an IPython shell object. best, -- _ / \ A* \^ - ,./ _.`\\ / \ / ,--.S \/ \ / `"~,_ \ \ __o ? _ \<,_ /:\ --(_)/-(_)----.../ | \ --------------.......J Paul Ivanov http://pirsquared.org _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/e57f302c/attachment.html> From klonuo at gmail.com Thu May 8 06:57:12 2014 From: klonuo at gmail.com (klo uo) Date: Thu, 8 May 2014 12:57:12 +0200 Subject: [IPython-dev] Html object graph In-Reply-To: <74CB9B8B-35F3-4435-BC1C-D70058DEDD30@gmail.com> References: <CAA-8Ld_DHsN8ptHV30erT85wdNiAh4cMHm0yV6dW96qg+VxH0A@mail.gmail.com> <74CB9B8B-35F3-4435-BC1C-D70058DEDD30@gmail.com> Message-ID: <CAA-8Ld_2MzHnN6p6wwdT6tn=SQu1AiqHDK7mNUD7NjGKW0C+bQ@mail.gmail.com> Thanks Matthias for your reply. I agree that my mail was too general. I started learning .Net basics and one thing that attracted me most was Linq. Not that it just simplifies SQL by avoiding redundancy and providing shorcuts, but can be used the same way on XML documents, or general .Net objects (that provide IEnumerable(Of T) Interface) or even GUI elements that provide IObservable(T) Interface (RX extensions). Then using this LinqPad application as playground is a joy (compared to other options), similarly as working in IPython, and plus making .Net interpretable as Python is. I thought on how to connect both concepts but wasn't much sure, as I still don't know much about IPython machinery, and less about LinqPad, but that interactive Html table was IMHO worth mentioning, even as general idea. Now that you wrote about Pandas Html tables - maybe that's the right place for providing enhanced interactive object widget - on Pandas dataframe object. Let me mention Linq again, that it is great, but can't be compared to Pandas methods for data slicing for sure, and interfacing Pandas object with rich widget would be really great step. I did search for extensions to Html table dumped in IPython when I first saw it, as although it was interesting to see tabular data presented as such it still looked too basic, but I didn't find any. Cyrille Rossant's project that you wrote about looks interesting as it allows interactive changes to Pandas dataframe, and I hope he'll continue crafting it, by adding other possibilities. And as much as I would like to try to enhance IPython Html table myself, I'm repulsed by JavaScript - it's just something I don't ever want to do, unless I'm forced to. Hopefully that LinqPad table interface can inspire some developer one way or another. Cheers On Wed, May 7, 2014 at 11:56 AM, Matthias BUSSONNIER < bussonniermatthias at gmail.com> wrote: > Hy, > Le 3 mai 2014 ? 18:31, klo uo a ?crit : > > Hey guys, > > are you are familiar with LinqPad?<https://www.linqpad.net/CodeSnippetIDE.aspx> > > > Thanks for the link. > > If not, just to say it's a lightweight code scratchpad, that can connect > to various databases and allow immediate Linq execution. It can also > interpret any kind of .Net code (although currently without > IronPython/Ruby). > > I thought to ask you about main output result pane - it's a very > interesting Html table representation of dumped object(s), that adapts on > the object type - allows collapsible nested levels, navigable deep > Exception tree, can display images, rawhtml, hyperlinqs - user defined > lambda functions that are executed on user click, ? > > > I suppose each of theses features should be discussed independently. Most > should Imho be directly implemented by library, > like cyrile rossant HandsonTable for panda dataframe. > > Some other like Traceback could definitively be integrate din the core, > have already been discussed, but > pushed to a later point by lack of manpower. > > Do you think something similar would fit in IPython? > As object inspection magic, or Qtconsole output pane, or else?? > > > The response will depend on the exact feature, but instead of targeting a > specific frontend I would suggest to think on how to get this into the > object _repr_*_ or > in the message spec if it is really impossible to do otherwise. > > -- > M > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/7d8cbaea/attachment.html> From clyde.fare at gmail.com Thu May 8 09:32:00 2014 From: clyde.fare at gmail.com (Clyde Fare) Date: Thu, 8 May 2014 14:32:00 +0100 Subject: [IPython-dev] Execute python code from the notebook dashboard In-Reply-To: <165D1E19-760E-45C0-B33A-BCB69ADE3357@gmail.com> References: <CAA3Z2fO-r-yg8XvREOBmuq6Sj8aRF59kmAFE3mAcoGv4fFJLug@mail.gmail.com> <165D1E19-760E-45C0-B33A-BCB69ADE3357@gmail.com> Message-ID: <CAA3Z2fModgL_8-5NEK-A57_5Vg+vYxnVYh35cGyuMDuG0NxJSQ@mail.gmail.com> Hi, Thanks for the suggestions. I can see that I can start a new kernel by posting to /api/kernels, but am a little lost at how to pass code to it using javascript. Is there a simple way to use services/kernels/js/kernel.js and hence kernel.execute? Or would I need to explicitly code up connecting to the kernel's ports and passing it the relevant messages as if I were writing a new kernel? Cheers Clyde On 7 May 2014 10:59, Matthias BUSSONNIER <bussonniermatthias at gmail.com>wrote: > > Le 3 mai 2014 ? 17:00, Clyde Fare a ?crit : > > Hi, > > I'm trying to create a graphical IPython notebook dashboard that > represents a collection of notebooks as a network, where nodes are the > notebooks and the links between them are links between notebooks specified > in markdown cells. > > I've got something that kind of works ( > https://github.com/Clyde-fare/ipython_graphdash) but it requires manual > execution of some python code in the directory that IPython is launched > from. I'd like to get rid of this requirement by having this python code > execute when people click the refresh notebook list icon on the dashboard. > > I'm very much a beginner javascript wise but as far as I can tell when we > open a notebook a python kernel is launched but at the dashboard there is > no kernel active and so in order to execute some python code I would have > to first launch a kernel and then pass it the code I want to run. I think I > can probably go away and figure out how to do that but I wanted to check > whether this was the right idea, or whether there was a simpler way? > > > In IPython 2.0 you can access the list of notebook and kernels using the > rest API under /api/* > https://localhost:8888/api/notebooks > https://localhost:8888/api/kernels > ? > So you can start notebook-less kernel to do whatever you like, and stop it > afterward. > You can also get notebook content through this way. > > So I would suggest building an alternative dashboard the use this API > > -- > M > > > Cheers > > Clyde > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/b79f5b74/attachment.html> From rmx555 at hotmail.com Thu May 8 13:11:09 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Thu, 8 May 2014 19:11:09 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? Message-ID: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> is it possible to pass parameters to IPython notebook via URL?How to reference/use those parameters in a notebook?e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/52e74f77/attachment.html> From benjaminrk at gmail.com Thu May 8 13:47:16 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 8 May 2014 10:47:16 -0700 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> Message-ID: <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > is it possible to pass parameters to IPython notebook via URL? > > How to reference/use those parameters in a notebook? > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb*?d1=20140101&d2=20140401* > > > Did not find an answer after searching around. Thanks! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/edcba3cd/attachment.html> From rmx555 at hotmail.com Thu May 8 14:51:33 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Thu, 8 May 2014 20:51:33 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> Message-ID: <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. From: benjaminrk at gmail.com Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/f6f250a2/attachment.html> From pierre.villeneuve at gmail.com Thu May 8 15:29:26 2014 From: pierre.villeneuve at gmail.com (Pierre Villeneuve) Date: Thu, 8 May 2014 12:29:26 -0700 Subject: [IPython-dev] Notebook back/front data communications Message-ID: <CANL3p1Jv=6jAsFgQp+pHFrsmeVJofVe=Nv5aL1K4UxKUb2e=cA@mail.gmail.com> I'm working on building an image display custom widget based on the HTML CanvasElement. I want to be able to update image transform properties and to respond to mouse motion and clicks. My first time though I placed most of my JavaScript event handlers inside the widget's update() function. And it noticed I was updating the image data even for a small event like a change in the canvas width. It seemed like there was a lot of unnecessary processing and data transfer going on, so I decided to look into using the custom messages instead. I think my new approach is more efficient, but it does involve writing more code for my event handlers. ? ?Now I am wondering which of these two approaches is 'best', if there even is such a thing? Most of the widgets I see included with the IPython source code involve rather simple data structures, e.g. a single floating point number, or a text string. In my case I plan to work with ?large images. I think I just convinced myself that my second approach is more appropriate since my data is not trivially small. ? *Pierre Villeneuve* pierre.villeneuve at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/3b491d31/attachment.html> From benjaminrk at gmail.com Thu May 8 19:03:15 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 8 May 2014 16:03:15 -0700 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> Message-ID: <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: > Many thanks for the reply, I see. Indeed I am looking for a way to pass > parameters to the Python code on the kernel, e.g. .NET app calling out a > notebook with parameters and displaying output. > So, essentially the notebook server doesn't support this sort of > interaction at the moment? I assume I could do it by cloning and modifying > .ipynb template file before each request, still hoping there is a better > way than that. > No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK > > ------------------------------ > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 10:47:16 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > You can do this, but I wouldn't recommend it. The parameters will only be > available to the HTML/JS in the notebook page, and not the Python code on > the kernel. Plus, there is a chance that it would conflict with any future > use of url parameters by the notebook server. > > -MinRK > > > On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > is it possible to pass parameters to IPython notebook via URL? > > How to reference/use those parameters in a notebook? > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb*?d1=20140101&d2=20140401* > > > Did not find an answer after searching around. Thanks! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140508/885c2266/attachment.html> From bussonniermatthias at gmail.com Fri May 9 03:36:53 2014 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Fri, 9 May 2014 09:36:53 +0200 Subject: [IPython-dev] Execute python code from the notebook dashboard In-Reply-To: <CAA3Z2fModgL_8-5NEK-A57_5Vg+vYxnVYh35cGyuMDuG0NxJSQ@mail.gmail.com> References: <CAA3Z2fO-r-yg8XvREOBmuq6Sj8aRF59kmAFE3mAcoGv4fFJLug@mail.gmail.com> <165D1E19-760E-45C0-B33A-BCB69ADE3357@gmail.com> <CAA3Z2fModgL_8-5NEK-A57_5Vg+vYxnVYh35cGyuMDuG0NxJSQ@mail.gmail.com> Message-ID: <33E5F7E1-9A05-4561-A8C0-8FA8152C97FE@gmail.com> Le 8 mai 2014 ? 15:32, Clyde Fare a ?crit : > Hi, > > Thanks for the suggestions. I can see that I can start a new kernel by posting to /api/kernels, but am a little lost at how to pass code to it using javascript. Is there a simple way to use services/kernels/js/kernel.js and hence kernel.execute? Or would I need to explicitly code up connecting to the kernel's ports and passing it the relevant messages as if I were writing a new kernel? Kernel.js should be pretty standalone. Once you pass it the information to connect to a kernel you can just use kernel.execute() with call backs. This should help : https://github.com/minrk/singlecell -- M From rmx555 at hotmail.com Fri May 9 16:25:15 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Fri, 9 May 2014 22:25:15 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> Message-ID: <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl> OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? do you plan for such an enhancement (passing parameters via URL to notebooks)? or which class would I need to modify to implement support for this? From: benjaminrk at gmail.com Date: Thu, 8 May 2014 16:03:15 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK From: benjaminrk at gmail.com Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140509/026e2304/attachment.html> From benjaminrk at gmail.com Fri May 9 16:43:07 2014 From: benjaminrk at gmail.com (MinRK) Date: Fri, 9 May 2014 13:43:07 -0700 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl> Message-ID: <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: OK, thanks for clarifying it once again. Javascript API means user needs to > interact with the page once it's already loaded? > Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn?t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. > do you plan for such an enhancement (passing parameters via URL to > notebooks)? > No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. or which class would I need to modify to implement support for this? > At least a few: - the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. - the KernelManager, which starts the kernel, which would need to be told about these parameters - possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. Depending on how much javascript you customize, there are probably a few combinations of classes to modify. Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. -MinRK ------------------------------ > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 16:03:15 -0700 > > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > > > On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > Many thanks for the reply, I see. Indeed I am looking for a way to pass > parameters to the Python code on the kernel, e.g. .NET app calling out a > notebook with parameters and displaying output. > So, essentially the notebook server doesn't support this sort of > interaction at the moment? I assume I could do it by cloning and modifying > .ipynb template file before each request, still hoping there is a better > way than that. > > > No, the server definitely doesn't support URLs affecting the kernel. If > you want to execute code on the Kernel, you would do this via the > Javascript APIs. > > -MinRK > > > > > ------------------------------ > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 10:47:16 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > You can do this, but I wouldn't recommend it. The parameters will only be > available to the HTML/JS in the notebook page, and not the Python code on > the kernel. Plus, there is a chance that it would conflict with any future > use of url parameters by the notebook server. > > -MinRK > > > On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > is it possible to pass parameters to IPython notebook via URL? > > How to reference/use those parameters in a notebook? > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb*?d1=20140101&d2=20140401* > > > Did not find an answer after searching around. Thanks! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140509/ff1d6622/attachment.html> From mmckerns at caltech.edu Fri May 9 16:55:53 2014 From: mmckerns at caltech.edu (Michael McKerns) Date: Fri, 9 May 2014 16:55:53 -0400 (EDT) Subject: [IPython-dev] potential extension to ?? magic, etc Message-ID: <50428.67.186.183.87.1399668953.squirrel@webmail.caltech.edu> I've been hacking a new feature in dill that extracts importable source code from python objects. It's still kind of fragile, and some things don't work like I want, but it's starting to come around enough that I thought I'd share. I think it might be useful for ipython's "??" and also for python.parallel if it still sends source in certain cases. I know parallelpython (pp) does, and it augments the heck out of what pp can send across the wire. There's several useful functions in dill.source and dill.detect, but the main one is dill.source.importable. With it, you can do something like this: >>> def foo(f): ... def squared(x): ... return f(x)**2 ... return squared ... >>> @foo ... def bar(x): ... return 2*x ... >>> print dill.source.importable(bar) def foo(f): def squared(x): return f(x)**2 return squared @foo def bar(x): return 2*x There are still some bugs, as this is fairly new. :) --- Mike McKerns California Institute of Technology TEL: (626)395-5773 or (626)590-8470 http://www.its.caltech.edu/~mmckerns mmckerns at caltech.edu From rmx555 at hotmail.com Sun May 11 02:51:14 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Sun, 11 May 2014 08:51:14 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> Message-ID: <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. RM From: benjaminrk at gmail.com Date: Fri, 9 May 2014 13:43:07 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn?t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. do you plan for such an enhancement (passing parameters via URL to notebooks)? No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. or which class would I need to modify to implement support for this? At least a few: the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. the KernelManager, which starts the kernel, which would need to be told about these parameters possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. Depending on how much javascript you customize, there are probably a few combinations of classes to modify. Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. -MinRK From: benjaminrk at gmail.com Date: Thu, 8 May 2014 16:03:15 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK From: benjaminrk at gmail.com Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140511/10d2fe56/attachment.html> From heathmatlock at gmail.com Sun May 11 17:05:43 2014 From: heathmatlock at gmail.com (heathmatlock) Date: Sun, 11 May 2014 16:05:43 -0500 Subject: [IPython-dev] Assistance request in forming a correct kernel_info_reply Message-ID: <CABAYxNuo4FSCVQWT-hdt1+674geKPehpe50cnkRxb8zfY-Y1uA@mail.gmail.com> https://github.com/heath/ijs/blob/master/kernel.coffee If you uncomment line 48 in the source file linked, it will be easier to see the response sent back by ipython. All the messages I'm receiving back are of type kernel_info_request, even though I'm sending back what I think is the appropriate response. Relevant portion of documentation: http://ipython.org/ipython-doc/dev/development/messaging.html#kernel-info Also, when developing a kernel for a non-Python consumer, do others use a development version of ipython and utilize pdb as well, or have you mostly been utilizing your language's debugging facilities, i.e.: receive a zmq response, inspect the response(in this case, I'm having to print the response to the screen, eek), ctl-c, look at the documentation, build a response, repeat. -- Heath Matlock +1 256 274 4225 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140511/883f6d2e/attachment.html> From bussonniermatthias at gmail.com Sun May 11 17:19:32 2014 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Sun, 11 May 2014 23:19:32 +0200 Subject: [IPython-dev] Assistance request in forming a correct kernel_info_reply In-Reply-To: <CABAYxNuo4FSCVQWT-hdt1+674geKPehpe50cnkRxb8zfY-Y1uA@mail.gmail.com> References: <CABAYxNuo4FSCVQWT-hdt1+674geKPehpe50cnkRxb8zfY-Y1uA@mail.gmail.com> Message-ID: <A9A7BE39-58B1-487D-B7A5-B62D0FB11A24@gmail.com> Le 11 mai 2014 ? 23:05, heathmatlock a ?crit : > https://github.com/heath/ijs/blob/master/kernel.coffee > > If you uncomment line 48 in the source file linked, it will be easier to see the response sent back by ipython. All the messages I'm receiving back are of type kernel_info_request, even though I'm sending back what I think is the appropriate response. > > Relevant portion of documentation: > http://ipython.org/ipython-doc/dev/development/messaging.html#kernel-info > > Also, when developing a kernel for a non-Python consumer, do others use a development version of ipython and utilize pdb as well, or have you mostly been utilizing your language's debugging facilities, i.e.: receive a zmq response, inspect the response(in this case, I'm having to print the response to the screen, eek), ctl-c, look at the documentation, build a response, repeat. > Hi, I would suggest starting IPython with --debug flag to see messages going back and forth. Also the messages you send back and forth should not get only content. in the doc, you can get the all structure of messages here : http://ipython.org/ipython-doc/dev/development/messaging.html#python-functional-api and in the case of kernel_info_reply you should fill the content key with what you are doing above. Here is an full kernel_info_reply in my case : {'parent_header': {'date': datetime.datetime(2014, 5, 11, 23, 13, 51, 792276), 'username': 'bussonniermatthias', 'session': 'd3b54a91-ba51-4b53-9393-4bec584075d7', 'msg_id': '1544cb4c-9190-4651-9caf-17330ea382cc', 'msg_type': 'kernel_info_request'}, 'msg_type': 'kernel_info_reply', 'msg_id': 'cd756a25-15ab-4996-87b5-460633f4ea68', 'content': {'protocol_version': [4, 1], 'language_version': [2, 7, 6], 'language': 'python', 'ipython_version': [3, 0, 0, 'dev']}, 'header': {'date': datetime.datetime(2014, 5, 11, 23, 14, 9, 461599), 'username': u'kernel', 'session': u'c32cf515-60af-421b-890a-4b6d82a77ecc', 'msg_id': 'cd756a25-15ab-4996-87b5-460633f4ea68', 'msg_type': 'kernel_info_reply'}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x107b8b790>, 'metadata': {}} A list of existing kernels and helpful resources https://github.com/ipython/ipython/wiki/Projects-using-IPython And an old toy js kernel. https://gist.github.com/Carreau/4279371 -- M > -- > Heath Matlock > +1 256 274 4225 > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From mark.voorhies at ucsf.edu Sun May 11 17:27:26 2014 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Sun, 11 May 2014 14:27:26 -0700 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> Message-ID: <536FEB3E.3000501@ucsf.edu> On 05/10/2014 11:51 PM, Roman Max. wrote: > Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. > would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. Will the presented notebook result be interactive, or will all user interaction be via your .NET interface? If the latter, is there any disadvantage to just executing numpy/matplotlib/etc. code directly in a CPython or IronPython interpreter? --Mark > RM > > From: benjaminrk at gmail.com > Date: Fri, 9 May 2014 13:43:07 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > > OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? > > > > Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn?t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. > > > > > > > do you plan for such an enhancement (passing parameters via URL to notebooks)? > > > No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. > > > > or which class would I need to modify to implement support for this? > > > At least a few: > > the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. > the KernelManager, which starts the kernel, which would need to be told about these parameters > possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. > > Depending on how much javascript you customize, there are probably a few combinations of classes to modify. > Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. > -MinRK > > > > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 16:03:15 -0700 > To: ipython-dev at scipy.org > > > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > > > > On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. > > > > > > No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. > > > > > -MinRK > > From: benjaminrk at gmail.com > > > > > Date: Thu, 8 May 2014 10:47:16 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > > > > > You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. > > > > > > > -MinRK > > On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > > > > > is it possible to pass parameters to IPython notebook via URL? > > > > > > How to reference/use those parameters in a notebook? > > > > > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 > > > > > > > > > > > Did not find an answer after searching around. Thanks! > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From zvoros at gmail.com Mon May 12 03:15:00 2014 From: zvoros at gmail.com (=?ISO-8859-1?Q?Zolt=E1n_V=F6r=F6s?=) Date: Mon, 12 May 2014 09:15:00 +0200 Subject: [IPython-dev] difficulties with embedding svg figures Message-ID: <537074F4.8060208@gmail.com> Hi all, Every then and now (I think this happens, when something changes in the notebook latex templates, but I am not sure), I have difficulties embedding SVG figures. If I run the notebook and set InlineBackend.figure_format = 'png', the figures are included in the latex file. If I set InlineBackend.figure_format = 'svg', the figures are pulled out, converted to pdf, and placed in the support folder, but they are not linked in the latex file, their place is empty like \begin{center} \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{} \end{center} Could someone point out, where and what I should fix in order to make this work? Many thanks, Zolt?n -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/cd2858c7/attachment.html> From doug.blank at gmail.com Mon May 12 08:58:38 2014 From: doug.blank at gmail.com (Doug Blank) Date: Mon, 12 May 2014 08:58:38 -0400 Subject: [IPython-dev] Interrupting external kernel on Windows Message-ID: <CAAusYCjxdwWz3QzAMt4UiS10Z-e6x=_KiPi+xwrdsw=4MA_1yg@mail.gmail.com> Devs, Attempting to interrupt an executing command on a third-party kernel on Windows. In fact, I went back to the simple_kernel [1], and I couldn't interrupt it either on Windows. Is there some special handling for interrupting a kernel on Windows? Thanks for any hints, -Doug [1] - https://github.com/dsblank/simple_kernel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/169306af/attachment.html> From jgill at tokiomillennium.com Mon May 12 09:14:23 2014 From: jgill at tokiomillennium.com (John Gill) Date: Mon, 12 May 2014 13:14:23 +0000 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> Message-ID: <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> If you are working with python and .NET you should take a look at pythonnet: https://github.com/pythonnet/pythonnet It allows you to work seamlessly with .NET objects from python. John From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Roman Max. Sent: Sunday, May 11, 2014 3:51 AM To: IPython developers list Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. RM ________________________________ From: benjaminrk at gmail.com Date: Fri, 9 May 2014 13:43:07 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn't recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. do you plan for such an enhancement (passing parameters via URL to notebooks)? No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. or which class would I need to modify to implement support for this? At least a few: * the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. * the KernelManager, which starts the kernel, which would need to be told about these parameters * possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. Depending on how much javascript you customize, there are probably a few combinations of classes to modify. Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. -MinRK ________________________________ From: benjaminrk at gmail.com<mailto:benjaminrk at gmail.com> Date: Thu, 8 May 2014 16:03:15 -0700 To: ipython-dev at scipy.org<mailto:ipython-dev at scipy.org> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output. So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK ________________________________ From: benjaminrk at gmail.com<mailto:benjaminrk at gmail.com> Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org<mailto:ipython-dev at scipy.org> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster at tokiomillennium.com and then permanently delete the email and any attachments from your system. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses. ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/4a842572/attachment.html> From takowl at gmail.com Mon May 12 13:49:38 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 12 May 2014 10:49:38 -0700 Subject: [IPython-dev] Interrupting external kernel on Windows In-Reply-To: <CAAusYCjxdwWz3QzAMt4UiS10Z-e6x=_KiPi+xwrdsw=4MA_1yg@mail.gmail.com> References: <CAAusYCjxdwWz3QzAMt4UiS10Z-e6x=_KiPi+xwrdsw=4MA_1yg@mail.gmail.com> Message-ID: <CAOvn4qiGiWueKEzoOE+1ynEhAuUEL6mv0OOWmrUZeSTi0feBEQ@mail.gmail.com> On 12 May 2014 05:58, Doug Blank <doug.blank at gmail.com> wrote: > Attempting to interrupt an executing command on a third-party kernel on > Windows. In fact, I went back to the simple_kernel [1], and I couldn't > interrupt it either on Windows. Is there some special handling for > interrupting a kernel on Windows? Yes, it appears there is. On Windows, we make a 'Win32 event' [1], which the kernel process listens for using some machinery in pyzmq [2]. It looks like the event number that the child process needs to listen for is currently passed to the kernel as a command line argument, which we can only do when we know we're starting an IPython kernel - we should probably pass it as an environment variable which any kernel can use. [1] https://github.com/ipython/ipython/blob/master/IPython/kernel/launcher.py#L186 [2] https://github.com/ipython/ipython/blob/master/IPython/kernel/zmq/kernelapp.py#L164 Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/ea091150/attachment.html> From doug.blank at gmail.com Mon May 12 14:00:31 2014 From: doug.blank at gmail.com (Doug Blank) Date: Mon, 12 May 2014 14:00:31 -0400 Subject: [IPython-dev] Interrupting external kernel on Windows In-Reply-To: <CAOvn4qiGiWueKEzoOE+1ynEhAuUEL6mv0OOWmrUZeSTi0feBEQ@mail.gmail.com> References: <CAAusYCjxdwWz3QzAMt4UiS10Z-e6x=_KiPi+xwrdsw=4MA_1yg@mail.gmail.com> <CAOvn4qiGiWueKEzoOE+1ynEhAuUEL6mv0OOWmrUZeSTi0feBEQ@mail.gmail.com> Message-ID: <CAAusYCiprpJaJ86a4Tuu3s5xYrVDAdUmDXs8rO0+tcRK19A4VQ@mail.gmail.com> On Mon, May 12, 2014 at 1:49 PM, Thomas Kluyver <takowl at gmail.com> wrote: > On 12 May 2014 05:58, Doug Blank <doug.blank at gmail.com> wrote: > >> Attempting to interrupt an executing command on a third-party kernel on >> Windows. In fact, I went back to the simple_kernel [1], and I couldn't >> interrupt it either on Windows. Is there some special handling for >> interrupting a kernel on Windows? > > > Yes, it appears there is. On Windows, we make a 'Win32 event' [1], which > the kernel process listens for using some machinery in pyzmq [2]. It looks > like the event number that the child process needs to listen for is > currently passed to the kernel as a command line argument, which we can > only do when we know we're starting an IPython kernel - we should probably > pass it as an environment variable which any kernel can use. > Thanks for tracking that down! It would be good if the lack of a method of signaling 3rd-party Window's kernels could be considered a bug, so that a solution can be rolled into a IPython 2 update. Not being able to interrupt a kernel is a major issue. Started an item tracker here: https://github.com/ipython/ipython/issues/5840 -Doug > > [1] > https://github.com/ipython/ipython/blob/master/IPython/kernel/launcher.py#L186 > [2] > https://github.com/ipython/ipython/blob/master/IPython/kernel/zmq/kernelapp.py#L164 > > Thomas > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/6ebc2b99/attachment.html> From rmx555 at hotmail.com Mon May 12 15:15:22 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Mon, 12 May 2014 21:15:22 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <536FEB3E.3000501@ucsf.edu> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, , <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, , <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, , <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, , <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, , <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com>, <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl>, <536FEB3E.3000501@ucsf.edu> Message-ID: <DUB118-W51B61FE42EE0D7451BF0259D350@phx.gbl> Hi, Mark, thanks for the suggestions. I have a feeling IPython offers a very sustainable solution in terms of maintainability and python packages updates. I am not sure if IronPython supports all the extra Python libraries i need (e.g. pandas, zipline)?Moreover, yes I would like to have my analytics visualisations being interactive. > Date: Sun, 11 May 2014 14:27:26 -0700 > From: mark.voorhies at ucsf.edu > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > On 05/10/2014 11:51 PM, Roman Max. wrote: > > Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. > > would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. > > Will the presented notebook result be interactive, or will all user interaction be via your .NET interface? > > If the latter, is there any disadvantage to just executing numpy/matplotlib/etc. code directly in a CPython or IronPython interpreter? > > --Mark > > > RM > > > > From: benjaminrk at gmail.com > > Date: Fri, 9 May 2014 13:43:07 -0700 > > To: ipython-dev at scipy.org > > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > > > On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > > > > > > > > > > > OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? > > > > > > > > Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn?t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. > > > > > > > > > > > > > > do you plan for such an enhancement (passing parameters via URL to notebooks)? > > > > > > No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. > > > > > > > > or which class would I need to modify to implement support for this? > > > > > > At least a few: > > > > the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. > > the KernelManager, which starts the kernel, which would need to be told about these parameters > > possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. > > > > Depending on how much javascript you customize, there are probably a few combinations of classes to modify. > > Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. > > -MinRK > > > > > > > > From: benjaminrk at gmail.com > > Date: Thu, 8 May 2014 16:03:15 -0700 > > To: ipython-dev at scipy.org > > > > > > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > > > > > > > > > On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > > > > > > > > > Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. > > > > > > > > > > > > No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. > > > > > > > > > > -MinRK > > > > From: benjaminrk at gmail.com > > > > > > > > > > Date: Thu, 8 May 2014 10:47:16 -0700 > > To: ipython-dev at scipy.org > > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? > > > > > > > > > > > > You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. > > > > > > > > > > > > > > -MinRK > > > > On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > > > > > > > > > > > > > > > > > > > > > is it possible to pass parameters to IPython notebook via URL? > > > > > > > > > > > > How to reference/use those parameters in a notebook? > > > > > > > > > > > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 > > > > > > > > > > > > > > > > > > > > > > Did not find an answer after searching around. Thanks! > > > > _______________________________________________ > > > > IPython-dev mailing list > > > > IPython-dev at scipy.org > > > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > > > > IPython-dev mailing list > > > > IPython-dev at scipy.org > > > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > > > > IPython-dev mailing list > > > > IPython-dev at scipy.org > > > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/322d41a5/attachment.html> From rmx555 at hotmail.com Mon May 12 15:17:36 2014 From: rmx555 at hotmail.com (Roman Max.) Date: Mon, 12 May 2014 21:17:36 +0200 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, , <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, , <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, , <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, , <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, , <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com>, <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl>, <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> Message-ID: <DUB118-W52D822210165482812B6359D350@phx.gbl> Hi, John, thanks for the suggestion, will have a look into the project. Although my use case assumes interaction the other way -- from .NET to Python. From: jgill at tokiomillennium.com To: ipython-dev at scipy.org Date: Mon, 12 May 2014 13:14:23 +0000 Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? If you are working with python and .NET you should take a look at pythonnet: https://github.com/pythonnet/pythonnet It allows you to work seamlessly with .NET objects from python. John From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Roman Max. Sent: Sunday, May 11, 2014 3:51 AM To: IPython developers list Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. RM From: benjaminrk at gmail.com Date: Fri, 9 May 2014 13:43:07 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn?t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. do you plan for such an enhancement (passing parameters via URL to notebooks)? No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. or which class would I need to modify to implement support for this? At least a few: the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. the KernelManager, which starts the kernel, which would need to be told about these parameters possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. Depending on how much javascript you customize, there are probably a few combinations of classes to modify. Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. -MinRK From: benjaminrk at gmail.com Date: Thu, 8 May 2014 16:03:15 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output. So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK From: benjaminrk at gmail.com Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster at tokiomillennium.com and then permanently delete the email and any attachments from your system. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses.****************************************** _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/519d58bc/attachment.html> From jgill at tokiomillennium.com Mon May 12 16:48:40 2014 From: jgill at tokiomillennium.com (John Gill) Date: Mon, 12 May 2014 20:48:40 +0000 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <DUB118-W52D822210165482812B6359D350@phx.gbl> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl>, , <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com>, , <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl>, , <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com>, , <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl>, , <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com>, <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl>, <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> <DUB118-W52D822210165482812B6359D350@phx.gbl> Message-ID: <CEA58BDE8F3913468BE4A3F1F32C370C2B06CE5D@TMREXMB01.tokiomillennium.com> You can also use pythonnet to embed python in .NET From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Roman Max. Sent: Monday, May 12, 2014 4:18 PM To: IPython developers list Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? Hi, John, thanks for the suggestion, will have a look into the project. Although my use case assumes interaction the other way -- from .NET to Python. ________________________________ From: jgill at tokiomillennium.com To: ipython-dev at scipy.org Date: Mon, 12 May 2014 13:14:23 +0000 Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? If you are working with python and .NET you should take a look at pythonnet: https://github.com/pythonnet/pythonnet It allows you to work seamlessly with .NET objects from python. John From: ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Roman Max. Sent: Sunday, May 11, 2014 3:51 AM To: IPython developers list Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome) component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this file would need to be passed to an IPython notebook for further processing. After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files. would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved. RM ________________________________ From: benjaminrk at gmail.com Date: Fri, 9 May 2014 13:43:07 -0700 To: ipython-dev at scipy.org Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded? Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded. But again, I wouldn't recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using # instead of ?, since it would really be client-side only information. do you plan for such an enhancement (passing parameters via URL to notebooks)? No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this. or which class would I need to modify to implement support for this? At least a few: * the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel. * the KernelManager, which starts the kernel, which would need to be told about these parameters * possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process. Depending on how much javascript you customize, there are probably a few combinations of classes to modify. Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server. -MinRK ________________________________ From: benjaminrk at gmail.com<mailto:benjaminrk at gmail.com> Date: Thu, 8 May 2014 16:03:15 -0700 To: ipython-dev at scipy.org<mailto:ipython-dev at scipy.org> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output. So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that. No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs. -MinRK ________________________________ From: benjaminrk at gmail.com<mailto:benjaminrk at gmail.com> Date: Thu, 8 May 2014 10:47:16 -0700 To: ipython-dev at scipy.org<mailto:ipython-dev at scipy.org> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel. Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server. -MinRK On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com<mailto:rmx555 at hotmail.com>> wrote: is it possible to pass parameters to IPython notebook via URL? How to reference/use those parameters in a notebook? e.g. http://xxxyyzz.org:8888/mynotebook.ipynb?d1=20140101&d2=20140401 Did not find an answer after searching around. Thanks! _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org<mailto:IPython-dev at scipy.org> http://mail.scipy.org/mailman/listinfo/ipython-dev This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster at tokiomillennium.com and then permanently delete the email and any attachments from your system. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses. ****************************************** _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster at tokiomillennium.com and then permanently delete the email and any attachments from your system. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses. ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140512/22fdd599/attachment.html> From clyde.fare at gmail.com Tue May 13 06:39:53 2014 From: clyde.fare at gmail.com (Clyde Fare) Date: Tue, 13 May 2014 11:39:53 +0100 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CEA58BDE8F3913468BE4A3F1F32C370C2B06CE5D@TMREXMB01.tokiomillennium.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl> <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> <DUB118-W52D822210165482812B6359D350@phx.gbl> <CEA58BDE8F3913468BE4A3F1F32C370C2B06CE5D@TMREXMB01.tokiomillennium.com> Message-ID: <CAA3Z2fPy4knv_AWKew80_0ny0Ms61ZfBfmmKdAGx+oUbH8C1UA@mail.gmail.com> "since python logic code will be in javascript files." You can leave the python as a .py file and load it as text before passing it to the kernel: $.get('/static/custom/my_file.py', function(python_code){ ... kernel.execute(python_code, callbacks) } Which can then be passed to the kernel. On 12 May 2014 21:48, John Gill <jgill at tokiomillennium.com> wrote: > You can also use pythonnet to embed python in .NET > > > > *From:* ipython-dev-bounces at scipy.org [mailto: > ipython-dev-bounces at scipy.org] *On Behalf Of *Roman Max. > *Sent:* Monday, May 12, 2014 4:18 PM > > *To:* IPython developers list > *Subject:* Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > > Hi, John, > > > > thanks for the suggestion, will have a look into the project. Although my > use case assumes interaction the other way -- from .NET to Python. > ------------------------------ > > From: jgill at tokiomillennium.com > To: ipython-dev at scipy.org > Date: Mon, 12 May 2014 13:14:23 +0000 > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > If you are working with python and .NET you should take a look at > pythonnet: > > > > https://github.com/pythonnet/pythonnet > > > > It allows you to work seamlessly with .NET objects from python. > > > > John > > > > *From:* ipython-dev-bounces at scipy.org [mailto: > ipython-dev-bounces at scipy.org] *On Behalf Of *Roman Max. > *Sent:* Sunday, May 11, 2014 3:51 AM > *To:* IPython developers list > *Subject:* Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > > Many thanks for following up on this thread. I would like to use IPython > notebook to perform and present some analytics in a .NET application. I've > got a CefSharp (chrome) component integrated and can display notebook's > output. Now trying to figure out how to pass parameters, so notebook > calculates some analytics per selected object. E.g. depending on a selected > object .NET prepares a CSV data input file, then the path of this file > would need to be passed to an IPython notebook for further processing. > > After looking at your Singlecell.py code I think I start to understand > where you are heading with giving hints with respect to JavaScript. > Essentially .NET app could prepare HTML/Javascrpit part each time a new > object is selected and pass it then over to IPython kernel for execution? > Porbably will work, just doesn't look so clean, since python logic code > will be in javascript files. > > > > would be still nice to have a way to communicate with the IPython only via > URL, as not always client side presentation part(Javascript) can be > involved. > > > > RM > > > ------------------------------ > > From: benjaminrk at gmail.com > Date: Fri, 9 May 2014 13:43:07 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: > > > > OK, thanks for clarifying it once again. Javascript API means user needs > to interact with the page once it's already loaded? > > > > Yes. Or you can add custom javascript to the page to take action based on > the parameters once the page is loaded. But again, I wouldn?t recommend > doing this, because it may conflict with server changes in the future. If > you go this route, I would suggest using # instead of ?, since it would > really be client-side only information. > > > > > > do you plan for such an enhancement (passing parameters via URL to > notebooks)? > > > > No. The HTML/Javascript context of the page and notebook server are > strongly decoupled from the Python environment of the Kernel. We have no > plan to change this. > > > > or which class would I need to modify to implement support for this? > > > > At least a few: > > - the NotebookHandler, which renders the notebook page, which will > receive the URL with parameters, but is not the URL that starts the kernel. > - the KernelManager, which starts the kernel, which would need to be > told about these parameters > - possibly the Kernel itself, for taking the actual actions you wish > these parameters to imply in the kernel process. > > Depending on how much javascript you customize, there are probably a few > combinations of classes to modify. > > Can we back up a bit, and ask what you want to accomplish by passing these > parameters? There may be a simpler solution than subclassing the entire > notebook server. > > -MinRK > > > ------------------------------ > > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 16:03:15 -0700 > > > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > > > > On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > Many thanks for the reply, I see. Indeed I am looking for a way to pass > parameters to the Python code on the kernel, e.g. .NET app calling out a > notebook with parameters and displaying output. > > So, essentially the notebook server doesn't support this sort of > interaction at the moment? I assume I could do it by cloning and modifying > .ipynb template file before each request, still hoping there is a better > way than that. > > > > No, the server definitely doesn't support URLs affecting the kernel. If > you want to execute code on the Kernel, you would do this via the > Javascript APIs. > > > > -MinRK > > > > > > > ------------------------------ > > From: benjaminrk at gmail.com > Date: Thu, 8 May 2014 10:47:16 -0700 > To: ipython-dev at scipy.org > Subject: Re: [IPython-dev] is it possible to pass parameters to IPython > notebook via URL? > > > > You can do this, but I wouldn't recommend it. The parameters will only be > available to the HTML/JS in the notebook page, and not the Python code on > the kernel. Plus, there is a chance that it would conflict with any future > use of url parameters by the notebook server. > > > > -MinRK > > > > On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: > > is it possible to pass parameters to IPython notebook via URL? > > How to reference/use those parameters in a notebook? > > e.g. http://xxxyyzz.org:8888/mynotebook.ipynb*?d1=20140101&d2=20140401* > > > > Did not find an answer after searching around. Thanks! > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > This communication and any attachments contain information which is > confidential and may also be legally privileged. It is for the exclusive > use of the intended recipient(s). If you are not the intended recipient(s) > please note that any form of disclosure, distribution, copying, printing or > use of this communication or the information in it or in any attachments is > strictly prohibited and may be unlawful. If you have received this > communication in error, please return it with the title "received in error" > to postmaster at tokiomillennium.com and then permanently delete the email > and any attachments from your system. > > > > E-mail communications cannot be guaranteed to be secure or error free, as > information could be intercepted, corrupted, amended, lost, destroyed, > arrive late or incomplete, or contain viruses. It is the recipient's > responsibility to ensure that e-mail transmissions and any attachments are > virus free. We do not accept liability for any damages or other > consequences caused by information that is intercepted, corrupted, amended, > lost, destroyed, arrives late or incomplete or contains viruses. > > ****************************************** > > > _______________________________________________ IPython-dev mailing list > IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev > > This communication and any attachments contain information which is > confidential and may also be legally privileged. It is for the exclusive > use of the intended recipient(s). If you are not the intended recipient(s) > please note that any form of disclosure, distribution, copying, printing or > use of this communication or the information in it or in any attachments is > strictly prohibited and may be unlawful. If you have received this > communication in error, please return it with the title "received in error" > to postmaster at tokiomillennium.com and then permanently delete the email > and any attachments from your system. > > > > E-mail communications cannot be guaranteed to be secure or error free, as > information could be intercepted, corrupted, amended, lost, destroyed, > arrive late or incomplete, or contain viruses. It is the recipient's > responsibility to ensure that e-mail transmissions and any attachments are > virus free. We do not accept liability for any damages or other > consequences caused by information that is intercepted, corrupted, amended, > lost, destroyed, arrives late or incomplete or contains viruses. > > ****************************************** > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140513/dc84fbbf/attachment.html> From wes.turner at gmail.com Tue May 13 14:58:49 2014 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 13 May 2014 13:58:49 -0500 Subject: [IPython-dev] is it possible to pass parameters to IPython notebook via URL? In-Reply-To: <CAA3Z2fPy4knv_AWKew80_0ny0Ms61ZfBfmmKdAGx+oUbH8C1UA@mail.gmail.com> References: <DUB118-W3205E045C44214AC62D9AB9D490@phx.gbl> <CAHNn8BVCYmV+R3VadLLJSWn9WY2AkCTW6Ng4z5uMCF3fGn1DVQ@mail.gmail.com> <DUB118-W5CBC12D926DB4EFD9317E9D490@phx.gbl> <CAHNn8BV4gBFJLwOwmLn05Zuy3A1EgpQyWr=EtHRrUkMfZW4m0Q@mail.gmail.com> <DUB118-W41042BDF9E5B9DDCC218B19D480@phx.gbl> <CAHNn8BUn3zKYvNDx4JDPi9T+a0BRsOzzwaRBv7gS0U+iXizJ8Q@mail.gmail.com> <DUB118-W279CB1E36B991E8F184D489D4A0@phx.gbl> <CEA58BDE8F3913468BE4A3F1F32C370C2B06CA89@TMREXMB01.tokiomillennium.com> <DUB118-W52D822210165482812B6359D350@phx.gbl> <CEA58BDE8F3913468BE4A3F1F32C370C2B06CE5D@TMREXMB01.tokiomillennium.com> <CAA3Z2fPy4knv_AWKew80_0ny0Ms61ZfBfmmKdAGx+oUbH8C1UA@mail.gmail.com> Message-ID: <CACfEFw803WXnq3zeQ8+0Wfs1NNW8KiTm6aX_vG=coyeo58MJjg@mail.gmail.com> You could parse JSON from a URL parameter: #parameter={'one':'two','three':'four'} -- Wes Turner On Tue, May 13, 2014 at 5:39 AM, Clyde Fare <clyde.fare at gmail.com> wrote: > "since python logic code will be in javascript files." > > You can leave the python as a .py file and load it as text before passing > it to the kernel: > > $.get('/static/custom/my_file.py', function(python_code){ > ... > kernel.execute(python_code, callbacks) > } > > > Which can then be passed to the kernel. > > > On 12 May 2014 21:48, John Gill <jgill at tokiomillennium.com> wrote: > >> You can also use pythonnet to embed python in .NET >> >> >> >> *From:* ipython-dev-bounces at scipy.org [mailto: >> ipython-dev-bounces at scipy.org] *On Behalf Of *Roman Max. >> *Sent:* Monday, May 12, 2014 4:18 PM >> >> *To:* IPython developers list >> *Subject:* Re: [IPython-dev] is it possible to pass parameters to >> IPython notebook via URL? >> >> >> >> Hi, John, >> >> >> >> thanks for the suggestion, will have a look into the project. Although my >> use case assumes interaction the other way -- from .NET to Python. >> ------------------------------ >> >> From: jgill at tokiomillennium.com >> To: ipython-dev at scipy.org >> Date: Mon, 12 May 2014 13:14:23 +0000 >> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython >> notebook via URL? >> >> If you are working with python and .NET you should take a look at >> pythonnet: >> >> >> >> https://github.com/pythonnet/pythonnet >> >> >> >> It allows you to work seamlessly with .NET objects from python. >> >> >> >> John >> >> >> >> *From:* ipython-dev-bounces at scipy.org [mailto: >> ipython-dev-bounces at scipy.org] *On Behalf Of *Roman Max. >> *Sent:* Sunday, May 11, 2014 3:51 AM >> *To:* IPython developers list >> *Subject:* Re: [IPython-dev] is it possible to pass parameters to >> IPython notebook via URL? >> >> >> >> Many thanks for following up on this thread. I would like to use IPython >> notebook to perform and present some analytics in a .NET application. I've >> got a CefSharp (chrome) component integrated and can display notebook's >> output. Now trying to figure out how to pass parameters, so notebook >> calculates some analytics per selected object. E.g. depending on a selected >> object .NET prepares a CSV data input file, then the path of this file >> would need to be passed to an IPython notebook for further processing. >> >> After looking at your Singlecell.py code I think I start to understand >> where you are heading with giving hints with respect to JavaScript. >> Essentially .NET app could prepare HTML/Javascrpit part each time a new >> object is selected and pass it then over to IPython kernel for execution? >> Porbably will work, just doesn't look so clean, since python logic code >> will be in javascript files. >> >> >> >> would be still nice to have a way to communicate with the IPython only >> via URL, as not always client side presentation part(Javascript) can be >> involved. >> >> >> >> RM >> >> >> ------------------------------ >> >> From: benjaminrk at gmail.com >> Date: Fri, 9 May 2014 13:43:07 -0700 >> To: ipython-dev at scipy.org >> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython >> notebook via URL? >> >> On Fri, May 9, 2014 at 1:25 PM, Roman Max. <rmx555 at hotmail.com> wrote: >> >> >> >> OK, thanks for clarifying it once again. Javascript API means user needs >> to interact with the page once it's already loaded? >> >> >> >> Yes. Or you can add custom javascript to the page to take action based on >> the parameters once the page is loaded. But again, I wouldn?t recommend >> doing this, because it may conflict with server changes in the future. If >> you go this route, I would suggest using # instead of ?, since it would >> really be client-side only information. >> >> >> >> >> >> do you plan for such an enhancement (passing parameters via URL to >> notebooks)? >> >> >> >> No. The HTML/Javascript context of the page and notebook server are >> strongly decoupled from the Python environment of the Kernel. We have no >> plan to change this. >> >> >> >> or which class would I need to modify to implement support for this? >> >> >> >> At least a few: >> >> - the NotebookHandler, which renders the notebook page, which will >> receive the URL with parameters, but is not the URL that starts the kernel. >> - the KernelManager, which starts the kernel, which would need to be >> told about these parameters >> - possibly the Kernel itself, for taking the actual actions you wish >> these parameters to imply in the kernel process. >> >> Depending on how much javascript you customize, there are probably a few >> combinations of classes to modify. >> >> Can we back up a bit, and ask what you want to accomplish by passing >> these parameters? There may be a simpler solution than subclassing the >> entire notebook server. >> >> -MinRK >> >> >> ------------------------------ >> >> From: benjaminrk at gmail.com >> Date: Thu, 8 May 2014 16:03:15 -0700 >> >> >> To: ipython-dev at scipy.org >> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython >> notebook via URL? >> >> >> >> >> >> On Thu, May 8, 2014 at 11:51 AM, Roman Max. <rmx555 at hotmail.com> wrote: >> >> Many thanks for the reply, I see. Indeed I am looking for a way to pass >> parameters to the Python code on the kernel, e.g. .NET app calling out a >> notebook with parameters and displaying output. >> >> So, essentially the notebook server doesn't support this sort of >> interaction at the moment? I assume I could do it by cloning and modifying >> .ipynb template file before each request, still hoping there is a better >> way than that. >> >> >> >> No, the server definitely doesn't support URLs affecting the kernel. If >> you want to execute code on the Kernel, you would do this via the >> Javascript APIs. >> >> >> >> -MinRK >> >> >> >> >> >> >> ------------------------------ >> >> From: benjaminrk at gmail.com >> Date: Thu, 8 May 2014 10:47:16 -0700 >> To: ipython-dev at scipy.org >> Subject: Re: [IPython-dev] is it possible to pass parameters to IPython >> notebook via URL? >> >> >> >> You can do this, but I wouldn't recommend it. The parameters will only be >> available to the HTML/JS in the notebook page, and not the Python code on >> the kernel. Plus, there is a chance that it would conflict with any future >> use of url parameters by the notebook server. >> >> >> >> -MinRK >> >> >> >> On Thu, May 8, 2014 at 10:11 AM, Roman Max. <rmx555 at hotmail.com> wrote: >> >> is it possible to pass parameters to IPython notebook via URL? >> >> How to reference/use those parameters in a notebook? >> >> e.g. http://xxxyyzz.org:8888/mynotebook.ipynb*?d1=20140101&d2=20140401* >> >> >> >> Did not find an answer after searching around. Thanks! >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> _______________________________________________ IPython-dev mailing list >> IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> _______________________________________________ IPython-dev mailing list >> IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> _______________________________________________ IPython-dev mailing list >> IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> This communication and any attachments contain information which is >> confidential and may also be legally privileged. It is for the exclusive >> use of the intended recipient(s). If you are not the intended recipient(s) >> please note that any form of disclosure, distribution, copying, printing or >> use of this communication or the information in it or in any attachments is >> strictly prohibited and may be unlawful. If you have received this >> communication in error, please return it with the title "received in error" >> to postmaster at tokiomillennium.com and then permanently delete the email >> and any attachments from your system. >> >> >> >> E-mail communications cannot be guaranteed to be secure or error free, as >> information could be intercepted, corrupted, amended, lost, destroyed, >> arrive late or incomplete, or contain viruses. It is the recipient's >> responsibility to ensure that e-mail transmissions and any attachments are >> virus free. We do not accept liability for any damages or other >> consequences caused by information that is intercepted, corrupted, amended, >> lost, destroyed, arrives late or incomplete or contains viruses. >> >> ****************************************** >> >> >> _______________________________________________ IPython-dev mailing list >> IPython-dev at scipy.org http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> This communication and any attachments contain information which is >> confidential and may also be legally privileged. It is for the exclusive >> use of the intended recipient(s). If you are not the intended recipient(s) >> please note that any form of disclosure, distribution, copying, printing or >> use of this communication or the information in it or in any attachments is >> strictly prohibited and may be unlawful. If you have received this >> communication in error, please return it with the title "received in error" >> to postmaster at tokiomillennium.com and then permanently delete the email >> and any attachments from your system. >> >> >> >> E-mail communications cannot be guaranteed to be secure or error free, as >> information could be intercepted, corrupted, amended, lost, destroyed, >> arrive late or incomplete, or contain viruses. It is the recipient's >> responsibility to ensure that e-mail transmissions and any attachments are >> virus free. We do not accept liability for any damages or other >> consequences caused by information that is intercepted, corrupted, amended, >> lost, destroyed, arrives late or incomplete or contains viruses. >> >> ****************************************** >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140513/dcbde24c/attachment.html> From martin.fitzpatrick at gmail.com Wed May 14 17:41:49 2014 From: martin.fitzpatrick at gmail.com (Martin Fitzpatrick) Date: Wed, 14 May 2014 22:41:49 +0100 Subject: [IPython-dev] QtIPy: The IPython Notebook-based data automator Message-ID: <CAFx1Zjn6nOsP1WLax-8KigJ_egnsy8sbkMBBMWnOZOhFi6HKvQ@mail.gmail.com> Hello all I've released a new tool today that I think may be of general interest to the list. "QtIPy" is a small automaton utility that allows trigger-led running of IPython notebooks (using the excellent runipy: https://github.com/paulgb/runipy). You can define multiple "automatons" each of which can run multiple notebooks in sequence. Automatons can be triggered by file/directory modification, timers or manually. So, for example you can watch a folder for new files and automatically run an IPython notebook on the contents when updated (it can wait for >1 file too e.g. "trigger when all 5 files are changed"). Session variables are passed into the running notebook including watched folders, changed files, etc. so the notebook can act on them. The re-processed notebook is output to the destination folder and the notebook can also write figures or other results to the same location. Lists of automatons can be saved and reloaded in future. QtIPy is available for download from PyPi via `pip install QtIPy` then QtIPy to run. Requires PyQt5. Compatible with Python2.7 and 3.4. GPLv3 source available here: https://github.com/mfitzp/qtipy Thanks for reading Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140514/9c3f4d70/attachment.html> From takowl at gmail.com Wed May 14 18:23:37 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Wed, 14 May 2014 15:23:37 -0700 Subject: [IPython-dev] QtIPy: The IPython Notebook-based data automator In-Reply-To: <CAFx1Zjn6nOsP1WLax-8KigJ_egnsy8sbkMBBMWnOZOhFi6HKvQ@mail.gmail.com> References: <CAFx1Zjn6nOsP1WLax-8KigJ_egnsy8sbkMBBMWnOZOhFi6HKvQ@mail.gmail.com> Message-ID: <CAOvn4qh_1U4Sn7iOow37HrkVFHSd-Qyq2F6CP9vY7KX8mPfWrw@mail.gmail.com> Hi Martin, On 14 May 2014 14:41, Martin Fitzpatrick <martin.fitzpatrick at gmail.com>wrote: > I've released a new tool today that I think may be of general interest to > the list. > > "QtIPy" is a small automaton utility that allows trigger-led running of > IPython notebooks (using the excellent runipy: > https://github.com/paulgb/runipy). > > You can define multiple "automatons" each of which can run multiple > notebooks in sequence. Automatons can be triggered by file/directory > modification, timers or manually. > Thanks for letting us know about this, it looks really interesting. Can you tell us a bit about the problem you wrote it to solve? I imagine it's something like preparing reports from data that's regularly updated, but it would be good to hear some more detail. Please do add it to the list of projects using IPython: https://github.com/ipython/ipython/wiki/Projects-using-IPython Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140514/1d131c55/attachment.html> From simoncropper at fossworkflowguides.com Thu May 15 01:55:23 2014 From: simoncropper at fossworkflowguides.com (Simon Cropper) Date: Thu, 15 May 2014 15:55:23 +1000 Subject: [IPython-dev] Visual representation of SQL extracted data Message-ID: <537456CB.4030604@fossworkflowguides.com> Hi, New to iPython and the standard set of tools bound to the server (e.g. Pandas, etc). What I was wondering is there a library, or a notebook showing the use of the standard libraries bound to iPython, that allows tabular data to be formatted. Most examples I can find are essentially text dumps to the notebook. In contrast, graphs and images have great formatting ability. Why? I am looking at using iPython to data wrangle or munge large biological datasets (plant names, biological and ecological attributes, locational data). The notebook feature will allow others to visualize and follow steps used to collate, convert, merge, summarize and analyze this data. Is this doable, or am I trying to use the notebook in the wrong way? Any feedback would be appreciated. -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides ------------------------------------------------------------ Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Python http://www.fossworkflowguides.com/scripting From martin.fitzpatrick at gmail.com Thu May 15 07:11:30 2014 From: martin.fitzpatrick at gmail.com (Martin Fitzpatrick) Date: Thu, 15 May 2014 12:11:30 +0100 Subject: [IPython-dev] QtIPy: The IPython Notebook-based data automator Message-ID: <CAFx1ZjmySnxZA35Q-Sm0OAiDDsqMk8LjLurPDBBpsF1QHghAyQ@mail.gmail.com> Thanks Thomas On 14 May 2014 17:23, Thomas Kluyver <takowl at gmail.com>wrote: > Thanks for letting us know about this, it looks really interesting. Can you > tell us a bit about the problem you wrote it to solve? I imagine it's > something like preparing reports from data that's regularly updated, but it > would be good to hear some more detail. Scientific data analysis typically includes a lot of routine steps. For example in metabolomics (what I do) from the raw NMR data you typically phase correct, baseline correct, normalise, bin, and then do some kind of multivariate analysis (PCA or PLS-DA) to see if you've got anything of interest. Most of these steps can be automated as a 'good enough, first look' and so I wanted a way to quickly apply these steps together while getting a record of what was done - preferably by doing nothing more than drag-dropping a file into a specific folder. Doing it in an IPython notebook has the added benefit of inline-documentation of everything - which is incredibly useful when sharing processing approaches. I can now write a processing script, give it to a non-expert to run against data, and they get the processed outputs together with a nicely formatted report of how it happened. I think that's a great educational/transparency tool. I wrote it as an automator, but some additional features (per-automaton variables and configuration, including a manual-run config panel) are planned. > Please do add it to the list of projects using IPython: > https://github.com/ipython/ipython/wiki/Projects-using-IPython Done! Thanks again. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140515/0b3f2cbc/attachment.html> From mark.voorhies at ucsf.edu Thu May 15 21:11:44 2014 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Thu, 15 May 2014 18:11:44 -0700 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <537456CB.4030604@fossworkflowguides.com> References: <537456CB.4030604@fossworkflowguides.com> Message-ID: <537565D0.7070600@ucsf.edu> On 05/14/2014 10:55 PM, Simon Cropper wrote: > Hi, > > New to iPython and the standard set of tools bound to the server (e.g. > Pandas, etc). > > What I was wondering is there a library, or a notebook showing the use > of the standard libraries bound to iPython, that allows tabular data to > be formatted. > > Most examples I can find are essentially text dumps to the notebook. In > contrast, graphs and images have great formatting ability. > > Why? I am looking at using iPython to data wrangle or munge large > biological datasets (plant names, biological and ecological attributes, > locational data). The notebook feature will allow others to visualize > and follow steps used to collate, convert, merge, summarize and analyze > this data. > > Is this doable, or am I trying to use the notebook in the wrong way? > > Any feedback would be appreciated. > I think Pandas is good at this, but I haven't played with it. A general strategy is to use HTML from IPython.core.display to render pretty HTML tables. Here's an example for tabular display of protein sequence alignments (with a horizontal scrollbar and green/red coloring of gaps/mutations): def tabformat(seqs, names = None): """Return the given sequence alignment as a pretty HTML table. seqs = list of strings with a common length (one letter amino-acid codes or "-" for gap) names = sequence names as list of strings, same length as seqs """ if(names is None): names = [str(i) for i in xrange(len(seqs))] retval = '<DIV style="font-family: monospace; font-size: small">\n' retval += '<DIV><TABLE style="overflow: auto; position: relative; float: left; width: 8em">\n' for n in names: retval += "<TR><TD>%s</TD></TR>\n" % n retval += "</TABLE></DIV>\n" retval += '<DIV style="overflow: auto; width: 90em; position: relative; float: left"><TABLE>\n' for i in seqs: retval += "<TR>\n" for (j,k) in zip(i,seqs[0]): if(j != k): if(j == "-"): c = 'style="background-color: green"' else: c = 'style="background-color: red"' else: c = "" retval += '<TD %s>%s</TD>' % (c,j) retval += "</TR>\n" retval += "</TABLE></DIV>\n" retval += "</DIV>\n" return retval from IPython.core.display import HTML HTML(data = tabformat([i*100 for i in ("SPAM", "SPAM", "SCAM", "SPAM", "SPA-", "SPAM", "SPAN")])) --Mark From takowl at gmail.com Thu May 15 21:30:55 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Thu, 15 May 2014 18:30:55 -0700 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <537565D0.7070600@ucsf.edu> References: <537456CB.4030604@fossworkflowguides.com> <537565D0.7070600@ucsf.edu> Message-ID: <CAOvn4qirrfDoJ02T3ndZX17Y_9tD06aJ_UWL5HRp2oqUDDCLwA@mail.gmail.com> There's also a couple of tools to build tables, with unfortunately almost identical names: - IPyTables (my code) - https://gist.github.com/takluyver/5098835 (I mean to rename this and make it a proper repo at some point) - ipy_table - https://github.com/epmoyer/ipy_table Thomas On 15 May 2014 18:11, Mark Voorhies <mark.voorhies at ucsf.edu> wrote: > On 05/14/2014 10:55 PM, Simon Cropper wrote: > > Hi, > > > > New to iPython and the standard set of tools bound to the server (e.g. > > Pandas, etc). > > > > What I was wondering is there a library, or a notebook showing the use > > of the standard libraries bound to iPython, that allows tabular data to > > be formatted. > > > > Most examples I can find are essentially text dumps to the notebook. In > > contrast, graphs and images have great formatting ability. > > > > Why? I am looking at using iPython to data wrangle or munge large > > biological datasets (plant names, biological and ecological attributes, > > locational data). The notebook feature will allow others to visualize > > and follow steps used to collate, convert, merge, summarize and analyze > > this data. > > > > Is this doable, or am I trying to use the notebook in the wrong way? > > > > Any feedback would be appreciated. > > > > I think Pandas is good at this, but I haven't played with it. > > A general strategy is to use HTML from IPython.core.display to render > pretty HTML tables. > > Here's an example for tabular display of protein sequence alignments (with > a horizontal > scrollbar and green/red coloring of gaps/mutations): > > def tabformat(seqs, names = None): > """Return the given sequence alignment as a pretty HTML table. > seqs = list of strings with a common length (one letter amino-acid > codes or "-" for gap) > names = sequence names as list of strings, same length as seqs > """ > if(names is None): > names = [str(i) for i in xrange(len(seqs))] > retval = '<DIV style="font-family: monospace; font-size: small">\n' > retval += '<DIV><TABLE style="overflow: auto; position: relative; > float: left; width: 8em">\n' > for n in names: > retval += "<TR><TD>%s</TD></TR>\n" % n > retval += "</TABLE></DIV>\n" > retval += '<DIV style="overflow: auto; width: 90em; position: > relative; float: left"><TABLE>\n' > for i in seqs: > retval += "<TR>\n" > for (j,k) in zip(i,seqs[0]): > if(j != k): > if(j == "-"): > c = 'style="background-color: green"' > else: > c = 'style="background-color: red"' > else: > c = "" > retval += '<TD %s>%s</TD>' % (c,j) > retval += "</TR>\n" > retval += "</TABLE></DIV>\n" > retval += "</DIV>\n" > return retval > > from IPython.core.display import HTML > HTML(data = tabformat([i*100 for i in ("SPAM", "SPAM", "SCAM", "SPAM", > "SPA-", "SPAM", "SPAN")])) > > --Mark > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140515/4b15d799/attachment.html> From simoncropper at fossworkflowguides.com Thu May 15 21:39:03 2014 From: simoncropper at fossworkflowguides.com (Simon Cropper) Date: Fri, 16 May 2014 11:39:03 +1000 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <537565D0.7070600@ucsf.edu> References: <537456CB.4030604@fossworkflowguides.com> <537565D0.7070600@ucsf.edu> Message-ID: <53756C37.2050809@fossworkflowguides.com> On 16/05/14 11:11, Mark Voorhies wrote: > On 05/14/2014 10:55 PM, Simon Cropper wrote: >> Hi, >> >> New to iPython and the standard set of tools bound to the server (e.g. >> Pandas, etc). >> >> What I was wondering is there a library, or a notebook showing the use >> of the standard libraries bound to iPython, that allows tabular data to >> be formatted. >> >> Most examples I can find are essentially text dumps to the notebook. In >> contrast, graphs and images have great formatting ability. >> >> Why? I am looking at using iPython to data wrangle or munge large >> biological datasets (plant names, biological and ecological attributes, >> locational data). The notebook feature will allow others to visualize >> and follow steps used to collate, convert, merge, summarize and analyze >> this data. >> >> Is this doable, or am I trying to use the notebook in the wrong way? >> >> Any feedback would be appreciated. >> > > I think Pandas is good at this, but I haven't played with it. > > A general strategy is to use HTML from IPython.core.display to render pretty HTML tables. > > Here's an example for tabular display of protein sequence alignments (with a horizontal > scrollbar and green/red coloring of gaps/mutations): > > def tabformat(seqs, names = None): > """Return the given sequence alignment as a pretty HTML table. > seqs = list of strings with a common length (one letter amino-acid codes or "-" for gap) > names = sequence names as list of strings, same length as seqs > """ > if(names is None): > names = [str(i) for i in xrange(len(seqs))] > retval = '<DIV style="font-family: monospace; font-size: small">\n' > retval += '<DIV><TABLE style="overflow: auto; position: relative; float: left; width: 8em">\n' > for n in names: > retval += "<TR><TD>%s</TD></TR>\n" % n > retval += "</TABLE></DIV>\n" > retval += '<DIV style="overflow: auto; width: 90em; position: relative; float: left"><TABLE>\n' > for i in seqs: > retval += "<TR>\n" > for (j,k) in zip(i,seqs[0]): > if(j != k): > if(j == "-"): > c = 'style="background-color: green"' > else: > c = 'style="background-color: red"' > else: > c = "" > retval += '<TD %s>%s</TD>' % (c,j) > retval += "</TR>\n" > retval += "</TABLE></DIV>\n" > retval += "</DIV>\n" > return retval > > from IPython.core.display import HTML > HTML(data = tabformat([i*100 for i in ("SPAM", "SPAM", "SCAM", "SPAM", "SPA-", "SPAM", "SPAN")])) > > --Mark > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > Thanks Mark, I am looking at Pandas at the moment. I tried your script and it works really well. To date I have generally coded my own HTML code like yours, saved it in a file then opened it in a browser. The problem was that the data was static -- that is you could not poke the browser to refresh once you reran the script (at least in Linux; in Windows you would use automation to open an instance then use the refresh method using VBA or something similar but I am looking for cross-platform solutions). What I really like about your example and the iPython Notebook is that I can change the sequence and have the HTML table dynamically update. This allows for errors to be detected quite quickly. Just a follow on question. I note the HTML table rendered within a 'frame'. That is, the horizontal scroll bar appeared. Is this object/frame able to be changed or controlled? -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides ------------------------------------------------------------ Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Python http://www.fossworkflowguides.com/scripting From simoncropper at fossworkflowguides.com Thu May 15 21:46:43 2014 From: simoncropper at fossworkflowguides.com (Simon Cropper) Date: Fri, 16 May 2014 11:46:43 +1000 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <CAOvn4qirrfDoJ02T3ndZX17Y_9tD06aJ_UWL5HRp2oqUDDCLwA@mail.gmail.com> References: <537456CB.4030604@fossworkflowguides.com> <537565D0.7070600@ucsf.edu> <CAOvn4qirrfDoJ02T3ndZX17Y_9tD06aJ_UWL5HRp2oqUDDCLwA@mail.gmail.com> Message-ID: <53756E03.6020504@fossworkflowguides.com> On 16/05/14 11:30, Thomas Kluyver wrote: > There's also a couple of tools to build tables, with unfortunately > almost identical names: > > - IPyTables (my code) - https://gist.github.com/takluyver/5098835 (I > mean to rename this and make it a proper repo at some point) > - ipy_table - https://github.com/epmoyer/ipy_table > > Thomas > > > On 15 May 2014 18:11, Mark Voorhies <mark.voorhies at ucsf.edu > <mailto:mark.voorhies at ucsf.edu>> wrote: > > On 05/14/2014 10:55 PM, Simon Cropper wrote: > > Hi, > > > > New to iPython and the standard set of tools bound to the server > (e.g. > > Pandas, etc). > > > > What I was wondering is there a library, or a notebook showing > the use > > of the standard libraries bound to iPython, that allows tabular > data to > > be formatted. > > > > Most examples I can find are essentially text dumps to the > notebook. In > > contrast, graphs and images have great formatting ability. > > > > Why? I am looking at using iPython to data wrangle or munge large > > biological datasets (plant names, biological and ecological > attributes, > > locational data). The notebook feature will allow others to visualize > > and follow steps used to collate, convert, merge, summarize and > analyze > > this data. > > > > Is this doable, or am I trying to use the notebook in the wrong way? > > > > Any feedback would be appreciated. > > > > I think Pandas is good at this, but I haven't played with it. > > A general strategy is to use HTML from IPython.core.display to > render pretty HTML tables. > > Here's an example for tabular display of protein sequence alignments > (with a horizontal > scrollbar and green/red coloring of gaps/mutations): > > def tabformat(seqs, names = None): > """Return the given sequence alignment as a pretty HTML table. > seqs = list of strings with a common length (one letter > amino-acid codes or "-" for gap) > names = sequence names as list of strings, same length as seqs > """ > if(names is None): > names = [str(i) for i in xrange(len(seqs))] > retval = '<DIV style="font-family: monospace; font-size: > small">\n' > retval += '<DIV><TABLE style="overflow: auto; position: > relative; float: left; width: 8em">\n' > for n in names: > retval += "<TR><TD>%s</TD></TR>\n" % n > retval += "</TABLE></DIV>\n" > retval += '<DIV style="overflow: auto; width: 90em; position: > relative; float: left"><TABLE>\n' > for i in seqs: > retval += "<TR>\n" > for (j,k) in zip(i,seqs[0]): > if(j != k): > if(j == "-"): > c = 'style="background-color: green"' > else: > c = 'style="background-color: red"' > else: > c = "" > retval += '<TD %s>%s</TD>' % (c,j) > retval += "</TR>\n" > retval += "</TABLE></DIV>\n" > retval += "</DIV>\n" > return retval > > from IPython.core.display import HTML > HTML(data = tabformat([i*100 for i in ("SPAM", "SPAM", "SCAM", > "SPAM", "SPA-", "SPAM", "SPAN")])) > > --Mark > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org <mailto:IPython-dev at scipy.org> > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > Thanks Thomas, How do you use your scripts? Can you provide an example. I looked at your GIST but could not find an explanation of how to use it. -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides ------------------------------------------------------------ Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Python http://www.fossworkflowguides.com/scripting From takowl at gmail.com Thu May 15 21:54:00 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Thu, 15 May 2014 18:54:00 -0700 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <53756E03.6020504@fossworkflowguides.com> References: <537456CB.4030604@fossworkflowguides.com> <537565D0.7070600@ucsf.edu> <CAOvn4qirrfDoJ02T3ndZX17Y_9tD06aJ_UWL5HRp2oqUDDCLwA@mail.gmail.com> <53756E03.6020504@fossworkflowguides.com> Message-ID: <CAOvn4qgXvG+J+=bFjP2Rpdcia-z6yWY2+BBUTR1JaxvW1pcZFA@mail.gmail.com> On 15 May 2014 18:46, Simon Cropper <simoncropper at fossworkflowguides.com>wrote: > How do you use your scripts? Can you provide an example. I looked at > your GIST but could not find an explanation of how to use it. > To create a table in one shot: Table(TableHeaderRow('Planet', 'Orbit in Earth days'), ['Mercury', 88], ['Venus', 584]) To build it up row-by-row: t = Table(TableHeaderRow('Planet', 'Orbit in Earth days')) for planet in solar_system: t.append_row(planet.name, planet.orbit_time) To display it: t # At the end of a cell IPython.display.display(t) # Anywhere in the code Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140515/86cdf3af/attachment.html> From mark.voorhies at ucsf.edu Fri May 16 00:42:41 2014 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Thu, 15 May 2014 21:42:41 -0700 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <53756C37.2050809@fossworkflowguides.com> References: <537456CB.4030604@fossworkflowguides.com> <537565D0.7070600@ucsf.edu> <53756C37.2050809@fossworkflowguides.com> Message-ID: <53759741.7020302@ucsf.edu> On 05/15/2014 06:39 PM, Simon Cropper wrote: > Just a follow on question. I note the HTML table rendered within a > 'frame'. That is, the horizontal scroll bar appeared. Is this > object/frame able to be changed or controlled? The scroll bar is due to giving the table a CSS "overflow:auto" attribute: <TABLE style="overflow: auto; position: relative; float: left; width: 8em"> C.f. http://www.w3.org/TR/CSS21/visufx.html#overflow-clipping If you change the height/width/overflow attributes, you can vary the behavior. A List Apart (http://alistapart.com/) is a nice source of CSS hacks. --Mark From menyland at gmail.com Fri May 16 11:52:20 2014 From: menyland at gmail.com (Christopher) Date: Fri, 16 May 2014 11:52:20 -0400 Subject: [IPython-dev] Doing some dev Message-ID: <53763434.4030108@gmail.com> Hello, So I still use the IPython command line console a lot especially for debugging purposes. I utilize the Tracer class to set physical break points often but sometimes would like to do conditional breaks instead. Additionally then I have the clutter of the extra import for debugging purpose. So I tried calling the debugger from the command line in the same way you would call the regular Python debugger python -m IPython.core.debugger myscript.py no dice. So I clone the dev branch from git hub and started messing around. I managed to get something that works although it involves monkey patching the IPython Pdb class into the Python pdb module. However I get the desired result with my small test case. So then the question becomes if I want to propose that this be added to the IPython code what do I do? I looked around on the site and couldn't find anything solid so I decided to post here. Additionally keep up the good work. I haven't gotten to play with the notebooks yet my environment at work is fairly restrictive but I hope to soon. Chris Nyland From takowl at gmail.com Fri May 16 12:02:16 2014 From: takowl at gmail.com (Thomas Kluyver) Date: Fri, 16 May 2014 09:02:16 -0700 Subject: [IPython-dev] Doing some dev In-Reply-To: <53763434.4030108@gmail.com> References: <53763434.4030108@gmail.com> Message-ID: <CAOvn4qhvD8jyOdDD1idh5n4k3Ech=bQpBMPqgRN5_ungWhJqHA@mail.gmail.com> Hi Chris, On 16 May 2014 08:52, Christopher <menyland at gmail.com> wrote: > So then the question becomes if I want to propose that this be added to > the IPython code what do I do? I looked around on the site and couldn't > find anything solid so I decided to post here. > In most cases the best way to propose a change is to fork IPython on Github and make a pull request. https://github.com/ipython/ipython If you're not comfortable with git, you can send a patch file, and one of us will create a pull request for you. Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/da2c559b/attachment.html> From darcamo at gmail.com Fri May 16 13:26:02 2014 From: darcamo at gmail.com (darcamo at gmail.com) Date: Fri, 16 May 2014 14:26:02 -0300 Subject: [IPython-dev] Doing some dev In-Reply-To: <CAOvn4qhvD8jyOdDD1idh5n4k3Ech=bQpBMPqgRN5_ungWhJqHA@mail.gmail.com> References: <53763434.4030108@gmail.com> <CAOvn4qhvD8jyOdDD1idh5n4k3Ech=bQpBMPqgRN5_ungWhJqHA@mail.gmail.com> Message-ID: <CAGjSdXqo+=B2-qejH+z6WhMxu6pGezH5T4b7yDJzPUf+jedg6w@mail.gmail.com> A very good debugger for Python is pudb (https://pypi.python.org/pypi/pudb). You can start the debugger with just "pudb my-script.py" and when stopped at some point it allows you to run ipython to check the variables, test something, etc.. It can also use conditional breakpoints. -- Darlan Cavalcante Moreira 2014-05-16 13:02 GMT-03:00 Thomas Kluyver <takowl at gmail.com>: > Hi Chris, > > On 16 May 2014 08:52, Christopher <menyland at gmail.com> wrote: > >> So then the question becomes if I want to propose that this be added to >> the IPython code what do I do? I looked around on the site and couldn't >> find anything solid so I decided to post here. >> > > In most cases the best way to propose a change is to fork IPython on > Github and make a pull request. > https://github.com/ipython/ipython > > If you're not comfortable with git, you can send a patch file, and one of > us will create a pull request for you. > > Thanks, > Thomas > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/57b834e1/attachment.html> From tritemio at gmail.com Fri May 16 15:24:54 2014 From: tritemio at gmail.com (Antonino Ingargiola) Date: Fri, 16 May 2014 12:24:54 -0700 Subject: [IPython-dev] Distributing evaluated notebooks that require big-ish data Message-ID: <CANn2QUyCyi-bHdty+yr5jBy1Ea5sJXBys=TLDHOo7Dj01FPYGg@mail.gmail.com> Hi, I'm working on a software for single-molecule FRET analysis (FRETBursts)[1] that heavily relies on ipython notebook to run the analysis. I provide some evaluated notebooks serving as tutorials in a separate repository (FRETBursts_notebooks). The reference documentation (mostly installation instructions and API) is hosted on ReadTheDocs [3]. I have concerns on the viability of this approach since the notebooks repository can easily grow to hundreds of MB given the high number of images. Maintaining a second repository it is also and additional burden. Ideally I would like to generate the notebooks dynamically from unevaluated notebooks in the original source repository. However the data necessary to reproduce the analysis is ~150MB (hosted on figshare [4]), and I may add more datasets in the future. So I'm asking for suggestions. I like the simple concept of a notebook repository with links to nbviewer, but seems that the solution is not scalable. I don't think RTD can handle downloading and data processing that requires several minutes to execute on modern desktops. So, what's left? Anybody has a similar issue? Best, Antonio [1] FRETBursts: https://github.com/tritemio/FRETBursts [2] FRETBursts_notebooks: https://github.com/tritemio/FRETBursts_notebooks [3] FRETBursts documentation: http://fretbursts.readthedocs.org/index.html [4] FRETBursts datatsets: http://dx.doi.org/10.6084/m9.figshare.1019906 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/c07bcfdb/attachment.html> From fordas at uw.edu Fri May 16 16:01:33 2014 From: fordas at uw.edu (Alex Ford) Date: Fri, 16 May 2014 13:01:33 -0700 Subject: [IPython-dev] Doing some dev In-Reply-To: <CAGjSdXqo+=B2-qejH+z6WhMxu6pGezH5T4b7yDJzPUf+jedg6w@mail.gmail.com> References: <53763434.4030108@gmail.com> <CAOvn4qhvD8jyOdDD1idh5n4k3Ech=bQpBMPqgRN5_ungWhJqHA@mail.gmail.com> <CAGjSdXqo+=B2-qejH+z6WhMxu6pGezH5T4b7yDJzPUf+jedg6w@mail.gmail.com> Message-ID: <CAAijYXQDCDfAd4T51cETiSiDn0TJ6N1bqxAVPMtnmqfgE0_vNg@mail.gmail.com> The ipdb module (https://pypi.python.org/pypi/ipdb) handles this admirably. ----- Alex Ford Baker Group, Biomolecular Structure and Design University of Washington fordas at uw.edu 206.659.6559 On Fri, May 16, 2014 at 10:26 AM, darcamo at gmail.com <darcamo at gmail.com>wrote: > A very good debugger for Python is pudb (https://pypi.python.org/pypi/pudb > ). > You can start the debugger with just > "pudb my-script.py" > and when stopped at some point it allows you to run ipython to check the > variables, test something, etc.. > > It can also use conditional breakpoints. > > -- > Darlan Cavalcante Moreira > > > > 2014-05-16 13:02 GMT-03:00 Thomas Kluyver <takowl at gmail.com>: > >> Hi Chris, >> >> On 16 May 2014 08:52, Christopher <menyland at gmail.com> wrote: >> >>> So then the question becomes if I want to propose that this be added to >>> the IPython code what do I do? I looked around on the site and couldn't >>> find anything solid so I decided to post here. >>> >> >> In most cases the best way to propose a change is to fork IPython on >> Github and make a pull request. >> https://github.com/ipython/ipython >> >> If you're not comfortable with git, you can send a patch file, and one of >> us will create a pull request for you. >> >> Thanks, >> Thomas >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/f4e610bd/attachment.html> From vijay.desai at gmail.com Fri May 16 21:29:08 2014 From: vijay.desai at gmail.com (Vijay Desai) Date: Fri, 16 May 2014 21:29:08 -0400 Subject: [IPython-dev] Scrollbar issue in IPython 2.0 Message-ID: <CADHtFUUyxx+wjEsGKbh3nkLTbhjngtJtssX38tf5k6YOXezpkw@mail.gmail.com> Hi all, I am having a scrollbar issue in IPython notebook. Sometime when I am displaying a big pandas dataframe, the scrollbar is displayed but it does not move. Attached is a screenshot of my desktop. This occurs maybe 30% of the times. Has anyone else faced similar issue? Regards, Vijay -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-05-16 21:26:48.png Type: image/png Size: 150350 bytes Desc: not available URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/ced67620/attachment.png> From andrew.gibiansky at gmail.com Sat May 17 02:37:32 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Fri, 16 May 2014 23:37:32 -0700 Subject: [IPython-dev] Javascript Ordering Semantics Issue in Notebook with Widget Registration Message-ID: <CAF-LYK+VHSx5fCJ_WdzD+w+2-dBm6v69p-G9BWnngAumMBc3Yg@mail.gmail.com> Hey guys, I'm running into a little bit of a Javascript code execution issue, and am unsure whether I am doing something wrong in my architecture, or if perhaps IPython should somehow mitigate the bugs I'm getting. Basically, here's the setup: for IHaskell, extension authors who want to be able to display their data as widgets must create a way to register those widgets. The first time those widgets are created, they must also be registered in the JS on the notebook frontend. However, this is done in the same series of messages as the comm_open. So here's the crux: The way that the widgets are registered is by adding a <script> tag to the DOM. However, though the DOM is added, I *think* the comm_open message is parsed *before* the <script> in the DOM is executed. Note that this *only* happens in firefox. In Chrome, the <script> tag is added, the DOM is executed, and *then* the comm_open is processed. By the time comm_open is processed in Chrome (not in firefox), the <script> has been run so the widget is registered. In firefox, the comm_open is processed before the script tag was run, so the widget is unregistered. So here's my question: Would it be possible to *force* all DOM added as a result of message handling to be parsed and script tags in it to be executed before the next message is handled? Perhaps this could be done by using $(blah).load(...) on everything that is added to an output area? Or something? Anyway, I am confused, and not sure how to fix this, and whether or not it's an issue with my code. The one requirement is that when the widget object is evaluated is the first time that the relevant widget is registered (if it is necessary); that is, that when the kernel sees the widget, it first sends a display_data to which has some scripts to register the widget, and then opens the comm via comm_open. -- Andrew Gibiansky -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140516/9f5de353/attachment.html> From benjaminrk at gmail.com Sat May 17 10:54:44 2014 From: benjaminrk at gmail.com (MinRK) Date: Sat, 17 May 2014 07:54:44 -0700 Subject: [IPython-dev] Javascript Ordering Semantics Issue in Notebook with Widget Registration In-Reply-To: <CAF-LYK+VHSx5fCJ_WdzD+w+2-dBm6v69p-G9BWnngAumMBc3Yg@mail.gmail.com> References: <CAF-LYK+VHSx5fCJ_WdzD+w+2-dBm6v69p-G9BWnngAumMBc3Yg@mail.gmail.com> Message-ID: <CAHNn8BXBY=AsjMmnyJJNY=PmVnwXR-QTwsEf7XknYMn3Ut3xPg@mail.gmail.com> I think there's some async things that Firefox does that other browsers do not. If I recall, Jon has faced this before, dealing with event sequences on Firefox, so he might have an idea. Jon, any idea what to do here? On Fri, May 16, 2014 at 11:37 PM, Andrew Gibiansky < andrew.gibiansky at gmail.com> wrote: > Hey guys, > > I'm running into a little bit of a Javascript code execution issue, and am > unsure whether I am doing something wrong in my architecture, or if perhaps > IPython should somehow mitigate the bugs I'm getting. > > Basically, here's the setup: for IHaskell, extension authors who want to > be able to display their data as widgets must create a way to register > those widgets. The first time those widgets are created, they must also be > registered in the JS on the notebook frontend. However, this is done in the > same series of messages as the comm_open. So here's the crux: > > The way that the widgets are registered is by adding a <script> tag to the > DOM. However, though the DOM is added, I *think* the comm_open message is > parsed *before* the <script> in the DOM is executed. Note that this > *only* happens in firefox. In Chrome, the <script> tag is added, the DOM > is executed, and *then* the comm_open is processed. By the time comm_open > is processed in Chrome (not in firefox), the <script> has been run so the > widget is registered. In firefox, the comm_open is processed before the > script tag was run, so the widget is unregistered. > > So here's my question: > > Would it be possible to *force* all DOM added as a result of message > handling to be parsed and script tags in it to be executed before the next > message is handled? Perhaps this could be done by using $(blah).load(...) > on everything that is added to an output area? Or something? > > Anyway, I am confused, and not sure how to fix this, and whether or not > it's an issue with my code. The one requirement is that when the widget > object is evaluated is the first time that the relevant widget is > registered (if it is necessary); that is, that when the kernel sees the > widget, it first sends a display_data to which has some scripts to register > the widget, and then opens the comm via comm_open. > > -- Andrew Gibiansky > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140517/ad605fac/attachment.html> From andrew.gibiansky at gmail.com Sat May 17 13:29:21 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Sat, 17 May 2014 10:29:21 -0700 Subject: [IPython-dev] Javascript Ordering Semantics Issue in Notebook with Widget Registration In-Reply-To: <CAHNn8BXBY=AsjMmnyJJNY=PmVnwXR-QTwsEf7XknYMn3Ut3xPg@mail.gmail.com> References: <CAF-LYK+VHSx5fCJ_WdzD+w+2-dBm6v69p-G9BWnngAumMBc3Yg@mail.gmail.com> <CAHNn8BXBY=AsjMmnyJJNY=PmVnwXR-QTwsEf7XknYMn3Ut3xPg@mail.gmail.com> Message-ID: <CAF-LYKJ-PxBtiu+SGqXimtFUxtWcUBRSoJ+xryhJ98kNeBRvUg@mail.gmail.com> After digging around in the frontend JS source for a while, I found a solution. Instead of sending a display_data with mimetype text/html and an embedded script tag, just send two display_data messages, one with mimetype application/javascript (with required JS) which must be executed before the comm_open and another with mimetype text/html (with required HTML to be inserted, if any). This fixes the issue I have. However, it's still a bit strange that Chrome and FF do the original thing differently, but looks like there's an easy workaround. On Sat, May 17, 2014 at 7:54 AM, MinRK <benjaminrk at gmail.com> wrote: > I think there's some async things that Firefox does that other browsers do > not. If I recall, Jon has faced this before, dealing with event sequences > on Firefox, so he might have an idea. > > Jon, any idea what to do here? > > > On Fri, May 16, 2014 at 11:37 PM, Andrew Gibiansky < > andrew.gibiansky at gmail.com> wrote: > >> Hey guys, >> >> I'm running into a little bit of a Javascript code execution issue, and >> am unsure whether I am doing something wrong in my architecture, or if >> perhaps IPython should somehow mitigate the bugs I'm getting. >> >> Basically, here's the setup: for IHaskell, extension authors who want to >> be able to display their data as widgets must create a way to register >> those widgets. The first time those widgets are created, they must also be >> registered in the JS on the notebook frontend. However, this is done in the >> same series of messages as the comm_open. So here's the crux: >> >> The way that the widgets are registered is by adding a <script> tag to >> the DOM. However, though the DOM is added, I *think* the comm_open >> message is parsed *before* the <script> in the DOM is executed. Note >> that this *only* happens in firefox. In Chrome, the <script> tag is >> added, the DOM is executed, and *then* the comm_open is processed. By >> the time comm_open is processed in Chrome (not in firefox), the <script> >> has been run so the widget is registered. In firefox, the comm_open is >> processed before the script tag was run, so the widget is unregistered. >> >> So here's my question: >> >> Would it be possible to *force* all DOM added as a result of message >> handling to be parsed and script tags in it to be executed before the next >> message is handled? Perhaps this could be done by using $(blah).load(...) >> on everything that is added to an output area? Or something? >> >> Anyway, I am confused, and not sure how to fix this, and whether or not >> it's an issue with my code. The one requirement is that when the widget >> object is evaluated is the first time that the relevant widget is >> registered (if it is necessary); that is, that when the kernel sees the >> widget, it first sends a display_data to which has some scripts to register >> the widget, and then opens the comm via comm_open. >> >> -- Andrew Gibiansky >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140517/7e6eb065/attachment.html> From nathan12343 at gmail.com Mon May 19 03:16:00 2014 From: nathan12343 at gmail.com (Nathan Goldbaum) Date: Mon, 19 May 2014 00:16:00 -0700 Subject: [IPython-dev] Distributing evaluated notebooks that require big-ish data In-Reply-To: <CANn2QUyCyi-bHdty+yr5jBy1Ea5sJXBys=TLDHOo7Dj01FPYGg@mail.gmail.com> References: <CANn2QUyCyi-bHdty+yr5jBy1Ea5sJXBys=TLDHOo7Dj01FPYGg@mail.gmail.com> Message-ID: <CAJXewOnkY1bc7EhuzPs7PCNAco=JSfTDOcu-ZD_GEHRTpB=TsQ@mail.gmail.com> For the yt documentation [1] we do this using a jenkins buildbot and a sphinx extension that I wrote called RunNotebook [2]. To follow this route you'll need to host your own docs builds on your project's website and also have a server that can dynamically generate the docs builds. If you don't need to build the docs with each commit to your codebase, you could also generate the docs manually as part of your release process. A nice bonus to incorporating notebooks into your docs in this fashion is that the notebooks serve as a form of testing: broken code in the docs leads to broken results embedded in the docs build. [1] http://yt-project.org/doc, see e.g. the yt bootcamp at http://yt-project.org/doc/bootcamp/index.html [2] https://github.com/ngoldbaum/runnotebook On Fri, May 16, 2014 at 12:24 PM, Antonino Ingargiola <tritemio at gmail.com>wrote: > Hi, > > I'm working on a software for single-molecule FRET analysis > (FRETBursts)[1] that heavily relies on ipython notebook to run the analysis. > > I provide some evaluated notebooks serving as tutorials in a separate > repository (FRETBursts_notebooks). The reference documentation (mostly > installation instructions and API) is hosted on ReadTheDocs [3]. > > I have concerns on the viability of this approach since the notebooks > repository can easily grow to hundreds of MB given the high number of > images. Maintaining a second repository it is also and additional burden. > > Ideally I would like to generate the notebooks dynamically from > unevaluated notebooks in the original source repository. However the data > necessary to reproduce the analysis is ~150MB (hosted on figshare [4]), > and I may add more datasets in the future. > > So I'm asking for suggestions. > > I like the simple concept of a notebook repository with links to nbviewer, > but seems that the solution is not scalable. > > I don't think RTD can handle downloading and data processing that > requires several minutes to execute on modern desktops. > > So, what's left? Anybody has a similar issue? > > > Best, > Antonio > > [1] FRETBursts: https://github.com/tritemio/FRETBursts > [2] FRETBursts_notebooks: https://github.com/tritemio/FRETBursts_notebooks > [3] FRETBursts documentation: http://fretbursts.readthedocs.org/index.html > [4] FRETBursts datatsets: http://dx.doi.org/10.6084/m9.figshare.1019906 > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140519/bdedf305/attachment.html> From andrew.gibiansky at gmail.com Tue May 20 00:24:54 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Mon, 19 May 2014 21:24:54 -0700 Subject: [IPython-dev] Problems with Anaconda Message-ID: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> Hey all, A lot of my users (for IHaskell) try to install it with Anaconda providing the IPython distribution. Whenever this happens, everything inevitably fails horribly, and IHaskell (which is just a kernel for IPython, as well as a small wrapper which launches IPython) just hangs after the first input. Does anyone have any ideas why this might be? Works happily with virtualenvs or globally installed ipython, but Anaconda seems to be IHaskell's worst enemy. (Perhaps I should rename IHaskell to Mongoose or something...) -- Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140519/6857e409/attachment.html> From asmeurer at gmail.com Tue May 20 00:47:18 2014 From: asmeurer at gmail.com (Aaron Meurer) Date: Mon, 19 May 2014 23:47:18 -0500 Subject: [IPython-dev] Problems with Anaconda In-Reply-To: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> References: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> Message-ID: <CAKgW=6KvnK-fp-8mbQzBigWeq8BMD0JWLPG0gT5ofbw5vEjwmg@mail.gmail.com> Which operating system is this on? Aaron Meurer On Mon, May 19, 2014 at 11:24 PM, Andrew Gibiansky <andrew.gibiansky at gmail.com> wrote: > Hey all, > > A lot of my users (for IHaskell) try to install it with Anaconda providing > the IPython distribution. Whenever this happens, everything inevitably fails > horribly, and IHaskell (which is just a kernel for IPython, as well as a > small wrapper which launches IPython) just hangs after the first input. > > Does anyone have any ideas why this might be? Works happily with virtualenvs > or globally installed ipython, but Anaconda seems to be IHaskell's worst > enemy. (Perhaps I should rename IHaskell to Mongoose or something...) > > -- Andrew > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From andrew.gibiansky at gmail.com Tue May 20 01:15:34 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Mon, 19 May 2014 22:15:34 -0700 Subject: [IPython-dev] Problems with Anaconda In-Reply-To: <CAKgW=6KvnK-fp-8mbQzBigWeq8BMD0JWLPG0gT5ofbw5vEjwmg@mail.gmail.com> References: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> <CAKgW=6KvnK-fp-8mbQzBigWeq8BMD0JWLPG0gT5ofbw5vEjwmg@mail.gmail.com> Message-ID: <CAF-LYK+5WnsmThhPtsaxVY7ZDapw5ckaHJuzz9BYhnqsne_-3Q@mail.gmail.com> Macs, mostly, I think. On Mon, May 19, 2014 at 9:47 PM, Aaron Meurer <asmeurer at gmail.com> wrote: > Which operating system is this on? > > Aaron Meurer > > On Mon, May 19, 2014 at 11:24 PM, Andrew Gibiansky > <andrew.gibiansky at gmail.com> wrote: > > Hey all, > > > > A lot of my users (for IHaskell) try to install it with Anaconda > providing > > the IPython distribution. Whenever this happens, everything inevitably > fails > > horribly, and IHaskell (which is just a kernel for IPython, as well as a > > small wrapper which launches IPython) just hangs after the first input. > > > > Does anyone have any ideas why this might be? Works happily with > virtualenvs > > or globally installed ipython, but Anaconda seems to be IHaskell's worst > > enemy. (Perhaps I should rename IHaskell to Mongoose or something...) > > > > -- Andrew > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140519/74e65c3d/attachment.html> From doug.blank at gmail.com Tue May 20 09:17:51 2014 From: doug.blank at gmail.com (Doug Blank) Date: Tue, 20 May 2014 09:17:51 -0400 Subject: [IPython-dev] Problems with Anaconda In-Reply-To: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> References: <CAF-LYK+wWowohnZgtAFnT6VUGxeuMzK6bF6re3NrKP9pt4fx7w@mail.gmail.com> Message-ID: <CAAusYCjmPtZEzOkdR=fJ+n3Ltv-segB8k5JE0LZ+dUT+yL5kAQ@mail.gmail.com> On Tue, May 20, 2014 at 12:24 AM, Andrew Gibiansky < andrew.gibiansky at gmail.com> wrote: > Hey all, > > A lot of my users (for IHaskell) try to install it with Anaconda providing > the IPython distribution. Whenever this happens, everything inevitably > fails horribly, and IHaskell (which is just a kernel for IPython, as well > as a small wrapper which launches IPython) just hangs after the first input. > > Does anyone have any ideas why this might be? Works happily with > virtualenvs or globally installed ipython, but Anaconda seems to be > IHaskell's worst enemy. (Perhaps I should rename IHaskell to Mongoose or > something...) > We've been recommending Anaconda for Mac and Windows for our third-party kernel, and it seems to work well. We also have a small wrapper that launches ipython. Do they install "ipython[all]"? Perhaps they are not getting the zmq libraries? Does "ipython notebook" work fine for those users? If so, and your kernel profile still fails, then perhaps it is a path issue. I think I have seen that sometimes a user might have to restart their terminal program to get updated paths. -Doug > > -- Andrew > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140520/2ed1d5fc/attachment.html> From ASchneiderman at asha.org Tue May 20 11:19:47 2014 From: ASchneiderman at asha.org (Anders Schneiderman) Date: Tue, 20 May 2014 11:19:47 -0400 Subject: [IPython-dev] Widget documentation? Message-ID: <93268EE5694C0A4BBB888C2EEFEEEC22A350C7B951@EXCH2008.hq.asha.org> Where is the documentation for widgets? There's a little here: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Index.ipynb But, for example, if you want to know the parameters that the float slider widget takes, I don't see it. I tried using: widgets.FloatSliderWidget?? And what I got back didn't include all of the parameters: Type: MetaHasTraits String form: <class 'IPython.html.widgets.widget_float.FloatSliderWidget'> File: c:\anaconda\lib\site-packages\ipython\html\widgets\widget_float.py Init definition: widgets.FloatSliderWidget(self, *pargs, **kwargs) Source: class FloatSliderWidget(_BoundedFloatWidget): _view_name = Unicode('FloatSliderView', sync=True) orientation = Enum([u'horizontal', u'vertical'], u'horizontal', help="Vertical or horizontal.", sync=True) readout = Bool(True, help="Display the current value of the slider next to it.", sync=True) Init docstring: Constructor Thanks, Anders Schneiderman Database Services Manager | ASHA | (301) 296-8651 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140520/18e5490e/attachment.html> From benjaminrk at gmail.com Wed May 21 16:04:18 2014 From: benjaminrk at gmail.com (MinRK) Date: Wed, 21 May 2014 13:04:18 -0700 Subject: [IPython-dev] IPython 2.1.0 Message-ID: <CAHNn8BWmHSXV7jyb5RwDShsR9h2s1ZDRMH4-j7=dbREp=R=pdw@mail.gmail.com> We just released IPython 2.1.0, which should hopefully be a very boring bugfix release on top of 2.0.0. https://pypi.python.org/pypi/ipython/2.1.0 The list of backported changes: http://ipython.org/ipython-doc/stable/whatsnew/github-stats-2.0.html -MinRK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140521/2ccc48ca/attachment.html> From tritemio at gmail.com Wed May 21 17:54:33 2014 From: tritemio at gmail.com (Antonino Ingargiola) Date: Wed, 21 May 2014 14:54:33 -0700 Subject: [IPython-dev] Distributing evaluated notebooks that require big-ish data In-Reply-To: <CAJXewOnkY1bc7EhuzPs7PCNAco=JSfTDOcu-ZD_GEHRTpB=TsQ@mail.gmail.com> References: <CANn2QUyCyi-bHdty+yr5jBy1Ea5sJXBys=TLDHOo7Dj01FPYGg@mail.gmail.com> <CAJXewOnkY1bc7EhuzPs7PCNAco=JSfTDOcu-ZD_GEHRTpB=TsQ@mail.gmail.com> Message-ID: <CANn2QUztkUPmVxRsxtXZwn_CkYfdO+xtvYfnyk2sRY1Mk+CjiA@mail.gmail.com> Hi Nathan, thanks for the reply. Your approach is very compelling indeed. I'll try it whenever I switch to an own server to build the docs. For now I'll stick to ReadTheDoc and I'll manually run the notebooks for testing/updating. I'll try to do not update the images too frequently so that the repository will not explode. Best, Antonio On Mon, May 19, 2014 at 12:16 AM, Nathan Goldbaum <nathan12343 at gmail.com>wrote: > For the yt documentation [1] we do this using a jenkins buildbot and a > sphinx extension that I wrote called RunNotebook [2]. To follow this route > you'll need to host your own docs builds on your project's website and also > have a server that can dynamically generate the docs builds. If you don't > need to build the docs with each commit to your codebase, you could also > generate the docs manually as part of your release process. > > A nice bonus to incorporating notebooks into your docs in this fashion is > that the notebooks serve as a form of testing: broken code in the docs > leads to broken results embedded in the docs build. > > [1] http://yt-project.org/doc, see e.g. the yt bootcamp at > http://yt-project.org/doc/bootcamp/index.html > [2] https://github.com/ngoldbaum/runnotebook > > > On Fri, May 16, 2014 at 12:24 PM, Antonino Ingargiola <tritemio at gmail.com>wrote: > >> Hi, >> >> I'm working on a software for single-molecule FRET analysis >> (FRETBursts)[1] that heavily relies on ipython notebook to run the analysis. >> >> I provide some evaluated notebooks serving as tutorials in a separate >> repository (FRETBursts_notebooks). The reference documentation (mostly >> installation instructions and API) is hosted on ReadTheDocs [3]. >> >> I have concerns on the viability of this approach since the notebooks >> repository can easily grow to hundreds of MB given the high number of >> images. Maintaining a second repository it is also and additional burden. >> >> Ideally I would like to generate the notebooks dynamically from >> unevaluated notebooks in the original source repository. However the data >> necessary to reproduce the analysis is ~150MB (hosted on figshare [4]), >> and I may add more datasets in the future. >> >> So I'm asking for suggestions. >> >> I like the simple concept of a notebook repository with links to >> nbviewer, but seems that the solution is not scalable. >> >> I don't think RTD can handle downloading and data processing that >> requires several minutes to execute on modern desktops. >> >> So, what's left? Anybody has a similar issue? >> >> >> Best, >> Antonio >> >> [1] FRETBursts: https://github.com/tritemio/FRETBursts >> [2] FRETBursts_notebooks: >> https://github.com/tritemio/FRETBursts_notebooks >> [3] FRETBursts documentation: >> http://fretbursts.readthedocs.org/index.html >> [4] FRETBursts datatsets: http://dx.doi.org/10.6084/m9.figshare.1019906 >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140521/f4ffb8e8/attachment.html> From vasco+python at tenner.nl Thu May 22 11:31:24 2014 From: vasco+python at tenner.nl (Vasco Tenner) Date: Thu, 22 May 2014 17:31:24 +0200 Subject: [IPython-dev] widget value persistence In-Reply-To: <CAK6O52=emWZVe0oEHkXC8SQk+qgZU84fivCncqKvE_aM7kWEAg@mail.gmail.com> References: <CAK6O52kLjPHaz-_8C-swHyX1pGcx0ML0Mhs7qLWJZ0RnAT9FHQ@mail.gmail.com> <CAOvn4qin588Og1uhkfCTpk1+MgrNhyZh1GkWKECz6+o2Nei_ow@mail.gmail.com> <CAK6O52=emWZVe0oEHkXC8SQk+qgZU84fivCncqKvE_aM7kWEAg@mail.gmail.com> Message-ID: <537E184C.5020509@tenner.nl> Dear all, On 02/27/2014 10:10 PM, Darren Dale wrote: > However, if you re-run the cell, I think it will (and should) always > return the default to what the code specifies. I think it's What I quite often do to preserve the settings of a widget: 1. Create a widget w = interactive(function) display(w) 2. The just print the values of the sliders: w.kwargs 3. Then copy this output in a new cell. good_kwargs = {'a':1} What would help me is if I can set the values of the widgets with something like: w = interactive(function) w.kwargs = good_kwargs display(w) Is there a way to achieve this? Kind regards, Vasco From mark.voorhies at ucsf.edu Thu May 22 14:45:09 2014 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Thu, 22 May 2014 11:45:09 -0700 Subject: [IPython-dev] Selecting data via http requests (event loop question?) Message-ID: <537E45B5.1060608@ucsf.edu> A lot of visualization tools for genomic data can emit an http request in response to selecting a gene (e.g., JavaTreeView and MeV (expression profiles and other matrix/dendrogram data), MochiView (deep sequencing and other genome position vs. scalar data), CytoScape (large network data -- interactive and scales better than GraphViz)) I am generating related, non-inlined plots in an IPython session and would like to update selections on these plots in response to selections in the external programs. A naive approach would be to listen for the HTTP requests using something based on BaseHTTPServer from the standard library; for this case, is there a straightforward way to include the server's polling loop in the kernel's event loop (e.g., something analogous to what's done for GUI event loops)? Alternatively, is there a way to hook into Tornado directly, or is there a better approach that I'm not thinking of? Thanks in advance for any advice, Mark From benjaminrk at gmail.com Thu May 22 22:26:59 2014 From: benjaminrk at gmail.com (MinRK) Date: Thu, 22 May 2014 19:26:59 -0700 Subject: [IPython-dev] Selecting data via http requests (event loop question?) In-Reply-To: <537E45B5.1060608@ucsf.edu> References: <537E45B5.1060608@ucsf.edu> Message-ID: <CAHNn8BV7oYeBJwzpaiZps9iaYgm6ZV_3DDTdZjzxbwH6xeEQ+g@mail.gmail.com> Since the IPython kernel uses the tornado eventloop, so you can register handlers with tornado?s own HTTPServer, which will automatically be integrated into the already running loop. Here?s an example <https://gist.github.com/minrk/e30b33abeee31bc4b7c7> of registering a simple handler, from another recent question about hooking up a webserver in a kernel. -MinRK ? On Thu, May 22, 2014 at 11:45 AM, Mark Voorhies <mark.voorhies at ucsf.edu>wrote: > A lot of visualization tools for genomic data can emit an http request in > response to selecting a gene > (e.g., JavaTreeView and MeV (expression profiles and other > matrix/dendrogram data), > MochiView (deep sequencing and other genome position vs. scalar > data), > CytoScape (large network data -- interactive and scales better > than GraphViz)) > > I am generating related, non-inlined plots in an IPython session and would > like to update selections > on these plots in response to selections in the external programs. > > A naive approach would be to listen for the HTTP requests using something > based on BaseHTTPServer from the standard library; > for this case, is there a straightforward way to include the server's > polling loop in the kernel's event loop > (e.g., something analogous to what's done for GUI event loops)? > > Alternatively, is there a way to hook into Tornado directly, or is there a > better approach that I'm not thinking of? > > Thanks in advance for any advice, > > Mark > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140522/e03ee54e/attachment.html> From bussonniermatthias at gmail.com Fri May 23 04:21:06 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Fri, 23 May 2014 10:21:06 +0200 Subject: [IPython-dev] widget value persistence In-Reply-To: <537E184C.5020509@tenner.nl> References: <CAK6O52kLjPHaz-_8C-swHyX1pGcx0ML0Mhs7qLWJZ0RnAT9FHQ@mail.gmail.com> <CAOvn4qin588Og1uhkfCTpk1+MgrNhyZh1GkWKECz6+o2Nei_ow@mail.gmail.com> <CAK6O52=emWZVe0oEHkXC8SQk+qgZU84fivCncqKvE_aM7kWEAg@mail.gmail.com> <537E184C.5020509@tenner.nl> Message-ID: <C59D5F56-A1F4-4EC7-B831-19634A2E5826@gmail.com> Le 22 mai 2014 ? 17:31, Vasco Tenner a ?crit : > Dear all, > On 02/27/2014 10:10 PM, Darren Dale wrote: >> However, if you re-run the cell, I think it will (and should) always >> return the default to what the code specifies. I think it's > What I quite often do to preserve the settings of a widget: > > 1. Create a widget > w = interactive(function) > display(w) > > 2. The just print the values of the sliders: > w.kwargs > > 3. Then copy this output in a new cell. > good_kwargs = {'a':1} > > What would help me is if I can set the values of the widgets with > something like: > w = interactive(function) > w.kwargs = good_kwargs > display(w) > > Is there a way to achieve this? from IPython.html.widgets import interactive def fun(c=0, a=1): return a+c w = interactive(fun,**{'c':12,'a':7}) display(w) Does what you expect it to do. -- M > > Kind regards, > Vasco > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From jtaylor.debian at googlemail.com Fri May 23 04:25:36 2014 From: jtaylor.debian at googlemail.com (Julian Taylor) Date: Fri, 23 May 2014 10:25:36 +0200 Subject: [IPython-dev] IPython 2.1.0 In-Reply-To: <CAHNn8BWmHSXV7jyb5RwDShsR9h2s1ZDRMH4-j7=dbREp=R=pdw@mail.gmail.com> References: <CAHNn8BWmHSXV7jyb5RwDShsR9h2s1ZDRMH4-j7=dbREp=R=pdw@mail.gmail.com> Message-ID: <537F0600.3000704@googlemail.com> On 21.05.2014 22:04, MinRK wrote: > We just released IPython 2.1.0, which should hopefully be a very boring > bugfix release on top of 2.0.0. > > https://pypi.python.org/pypi/ipython/2.1.0 > > The list of backported changes: > > http://ipython.org/ipython-doc/stable/whatsnew/github-stats-2.0.html > hi, the download archive as linked from ipython.org does not work: http://archive.ipython.org/release error id: "bad_httpd_conf" From tra at popgen.net Fri May 23 07:19:38 2014 From: tra at popgen.net (Tiago Antao) Date: Fri, 23 May 2014 12:19:38 +0100 Subject: [IPython-dev] Detecting ipython notebook on the browser Message-ID: <20140523121938.538b39c1@lnx> Hi, Before my question proper, a bit of proselytising ;) While a few of us around here are scientists I do think that IPython Notebook would be an amazing tool for the arts (i.e. computer assisted generation). Consider all the tweaking and real-time changing allowed by ipython notebook applied to music, drawing, animation, ... In this context I have been working on integrating abjad (a score composition software) with Ipython notebook. There is currently a solution that is 99% transparent and you can find that here: http://nbviewer.ipython.org/github/tiagoantao/abjad-ipython/blob/master/notebooks/Index.ipynb Now, I want to submit a patch to abjad in order to make this 100% transparent (i.e. propose a change that would make abjad work with ipython notebook out of the box). The way things work now is by overriding abjad's show function: instead of generating a postscript file and firing a postscript viewer I generate a PNG file and send it (after some cropping) to ipython notebook. Instead of overriding the show function, the function itself could decide what to do based on context... So, what I needed to know is: 1. How to detect that ipython notebook is running? 2. A bit more subtle than that: Can I detect that it is running in a browser context? I mean: we can run a notebook from the command line (with the %run magic) and in that case I might still want to generate a PS instead of a PNG file... Thanks, Tiago PS - I am interested in extending the notebook metaphor to creative/artistic stuff. If you have an ongoing project/idea on this, and need some volunteer hands, get in touch... From bussonniermatthias at gmail.com Fri May 23 07:36:23 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Fri, 23 May 2014 13:36:23 +0200 Subject: [IPython-dev] Detecting ipython notebook on the browser In-Reply-To: <20140523121938.538b39c1@lnx> References: <20140523121938.538b39c1@lnx> Message-ID: <124AF0EE-EBE1-4659-A260-F9865C430262@gmail.com> Hi Tiago, Le 23 mai 2014 ? 13:19, Tiago Antao a ?crit : > Hi, > > The way things work now is by overriding abjad's show function: instead > of generating a postscript file and firing a postscript viewer I > generate a PNG file and send it (after some cropping) to ipython > notebook. Instead of overriding the show function, the function itself > could decide what to do based on context... > > So, what I needed to know is: > > 1. How to detect that ipython notebook is running? > > 2. A bit more subtle than that: Can I detect that it is running in a > browser context? I mean: we can run a notebook from the command line > (with the %run magic) and in that case I might still want to generate a > PS instead of a PNG file? This is a question which is often asked, you will find answers on stack-overflow and archive of the mailing list. There are non way to know that a kernel is run from a notebook, and actually the question does not make sense, to retake example i have already use, it's like a book authors wondering the eye color of its reader. The way to do it is to have your score object : score_template = templatetools.TwoStaffPianoScoreTemplate() score = score_template() have a _repr_png_ that return the PNG data. IPython will take care of the rest and call _repr_png_ if present and display the PNG. basically rename your _get_png(expr) as _repr_png_ and make it a method of score. though it should return only one PNG. Hope that helps. -- M > > Thanks, > Tiago > PS - I am interested in extending the notebook metaphor to > creative/artistic stuff. If you have an ongoing project/idea on this, > and need some volunteer hands, get in touch... > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From tra at popgen.net Fri May 23 08:11:44 2014 From: tra at popgen.net (Tiago Antao) Date: Fri, 23 May 2014 13:11:44 +0100 Subject: [IPython-dev] Detecting ipython notebook on the browser In-Reply-To: <124AF0EE-EBE1-4659-A260-F9865C430262@gmail.com> References: <20140523121938.538b39c1@lnx> <124AF0EE-EBE1-4659-A260-F9865C430262@gmail.com> Message-ID: <20140523131144.57741c91@lnx> > There are non way to know that a kernel is run from a notebook, > and actually the question does not make sense, to retake example > i have already use, it's like a book authors wondering the eye color > of its reader. [Changing context a bit here] At least in my work flow, it is starting to get more common that IPython notebooks get "promoted" to modules. ie some piece of code that was initially ad-hoc, graduates to some abstract function and gets inside a module. Another use-case is when one wants to run several instances of a notebook from the command line(e.g. to run many simulation replicates). i.e., to use a notebook as a script. One alternative, of course is just to convert mature/reusable code from .ipynb to .py. But another alternative is to use notebooks directly as scripts/modules. In this view, having a way to understand the context can be really interesting: in front of the users eyes or as a re-usable piece of code. Now, I understand that this is not the original intent of the notebook and that this is going off-script here. But a vision of things might be to develop everything inside the notebook. The whole code as ipython notebooks. I just note that there is no performance penalty in this vision (after import the speed would be the same) and the machinery to do this is already very well documented: http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Importing%20Notebooks.ipynb I do understand the argument that this is a bit crazy, but it is a possible use-case nonetheless. Tiago From bussonniermatthias at gmail.com Fri May 23 09:00:29 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Fri, 23 May 2014 15:00:29 +0200 Subject: [IPython-dev] Detecting ipython notebook on the browser In-Reply-To: <20140523131144.57741c91@lnx> References: <20140523121938.538b39c1@lnx> <124AF0EE-EBE1-4659-A260-F9865C430262@gmail.com> <20140523131144.57741c91@lnx> Message-ID: <6C666DC9-3FF5-4A6D-B382-15B6199C676E@gmail.com> Le 23 mai 2014 ? 14:11, Tiago Antao a ?crit : > >> There are non way to know that a kernel is run from a notebook, >> and actually the question does not make sense, to retake example >> i have already use, it's like a book authors wondering the eye color >> of its reader. > > [Changing context a bit here] I understand the use case, and the metaphor I chose are of course different that what will actually happen with the kernel. But I can make the explanation purely technical. I will re-explain why it is technically impossible then point out how other external project are making use of IPython rich display system without knowing they are in the notebook (or in IPython) without impacting usability on pure python script. TLDR: There are technically no reliable way when executing a piece of code to know what the frontend is. You should not try to display the object by yourself, define a _repr_*_ and leave lets it be computed when needed. The kernel is unaware of the environment : From the kernel perspective, it receive a message through ZMQ, and reply to it. The message contains a string of code to execute[1], and reply with a mime bundle. What is on the other side of ZMQ - does not matter. - might be changing. - might be many things at once. For example what is on the other side of ZMQ can be the console, or the qtconsole, or the tornado web server, a run-ipynb. Already there are no way to know, they all make use of the same subclass. Taking the example of Tornado, it forward the messages from zmq to web socket. Which arrives on the other side. What can connect to web socket ? - Single cell example, there are no ipynb involve, pure javascript. - eLisp, Yes, Emacs connect to IPython through websocket - The notebook app you know. So from the kernel point of view there is **no way** to reliably know if you are on a notebook, the kernel is a writer that wrote things on a book and someone might read over its shoulder (command line IPyhon) but the little green martian can be watching it through their telescope (tornado + websocket). I won't go into details with the file format and the mime bundle, and storing on disk, kernel/server on different machines and language agnosticity, but as until know, we have not came across real use case where the ability to reliably know that you are in notebooks (or even in IPython) are needed, Pandas is defining _repr_html_ to work magically on notebooks : https://github.com/pydata/pandas/blob/2e1b092085ee49109b3d68b3cda05732316525ba/pandas/core/frame.py#L468 IPython blocks too : https://github.com/jiffyclub/ipythonblocks/blob/b1785f471ee46917673abae1320e2953e0da0072/ipythonblocks/ipythonblocks.py#L325 And sympy prefer the display hook approach not to duplicate the _repr_png_ everywhere, but the result is the same : https://github.com/sympy/sympy/blob/423d51c458c8cc14baa4adcf4e1598e46936e73e/sympy/interactive/printing.py#L87-L93 The case of sympy is probably closer to yours as they are actually calling an external program to render the PNG, but prefer to disable it by default. So I believe, the approach of defying a _repr_pgn_ into abjad score class (or registering a display hook, but that's nitpicking) should allow you to do transparently what you ask. ie here : https://github.com/Abjad/abjad/blob/d6a5ce051482371d0c37ae287b13bd4afb9ec015/abjad/tools/scoretools/Score.py#L55 define a method : def _repr_png_(self): return #png data created by smith like this : https://github.com/tiagoantao/abjad-ipython/blob/master/src/abjad-nb.py#L22 Note that Julia has defined this mime bundle thing on the language itself, library not define how to show object, then there is no more1 show/display/draw methods per library, you just have a global julia "show()" that knows what to do. Same goes with IPython, user should just have to use IPython.display.display(object) and it should work. If you use display_* in library or try to guess wether or not you are in IPython/ IPython notebook, you are <del>probably</del> certainly doing things wrong. Hope this make things a little clearer. [1] actually little more complicated, but a string will do it > > At least in my work flow, it is starting to get more common that > IPython notebooks get "promoted" to modules. ie some piece of code that > was initially ad-hoc, graduates to some abstract function and gets > inside a module. > > Another use-case is when one wants to run several instances of a > notebook from the command line(e.g. to run many simulation replicates). > i.e., to use a notebook as a script. > > One alternative, of course is just to convert mature/reusable > code from .ipynb to .py. > > But another alternative is to use notebooks directly as > scripts/modules. In this view, having a way to understand the > context can be really interesting: in front of the users eyes or as a > re-usable piece of code. > > Now, I understand that this is not the original intent of the notebook > and that this is going off-script here. But a vision of things might be > to develop everything inside the notebook. The whole code as ipython > notebooks. > > I just note that there is no performance penalty in this vision (after > import the speed would be the same) and the machinery to do this is > already very well documented: > > http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Importing%20Notebooks.ipynb > > I do understand the argument that this is a bit crazy, but it is a > possible use-case nonetheless. > > Tiago -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140523/0bcbe9d0/attachment.html> From dchichkov at gmail.com Fri May 23 10:56:48 2014 From: dchichkov at gmail.com (Dmitry Chichkov) Date: Fri, 23 May 2014 07:56:48 -0700 Subject: [IPython-dev] Cute example combining IPython.html.widgets.interact and mpld3 zoom/pan. Message-ID: <CADeuJh7JzuPbpDO4VnuxKJHwePGx-kG6bBcM=M5YBucs6XfOQw@mail.gmail.com> A cute small example that combines interact and mpld3 zoom/pan. Works with the current release of ipython-2.1.0, matplotlib-1.3.1 and mpld3-0.3. It'd be great, if functionality that allows this example to work would stay and remain operational... %matplotlib inline import matplotlib.pyplot as plt, numpy as np from IPython.html import widgets import mpld3 # Notice that as you hover over the plot, a toolbar appears in the lower left. mpld3.enable_notebook() def on_value_change(value): fig, ax = plt.subplots() x, y = np.random.normal(size=(2, 100)) color, size = np.random.random((2, 100)) ax.scatter(x[:value], y[:value], c=color[:value], s=500 * size, alpha=0.3) ax.axis((-3,3,-3,3)) ax.grid(color='lightgray', alpha=0.7) widgets.interact(on_value_change, value = widgets.IntSliderWidget(min=1, value=20)) With Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140523/419884d5/attachment.html> From mark.voorhies at ucsf.edu Fri May 23 13:03:49 2014 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Fri, 23 May 2014 10:03:49 -0700 Subject: [IPython-dev] Selecting data via http requests (event loop question?) In-Reply-To: <CAHNn8BV7oYeBJwzpaiZps9iaYgm6ZV_3DDTdZjzxbwH6xeEQ+g@mail.gmail.com> References: <537E45B5.1060608@ucsf.edu> <CAHNn8BV7oYeBJwzpaiZps9iaYgm6ZV_3DDTdZjzxbwH6xeEQ+g@mail.gmail.com> Message-ID: <537F7F75.7050701@ucsf.edu> That works beautifully -- thanks! I wound up using RequestHandler.initialize to pass the plot and underlying data via: application = tornado.web.Application([(r"/(.*)", MainHandler, {"genome":self.genome,"ax":self.fig.axes[0],"fig":self.fig})]) and forcing a refresh of the plot via display(fig) (fig.show() doesn't appear to be sufficient, but I haven't really pushed it) Now, if you'll excuse me, I'm off to xkcd 478 everything =) --Mark On 05/22/2014 07:26 PM, MinRK wrote: > Since the IPython kernel uses the tornado eventloop, so you can register > handlers with tornado?s own HTTPServer, which will automatically be > integrated into the already running loop. > > Here?s an example <https://gist.github.com/minrk/e30b33abeee31bc4b7c7> of > registering a simple handler, from another recent question about hooking up > a webserver in a kernel. > > -MinRK > ? > > > On Thu, May 22, 2014 at 11:45 AM, Mark Voorhies <mark.voorhies at ucsf.edu>wrote: > >> A lot of visualization tools for genomic data can emit an http request in >> response to selecting a gene >> (e.g., JavaTreeView and MeV (expression profiles and other >> matrix/dendrogram data), >> MochiView (deep sequencing and other genome position vs. scalar >> data), >> CytoScape (large network data -- interactive and scales better >> than GraphViz)) >> >> I am generating related, non-inlined plots in an IPython session and would >> like to update selections >> on these plots in response to selections in the external programs. >> >> A naive approach would be to listen for the HTTP requests using something >> based on BaseHTTPServer from the standard library; >> for this case, is there a straightforward way to include the server's >> polling loop in the kernel's event loop >> (e.g., something analogous to what's done for GUI event loops)? >> >> Alternatively, is there a way to hook into Tornado directly, or is there a >> better approach that I'm not thinking of? >> >> Thanks in advance for any advice, >> >> Mark >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From benjaminrk at gmail.com Fri May 23 20:35:48 2014 From: benjaminrk at gmail.com (Min RK) Date: Fri, 23 May 2014 17:35:48 -0700 Subject: [IPython-dev] IPython 2.1.0 In-Reply-To: <537F0600.3000704@googlemail.com> References: <CAHNn8BWmHSXV7jyb5RwDShsR9h2s1ZDRMH4-j7=dbREp=R=pdw@mail.gmail.com> <537F0600.3000704@googlemail.com> Message-ID: <D708C79C-7A2C-4385-87BB-1791ECE3DB23@gmail.com> Yes, there is a DNS issue between Rackspace and Dreamhost. People have been traveling, but hopefully we can work it out shortly. -MinRK > On May 23, 2014, at 1:25, Julian Taylor <jtaylor.debian at googlemail.com> wrote: > >> On 21.05.2014 22:04, MinRK wrote: >> We just released IPython 2.1.0, which should hopefully be a very boring >> bugfix release on top of 2.0.0. >> >> https://pypi.python.org/pypi/ipython/2.1.0 >> >> The list of backported changes: >> >> http://ipython.org/ipython-doc/stable/whatsnew/github-stats-2.0.html > > hi, > the download archive as linked from ipython.org does not work: > http://archive.ipython.org/release > > error id: "bad_httpd_conf" > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From benjaminrk at gmail.com Sat May 24 02:43:58 2014 From: benjaminrk at gmail.com (Min RK) Date: Fri, 23 May 2014 23:43:58 -0700 Subject: [IPython-dev] IPython 2.1.0 In-Reply-To: <D708C79C-7A2C-4385-87BB-1791ECE3DB23@gmail.com> References: <CAHNn8BWmHSXV7jyb5RwDShsR9h2s1ZDRMH4-j7=dbREp=R=pdw@mail.gmail.com> <537F0600.3000704@googlemail.com> <D708C79C-7A2C-4385-87BB-1791ECE3DB23@gmail.com> Message-ID: <B7E0A132-394B-4A15-94EC-D80C19FBE97B@gmail.com> archive.ipython.org should be back. Sorry about that. -MinRK > On May 23, 2014, at 17:35, Min RK <benjaminrk at gmail.com> wrote: > > Yes, there is a DNS issue between Rackspace and Dreamhost. People have been traveling, but hopefully we can work it out shortly. > > -MinRK > >>> On May 23, 2014, at 1:25, Julian Taylor <jtaylor.debian at googlemail.com> wrote: >>> >>> On 21.05.2014 22:04, MinRK wrote: >>> We just released IPython 2.1.0, which should hopefully be a very boring >>> bugfix release on top of 2.0.0. >>> >>> https://pypi.python.org/pypi/ipython/2.1.0 >>> >>> The list of backported changes: >>> >>> http://ipython.org/ipython-doc/stable/whatsnew/github-stats-2.0.html >> >> hi, >> the download archive as linked from ipython.org does not work: >> http://archive.ipython.org/release >> >> error id: "bad_httpd_conf" >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev From vasco+python at tenner.nl Sat May 24 13:47:26 2014 From: vasco+python at tenner.nl (Vasco) Date: Sat, 24 May 2014 19:47:26 +0200 Subject: [IPython-dev] remote X DISPLAY Message-ID: <5380DB2E.4050501@tenner.nl> Dear all, more than 1 year ago (20130226) a discussion came across (on ipython-user) how to run ipython notebook on a remote machine. The solution than was to create a ssh connection, and run the notebook inside "screen". Now I want to use X forwarding show gtk matplotlib windows. This works as long as I keep the original SSH connection open. However, when I create a new ssh connection, the "DISPLAY" environment variable should change. Is there I way I can tell the %matplotlib gtk magic to pass a certain DISPLAY to gtk? Kind regards, Vasco From maximilian.albert at gmail.com Sat May 24 18:17:52 2014 From: maximilian.albert at gmail.com (Maximilian Albert) Date: Sat, 24 May 2014 23:17:52 +0100 Subject: [IPython-dev] remote X DISPLAY In-Reply-To: <5380DB2E.4050501@tenner.nl> References: <5380DB2E.4050501@tenner.nl> Message-ID: <CAGA_dmgHWTstXXKNC8LeEzOnhRHNMBZPxhASf=oN8NfWBZ+m5Q@mail.gmail.com> Hi Vasco, Now I want to use X forwarding show gtk matplotlib windows. This works > as long as I keep the original SSH connection open. However, when I > create a new ssh connection, the "DISPLAY" environment variable should > change. Is there I way I can tell the %matplotlib gtk magic to pass a > certain DISPLAY to gtk? > I think it should work if you put the following at the beginning of your notebook: import os os.environ['DISPLAY'] = ':10' (or whatever new display number you now have). Untested right now, but I'm pretty sure I used it a while back to solve precisely this problem. Cheers, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140524/b94266f2/attachment.html> From bussonniermatthias at gmail.com Mon May 26 12:51:11 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 26 May 2014 18:51:11 +0200 Subject: [IPython-dev] [IPython-User] changing color theme for paired brackets in notebook In-Reply-To: <OF3B54BC56.877617F3-ONC1257CE4.004B3348-C1257CE4.004B334F@LocalDomain> References: <OF3B54BC56.877617F3-ONC1257CE4.004B3348-C1257CE4.004B334F@LocalDomain> Message-ID: <11F6A75B-545E-44ED-8536-2BE1E9E0FD2B@gmail.com> Hi Jean-Fran?ois, Le 26 mai 2014 ? 15:41, Jean-Francois.Moulin at hzg.de a ?crit : > > Hi! > > could anyone point me to a way to tune the color scheme of the ipython notebook? In particular I want to change the color used to highlight paired brackets when the cursor is on one of them (On my machine and with my light colorblindness, the color used is almost indistinguishable from the background) Is this the only color you wish to override or do you want a more custom theme ? If the first one you can just create a custom css file, the second one you might want to rebuild the full IPython css theme. In both cases, put a css file in your ipython profile, one static/custom/custom/custom.css for me ~/.ipython/profile_default/static/custom/custom.css it should already exist and have a comment that look like /* Placeholder for custom user CSS mainly to be overridden in profile/static/custom/custom.css This will always be an empty file in IPython */ According to codemirror Doc [1] you can style the bracket by targeting the following class : CodeMirror-matchingbracket which mean that the following should work : div.CodeMirror span.CodeMirror-matchingbracket { color:red; } use any color or style you like. you can also use any code mirror predefined style if you prefer [2], but it might require a little more of tweaking. Here [3] are a few full theme for IPython notebook. Cheers, -- Matthias [1] : http://codemirror.net/doc/manual.html#class_CodeMirror_matchingbracket [2] : http://codemirror.net/demo/theme.html [3] : https://github.com/nsonnad/base16-ipython-notebook > > Many thanks in advance > JF > Helmholtz-Zentrum Geesthacht > Zentrum f?r Material- und K?stenforschung GmbH > Max-Planck-Stra?e 1 I 21502 Geesthacht I Deutschland/Germany > > Gesch?ftsf?hrer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Gan? > Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: MinDirig Wilfried Kraus > Amtsgericht L?beck HRB 285 GE (Register Court) > Internet: http://www.hzg.de > _______________________________________________ > IPython-User mailing list > IPython-User at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-user -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140526/0ad74b68/attachment.html> From simoncropper at fossworkflowguides.com Mon May 26 19:55:26 2014 From: simoncropper at fossworkflowguides.com (Simon Cropper) Date: Tue, 27 May 2014 09:55:26 +1000 Subject: [IPython-dev] [IPython-User] changing color theme for paired brackets in notebook In-Reply-To: <11F6A75B-545E-44ED-8536-2BE1E9E0FD2B@gmail.com> References: <OF3B54BC56.877617F3-ONC1257CE4.004B3348-C1257CE4.004B334F@LocalDomain> <11F6A75B-545E-44ED-8536-2BE1E9E0FD2B@gmail.com> Message-ID: <5383D46E.1010703@fossworkflowguides.com> Hi Guys, I was thinking. It would also be good to post your final css file to mail list or put a copy on the website so other colour blind people can use the resource. A logical spot in my mind would be here... http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/Customization/Index.ipynb On 27/05/14 02:51, Matthias BUSSONNIER wrote: > Hi Jean-Fran?ois, > > Le 26 mai 2014 ? 15:41, Jean-Francois.Moulin at hzg.de > <mailto:Jean-Francois.Moulin at hzg.de> a ?crit : > >> >> Hi! >> >> could anyone point me to a way to tune the color scheme of the ipython >> notebook? In particular I want to change the color used to highlight >> paired brackets when the cursor is on one of them (On my machine and >> with my light colorblindness, the color used is almost >> indistinguishable from the background) > > Is this the only color you wish to override or do you want a more custom > theme ? > If the first one you can just create a custom css file, the second one > you might want to rebuild the full IPython css theme. > > In both cases, put a css file in your ipython profile, one > static/custom/custom/custom.css > > for me ~/.ipython/profile_default/static/custom/custom.css > it should already exist and have a comment that look like > > /* > Placeholder for custom user CSS > > mainly to be overridden in profile/static/custom/custom.css > > This will always be an empty file in IPython > */ > > According to codemirror Doc [1] you can style the bracket by targeting > the following class : > > CodeMirror-matchingbracket > > > which mean that the following should work : > > div.CodeMirror span.CodeMirror-matchingbracket { > color:red; > } > > use any color or style you like. > > you can also use any code mirror predefined style if you prefer [2], but > it might require a little more of tweaking. > Here [3] are a few full theme for IPython notebook. > > Cheers, > > -- > Matthias > > > > [1] : http://codemirror.net/doc/manual.html#class_CodeMirror_matchingbracket > [2] : http://codemirror.net/demo/theme.html > [3] : https://github.com/nsonnad/base16-ipython-notebook > > > >> >> Many thanks in advance >> JF >> Helmholtz-Zentrum Geesthacht >> Zentrum f?r Material- und K?stenforschung GmbH >> Max-Planck-Stra?e 1 I 21502 Geesthacht I Deutschland/Germany >> >> Gesch?ftsf?hrer/Board of Management: Prof. Dr. Wolfgang Kaysser, >> Dipl.-Ing. Michael Gan? >> Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: >> MinDirig Wilfried Kraus >> Amtsgericht L?beck HRB 285 GE (Register Court) >> Internet: http://www.hzg.de >> _______________________________________________ >> IPython-User mailing list >> IPython-User at scipy.org <mailto:IPython-User at scipy.org> >> http://mail.scipy.org/mailman/listinfo/ipython-user > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides ------------------------------------------------------------ Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Python http://www.fossworkflowguides.com/scripting From vasco+python at tenner.nl Tue May 27 04:39:44 2014 From: vasco+python at tenner.nl (Vasco Tenner) Date: Tue, 27 May 2014 10:39:44 +0200 Subject: [IPython-dev] remote X DISPLAY In-Reply-To: <CAGA_dmgHWTstXXKNC8LeEzOnhRHNMBZPxhASf=oN8NfWBZ+m5Q@mail.gmail.com> References: <5380DB2E.4050501@tenner.nl> <CAGA_dmgHWTstXXKNC8LeEzOnhRHNMBZPxhASf=oN8NfWBZ+m5Q@mail.gmail.com> Message-ID: <53844F50.1040604@tenner.nl> Hi Maximilian, On 05/25/2014 12:17 AM, Maximilian Albert wrote: > Hi Vasco, > > Now I want to use X forwarding show gtk matplotlib windows. This works > as long as I keep the original SSH connection open. However, when I > create a new ssh connection, the "DISPLAY" environment variable should > change. Is there I way I can tell the %matplotlib gtk magic to pass a > certain DISPLAY to gtk? > > > I think it should work if you put the following at the beginning of your > notebook: > > import os > os.environ['DISPLAY'] = ':10' > > (or whatever new display number you now have). Untested right now, but > I'm pretty sure I used it a while back to solve precisely this problem. This works in a new kernel. At this moment, my ipython-kernel crashes as I disconnect the ssh session, after I've run %matplotlib qt. So: %matplotlib qt ssh disconnect -> crash kernel Also %matplotlib qt %matplotlib inline ssh disconnect -> crash kernel Furthermore it look likes it is not possible to change from one to another DISPLAY environment in a running kernel. Vasco From ozancag at gmail.com Tue May 27 11:12:58 2014 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Tue, 27 May 2014 18:12:58 +0300 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> Message-ID: <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> On Thu, Dec 26, 2013 at 7:40 PM, Matthias BUSSONNIER <bussonniermatthias at gmail.com> wrote: > > If I was in your position I would : > > - Search/Ask who is interested would participate in such a translation project. > - Consider that only 5% of people who said will be interested in participating will participate > - depending on the result decide what is worth to do. > > In any case A document that describe in your language IPython and the significance of each term > will be the easiest to update and take the less time. It will be useful even in a translated software to > search for english documentation on the internet. > > If having a way to plug external translation is an minimal patch for IPython itself, we'll be > happy to integrate it. As soon as you add something into IPython itself it will considerably > slow you down as every change will have to go through the core team. > > If a deep change is required, go through an IPython Ehencement Proposal [3]. Hi, I'd be glad to revive this thread after months :) I think I've come up with a minimally invasive patch using the jinja2 extension you have mentioned. I think that it will be very confusing and fragile to set the language using the system locale. It would be better to always default to English unless the language switch is requested by the user. I used the webapp_settings for this like below: $ ipython notebook --NotebookApp.webapp_settings="{'language':'tr_TR'}" And in the notebookapp.py, the following code installs the gettext() functions: # Hack to rapidly include the extension jenv_opt = jinja_env_options if jinja_env_options else {"extensions":["jinja2.ext.i18n"]} env = Environment(loader=FileSystemLoader(template_path),**jenv_opt) # Get the Gettext translation object. If the language switch is not requested, fallback to null, e.g. English. gettext_translations = gettext.translation("ipynotebook", os.path.join(os.path.dirname(__file__), "locale"), [settings_overrides.get("language", "")], fallback=True) env.install_gettext_translations(gettext_translations) I then used to decorate UI strings in the templates/ folder with {% trans %} .. {% endtrans %} and extracted the gettext catalog using pybabel. I can now change the UI language using the cmdline switch to Turkish. Some remarks: - Extraction of translatable strings into catalogs should be done periodically either before releases, or after each introduction of a new translatable UI message, - I used babel for extraction but don't know whether gettext is better. Excited to hear about your comments! Regards, -- Ozan ?a?layan Research Assistant Galatasaray University - Computer Engineering Dept. http://www.ozancaglayan.com From maximilian.albert at gmail.com Tue May 27 11:23:47 2014 From: maximilian.albert at gmail.com (Maximilian Albert) Date: Tue, 27 May 2014 16:23:47 +0100 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? Message-ID: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> Hi all, apologies if this has been asked before - it sounds like such a natural question that I can't imagine it hasn't, but I can't seem to find any information on it (maybe I'm using the wrong keywords for my search). I'm interested in including (converted) IPython notebooks as subsections in a bigger LaTeX document. What is the best way to achieve this? Ideally, I would like to have a .tex document that looks like this: ==> \documentclass{article} % Load the IPython style definitions somehow \begin{document} \section{Introduction} blah blah blah \section{Contents of first notebook} \include{awesome_notebook} \section{Foobar} blah blah blah \section{Contents of second notebook} \include{awesome_notebook_02} % ... some other sections ... \end{document} <== The .tex files for the notebooks would be provided by nbconvert: $ ipython nbconvert --to latex --template inline awesome_notebook.ipynb Obviously the "inline" template doesn't exist (yet), but what I'd like it to do is produce a .tex file of the "bare-bones" contents of the notebook which can just be included in a document like the above. Naturally, I would also need a .tex or .sty file somewhere which provides the commands that usually go into the preamble of the converted notebook. My first thought was to copy the template 'base.tplx' that comes with IPython and adapt it so that it only contains the bits between "\begin{document}" and "\end{document}". The preamble commands could be copied into a separate file that I can then load once in the preamble of my bigger document. However, I was wondering if there is a simpler/more elegant approach, or if anyone has any better ideas how to include notebooks in LaTeX documents? Many thanks and best wishes, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140527/6e6f7179/attachment.html> From alimanfoo at googlemail.com Tue May 27 12:41:03 2014 From: alimanfoo at googlemail.com (Alistair Miles) Date: Tue, 27 May 2014 17:41:03 +0100 Subject: [IPython-dev] Visual representation of SQL extracted data Message-ID: <CAMr-JwZEs8XGXvshWtS4xcOHob8rfaPutLpPFgkqELPPmyZU-Q@mail.gmail.com> Hi Simon, I'm sure you've found this out already, but both pandas [1] and petl [2] implement _repr_html_() such that table-like objects automagically get formatted as HTML tables in the IPython notebook, e.g.: http://nbviewer.ipython.org/gist/alimanfoo/926868c73e18ca7f77b4/tables.ipynb Cheers, Alistair [1] http://pandas.pydata.org/ [2] http://petl.readthedocs.org/ -- Alistair Miles Head of Epidemiological Informatics Centre for Genomics and Global Health <http://cggh.org> The Wellcome Trust Centre for Human Genetics Roosevelt Drive Oxford OX3 7BN United Kingdom Web: http://purl.org/net/aliman Email: alimanfoo at gmail.com Tel: +44 (0)1865 287721 ***new number*** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140527/176ae0ef/attachment.html> From matthew.m.mccormick at gmail.com Tue May 27 16:20:52 2014 From: matthew.m.mccormick at gmail.com (Matthew McCormick) Date: Tue, 27 May 2014 16:20:52 -0400 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? In-Reply-To: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> References: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> Message-ID: <CA+XjkaBhf7BxVeWH+DSi4ayogiQTvoB=XfZxT_79E0RDt13O4w@mail.gmail.com> Hi Max, You might find Dexy [1] convenient for this. Hope this helps, Matt [1] http://dexy.it/ On Tue, May 27, 2014 at 11:23 AM, Maximilian Albert <maximilian.albert at gmail.com> wrote: > Hi all, > > apologies if this has been asked before - it sounds like such a natural > question that I can't imagine it hasn't, but I can't seem to find any > information on it (maybe I'm using the wrong keywords for my search). > > I'm interested in including (converted) IPython notebooks as subsections in > a bigger LaTeX document. What is the best way to achieve this? > > Ideally, I would like to have a .tex document that looks like this: > > ==> > \documentclass{article} > > % Load the IPython style definitions somehow > > \begin{document} > > \section{Introduction} > blah blah blah > > \section{Contents of first notebook} > \include{awesome_notebook} > > \section{Foobar} > blah blah blah > > \section{Contents of second notebook} > \include{awesome_notebook_02} > > % ... some other sections ... > > \end{document} > <== > > The .tex files for the notebooks would be provided by nbconvert: > > $ ipython nbconvert --to latex --template inline awesome_notebook.ipynb > > Obviously the "inline" template doesn't exist (yet), but what I'd like it to > do is produce a .tex file of the "bare-bones" contents of the notebook which > can just be included in a document like the above. Naturally, I would also > need a .tex or .sty file somewhere which provides the commands that usually > go into the preamble of the converted notebook. > > My first thought was to copy the template 'base.tplx' that comes with > IPython and adapt it so that it only contains the bits between > "\begin{document}" and "\end{document}". The preamble commands could be > copied into a separate file that I can then load once in the preamble of my > bigger document. > > However, I was wondering if there is a simpler/more elegant approach, or if > anyone has any better ideas how to include notebooks in LaTeX documents? > > Many thanks and best wishes, > Max > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From aron at ahmadia.net Tue May 27 17:01:44 2014 From: aron at ahmadia.net (Aron Ahmadia) Date: Tue, 27 May 2014 17:01:44 -0400 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? In-Reply-To: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> References: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> Message-ID: <CAPhiW4hW-m+6fyW1UWoYUFDYBgZUVbam-70z9JG-yu02bUVgsQ@mail.gmail.com> On Tue, May 27, 2014 at 11:23 AM, Maximilian Albert < maximilian.albert at gmail.com> wrote: > Hi all, > > apologies if this has been asked before - it sounds like such a natural > question that I can't imagine it hasn't, but I can't seem to find any > information on it (maybe I'm using the wrong keywords for my search). > > I'm interested in including (converted) IPython notebooks as subsections > in a bigger LaTeX document. What is the best way to achieve this? > > Ideally, I would like to have a .tex document that looks like this: > > ==> > \documentclass{article} > > % Load the IPython style definitions somehow > > \begin{document} > > \section{Introduction} > blah blah blah > > \section{Contents of first notebook} > \include{awesome_notebook} > > \section{Foobar} > blah blah blah > > \section{Contents of second notebook} > \include{awesome_notebook_02} > > % ... some other sections ... > > \end{document} > <== > > The .tex files for the notebooks would be provided by nbconvert: > > $ ipython nbconvert --to latex --template inline awesome_notebook.ipynb > > Obviously the "inline" template doesn't exist (yet), but what I'd like it > to do is produce a .tex file of the "bare-bones" contents of the notebook > which can just be included in a document like the above. Naturally, I would > also need a .tex or .sty file somewhere which provides the commands that > usually go into the preamble of the converted notebook. > > My first thought was to copy the template 'base.tplx' that comes with > IPython and adapt it so that it only contains the bits between > "\begin{document}" and "\end{document}". The preamble commands could be > copied into a separate file that I can then load once in the preamble of my > bigger document. > > However, I was wondering if there is a simpler/more elegant approach, or > if anyone has any better ideas how to include notebooks in LaTeX documents? > Max, your approach sounds correct to me. I'm not aware of many simpler/elegant solutions, mostly just "afternoon hacks" :) A -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140527/b7d013cc/attachment.html> From simoncropper at fossworkflowguides.com Tue May 27 20:28:11 2014 From: simoncropper at fossworkflowguides.com (Simon Cropper) Date: Wed, 28 May 2014 10:28:11 +1000 Subject: [IPython-dev] Visual representation of SQL extracted data In-Reply-To: <CAMr-JwZEs8XGXvshWtS4xcOHob8rfaPutLpPFgkqELPPmyZU-Q@mail.gmail.com> References: <CAMr-JwZEs8XGXvshWtS4xcOHob8rfaPutLpPFgkqELPPmyZU-Q@mail.gmail.com> Message-ID: <53852D9B.2010404@fossworkflowguides.com> On 28/05/14 02:41, Alistair Miles wrote: > Hi Simon, > > I'm sure you've found this out already, but both pandas [1] and petl [2] > implement _repr_html_() such that table-like objects automagically get > formatted as HTML tables in the IPython notebook, e.g.: > > http://nbviewer.ipython.org/gist/alimanfoo/926868c73e18ca7f77b4/tables.ipynb > > Cheers, > Alistair > > [1] http://pandas.pydata.org/ > [2] http://petl.readthedocs.org/ > -- > Alistair Miles > Head of Epidemiological Informatics > Centre for Genomics and Global Health <http://cggh.org> > The Wellcome Trust Centre for Human Genetics > Roosevelt Drive > Oxford > OX3 7BN > United Kingdom > Web: http://purl.org/net/aliman > Email: alimanfoo at gmail.com <mailto:alimanfoo at gmail.com> > Tel: +44 (0)1865 287721 ***new number*** Hi Alistar, Thanks for the links. Yes I am currently reading up on pandas but to date no one has mentioned petl. I have looked at the documentation for petl and the package looks interesting. I like your video tutorial. I also like your sample notebook showing how output from pandas and petl are automatically formatted when called in iPython. This is useful to know. -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides ------------------------------------------------------------ Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Python http://www.fossworkflowguides.com/scripting From fperez.net at gmail.com Tue May 27 22:29:05 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 27 May 2014 19:29:05 -0700 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> Message-ID: <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> On Tue, May 27, 2014 at 8:12 AM, Ozan ?a?layan <ozancag at gmail.com> wrote: > I'd be glad to revive this thread after months :) > I think I've come up with a minimally invasive patch using the jinja2 > extension you have mentioned. > Since you are at the point of having a patch, the ideal way forward is to open it as a pull request on github. That will make it possible for everyone to evaluate how invasive the changes would be. This is a really tricky cost-benefit analysis: we undeniably want to make IPython friendlier to non-English speakers (as I should be, given English isn't even my second language...). But at the same time, I worry a lot about how intrusive these i18n changes can potentially be into the entire codebase, so we'll have to tiptoe very carefully into this one... Cheers, f -- Fernando Perez (@fperez_org; http://fperez.org) fperez.net-at-gmail: mailing lists only (I ignore this when swamped!) fernando.perez-at-berkeley: contact me here for any direct mail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140527/6572c67a/attachment.html> From fperez.net at gmail.com Tue May 27 22:30:14 2014 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 27 May 2014 19:30:14 -0700 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? In-Reply-To: <CAPhiW4hW-m+6fyW1UWoYUFDYBgZUVbam-70z9JG-yu02bUVgsQ@mail.gmail.com> References: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> <CAPhiW4hW-m+6fyW1UWoYUFDYBgZUVbam-70z9JG-yu02bUVgsQ@mail.gmail.com> Message-ID: <CAHAreOqyLeDunCw0NucboUKsdP98MinZnsv6jEFiXae3Yym7hw@mail.gmail.com> On Tue, May 27, 2014 at 2:01 PM, Aron Ahmadia <aron at ahmadia.net> wrote: > > Max, your approach sounds correct to me. I'm not aware of many > simpler/elegant solutions, mostly just "afternoon hacks" :) > Yup, sounds about right too... Those templates are precisely meant to be modified by end users with use cases like the above... Cheers, f -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140527/e4657a78/attachment.html> From bussonniermatthias at gmail.com Wed May 28 02:17:31 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 28 May 2014 08:17:31 +0200 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? In-Reply-To: <CAHAreOqyLeDunCw0NucboUKsdP98MinZnsv6jEFiXae3Yym7hw@mail.gmail.com> References: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> <CAPhiW4hW-m+6fyW1UWoYUFDYBgZUVbam-70z9JG-yu02bUVgsQ@mail.gmail.com> <CAHAreOqyLeDunCw0NucboUKsdP98MinZnsv6jEFiXae3Yym7hw@mail.gmail.com> Message-ID: <3F00CFD7-6745-4194-A0E4-6B92F86E5EA4@gmail.com> Le 28 mai 2014 ? 04:30, Fernando Perez a ?crit : > > On Tue, May 27, 2014 at 2:01 PM, Aron Ahmadia <aron at ahmadia.net> wrote: > > Max, your approach sounds correct to me. I'm not aware of many simpler/elegant solutions, mostly just "afternoon hacks" :) > > Yup, sounds about right too... Those templates are precisely meant to be modified by end users with use cases like the above? better than copy and pasting you can just inherit ((* extend ?. *)) at the top of the templates, and only overwrite the blocks you need. usually you can just overwrote the blocks you don't want with empty blocks, put the new file in current working directory and run nbconvert with the --template=mytemplate options. It should work. -- M > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/97f9747d/attachment.html> From benjamin.ninassi at inria.fr Wed May 28 08:32:00 2014 From: benjamin.ninassi at inria.fr (Benjamin Ninassi) Date: Wed, 28 May 2014 14:32:00 +0200 (CEST) Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <303154878.4574181.1401279475343.JavaMail.zimbra@inria.fr> Message-ID: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> Hello there, It's a great work you're doing ! I intend??to use notebooks for making exercices in a mooc and i have 2 questions for notebooks customizations : - is-it possible to "disable" the edition of some cells in browsers, maybe with some parameters in the json ? I'd like to get within a browser a notebook with some cells non-editable (instructions) et some cells editable (code for execution) but i can't find how to do this ... - i've tried to use the custom.js file to hide the top panel, doing : $([IPython.events]).on('notebook_loaded.Notebook', function(){ $('div#header').hide() $('div#menubar').hide() IPython.layout_manager.do_resize(); }) but the panels appears quickly before hiding - not nice :/ Is-there another way to do this where the panels that i want to hide don't show at all, or making a loading picture appears while the page is loading, and replace it when the page is completely loaded ? I can't find a list of the IPython.events ... or maybe by css ? Thanks ! Benjamin From bussonniermatthias at gmail.com Wed May 28 09:08:26 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 28 May 2014 15:08:26 +0200 Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> References: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> Message-ID: <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> Le 28 mai 2014 ? 14:32, Benjamin Ninassi a ?crit : > Hello there, > > It's a great work you're doing ! > > I intend??to use notebooks for making exercices in a mooc and i have 2 questions for notebooks customizations : > - is-it possible to "disable" the edition of some cells in browsers, maybe with some parameters in the json ? I'd like to get within a browser a notebook with some cells non-editable (instructions) et some cells editable (code for execution) but i can't find how to do this ? It should be possible by directly setting the read-only mode to some cell in CodeMiror itself, but it will require a bit of javscript: http://codemirror.net/doc/manual.html#option_readOnly > - i've tried to use the custom.js file to hide the top panel, doing : > > $([IPython.events]).on('notebook_loaded.Notebook', function(){ > $('div#header').hide() > $('div#menubar').hide() > IPython.layout_manager.do_resize(); > }) > > but the panels appears quickly before hiding - not nice :/ > Is-there another way to do this where the panels that i want to hide don't show at all, or making a loading picture appears while the page is loading, and replace it when the page is completely loaded ? I suppose css with the same target and display:none in custom.css should works. > I can't find a list of the IPython.events ... or maybe by css ? No, there is no list. You can grep through the source for IPython.events out should give yo an idea of existing event, The rest depend if when using IPython for a MOOC you will be providing the sever,in which case you can customize it a lot or if you plan on users to install IPython in which case you probably want to avoid too aggressive customization. -- Matthias > > Thanks ! > > Benjamin > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/38a168aa/attachment.html> From benjamin.ninassi at inria.fr Wed May 28 09:22:57 2014 From: benjamin.ninassi at inria.fr (Benjamin Ninassi) Date: Wed, 28 May 2014 15:22:57 +0200 (CEST) Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> References: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> Message-ID: <1802796805.4584624.1401283377845.JavaMail.zimbra@inria.fr> Thanks a lot for your quick answears ! > It should be possible by directly setting the read-only mode to some cell in > CodeMiror itself, but it will require a bit of javscript: > http://codemirror.net/doc/manual.html#option_readOnly I'll drill into that, thanks ! My major issue will be to identify the cells that i want to disable through the DOM as they have no ID ... is-it possible to give them one with metadata ? > I suppose css with the same target and display:none in custom.css should > works. I was supposing that to, but there is a style="display: block;" generated in the html for the header div that overwrite the custom.css #header{ display:none; } ... > No, there is no list. You can grep through the source for IPython.events out > should give yo an idea of existing event, > The rest depend if when using IPython for a MOOC you will be providing the > sever,in which case you can customize it a lot > or if you plan on users to install IPython in which case you probably want to > avoid too aggressive customization. We will be providing a server, so we can customize it a lot. I'm convince ipython and notebooks are great tools for online education, providing some minor adjustements ! Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/20475d05/attachment.html> From bussonniermatthias at gmail.com Wed May 28 09:49:27 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 28 May 2014 15:49:27 +0200 Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <1802796805.4584624.1401283377845.JavaMail.zimbra@inria.fr> References: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> <1802796805.4584624.1401283377845.JavaMail.zimbra@inria.fr> Message-ID: <A04B9CE8-9232-4FFF-8282-7AB80C8F0257@gmail.com> Le 28 mai 2014 ? 15:22, Benjamin Ninassi a ?crit : > Thanks a lot for your quick answears ! > > It should be possible by directly setting the read-only mode to some cell in CodeMiror itself, but it will require a bit of javscript: > > http://codemirror.net/doc/manual.html#option_readOnly > I'll drill into that, thanks ! My major issue will be to identify the cells that i want to disable through the DOM as they have no ID ... is-it possible to give them one with metadata ? You cannot (yet) get a dom identity through the metadata, but you can a list of sell by IPython.notebook.get_cells() then loop on all cell and on each cell do approximatively a var ro = (cell.metadata.my_namespace || {}).readonly if(ro === true): cell.editor.set_options('readOnly','nocursor') Which should do the desired effect. You might want to capture a few other event like execution request on theses cell by monkey patching the CellClass.prototype.execute CellClass.prototype.old_execute = CellClass.prototype.execute CellClass.prototype.execute = function(){ if not read only : this.old_execute(arguments) } > I suppose css with the same target and display:none in custom.css should works. > I was supposing that to, but there is a style="display: block;" generated in the html for the header div that overwrite the custom.css > #header{ display:none; } ? Hum, we should probably fix that then. > No, there is no list. You can grep through the source for IPython.events out should give yo an idea of existing event, > > The rest depend if when using IPython for a MOOC you will be providing the sever,in which case you can customize it a lot > or if you plan on users to install IPython in which case you probably want to avoid too aggressive customization. > We will be providing a server, so we can customize it a lot. I'm convince ipython and notebooks are great tools for online education, providing some minor adjustments ! Then you can probably apply a patch on the template to remove whatever element for the time being. We'll be happy to get your feedback from using the notebook for teaching. -- M From ozancag at gmail.com Wed May 28 10:44:15 2014 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Wed, 28 May 2014 17:44:15 +0300 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> Message-ID: <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> > > That will make it possible for everyone to evaluate how invasive the changes > would be. This is a really tricky cost-benefit analysis: we undeniably want > to make IPython friendlier to non-English speakers (as I should be, given > English isn't even my second language...). But at the same time, I worry a > lot about how intrusive these i18n changes can potentially be into the > entire codebase, so we'll have to tiptoe very carefully into this one... Hi, Well I prepared a branch out of the current master to test what I've done yesterday and I noticed a (big?) problem: There are UI strings in .js files too. Well this is annoying as client-side JS can't access the binary gettext catalogs. There are libraries like Jed for JS translation with which you convert the translated gettext catalogs to json and embed the translations inside a js file which is loaded during runtime. What do you think? Is there a way to provide those strings in html templates or was it mandatory to have them in .js code? An example is the tour.js for example. Or modal dialogs from savewidget.js Thanks! From benjamin.ninassi at inria.fr Wed May 28 10:56:41 2014 From: benjamin.ninassi at inria.fr (Benjamin Ninassi) Date: Wed, 28 May 2014 16:56:41 +0200 (CEST) Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <A04B9CE8-9232-4FFF-8282-7AB80C8F0257@gmail.com> References: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> <1802796805.4584624.1401283377845.JavaMail.zimbra@inria.fr> <A04B9CE8-9232-4FFF-8282-7AB80C8F0257@gmail.com> Message-ID: <553717637.4600670.1401289001244.JavaMail.zimbra@inria.fr> Again thanks a lot, I made it work with this snipet of code in custom.js (for the record if someone search through this thread): $([IPython.events]).on('notebook_loaded.Notebook', function(){ var cells = IPython.notebook.get_cells(); for(var i in cells){ var cell = cells[i]; if (!(cell instanceof IPython.CodeCell)) { cell.code_mirror.setOption('readOnly','nocursor'); } } }) I'll be happy to provide you with feedback ! We're preparing a Mooc on robotic with some python exercices that will be available on the governmental french Mooc plateform https://www.france-universite-numerique-mooc.fr/ (which is based on EDX) at the end of the year, and we were looking for a solution to allow student to quickly be able to do the exercices without having to install python and all the stuff (numpy, matplotlib and so on) on their computer. Skulpt and other javascript librairy still can't be used with numpy, so I turned on server-side execution with ipython. And I'm pretty sure now that ipython will do the trick. :) We may also add some automatic evaluation to, I'll keep you inform on our progress ! -- Benjamin Ninassi INRIA - SEISM & Mooclab T?l. (+33) 02 99 84 73 43 benjamin.ninassi at inria.fr ----- Mail original ----- > De: "Matthias BUSSONNIER" <bussonniermatthias at gmail.com> > ?: "IPython developers list" <ipython-dev at scipy.org> > Envoy?: Mercredi 28 Mai 2014 15:49:27 > Objet: Re: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process > > > Le 28 mai 2014 ? 15:22, Benjamin Ninassi a ?crit : > > > Thanks a lot for your quick answears ! > > > > It should be possible by directly setting the read-only mode to some cell > > in CodeMiror itself, but it will require a bit of javscript: > > > > http://codemirror.net/doc/manual.html#option_readOnly > > I'll drill into that, thanks ! My major issue will be to identify the cells > > that i want to disable through the DOM as they have no ID ... is-it > > possible to give them one with metadata ? > > You cannot (yet) get a dom identity through the metadata, but you can a list > of sell by > > IPython.notebook.get_cells() > > then loop on all cell and on each cell do approximatively a > > var ro = (cell.metadata.my_namespace || {}).readonly > > if(ro === true): > cell.editor.set_options('readOnly','nocursor') > > Which should do the desired effect. > You might want to capture a few other event like execution request on theses > cell by monkey patching > the CellClass.prototype.execute > > CellClass.prototype.old_execute = CellClass.prototype.execute > CellClass.prototype.execute = function(){ > if not read only : > this.old_execute(arguments) > > } > > > > > > > I suppose css with the same target and display:none in custom.css should > > works. > > I was supposing that to, but there is a style="display: block;" generated > > in the html for the header div that overwrite the custom.css > > #header{ display:none; } ? > > Hum, we should probably fix that then. > > > No, there is no list. You can grep through the source for IPython.events > > out should give yo an idea of existing event, > > > > The rest depend if when using IPython for a MOOC you will be providing the > > sever,in which case you can customize it a lot > > or if you plan on users to install IPython in which case you probably want > > to avoid too aggressive customization. > > We will be providing a server, so we can customize it a lot. I'm convince > > ipython and notebooks are great tools for online education, providing some > > minor adjustments ! > > Then you can probably apply a patch on the template to remove whatever > element for the time being. > We'll be happy to get your feedback from using the notebook for teaching. > > -- > M > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From bussonniermatthias at gmail.com Wed May 28 11:04:53 2014 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 28 May 2014 17:04:53 +0200 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> Message-ID: <4C642653-B886-453E-A256-A5361829455E@gmail.com> Hi Ozan, Internationalization is a complex process and by lack of manpower we default to not doing any work on this side (not that any of us are not native english speaker). This mean that we haven't really looked into the way of doing that both on python side and javacript side. You seem to be already more aware of the tool existing so any input in what is possible/necessary is appreciated and can be made part of a pull request. If you prefer you can even send a PR for the pure python side, and one for the js side, that is up to you. As Fernando said, we have nothing against including the necessary infrastructure to help translation as long as it stays a relatively-low overhead for our development. I suppose we can even find ways to have separate python packages for translation that can be maintained orthogonally as the Main IPython project. Le 28 mai 2014 ? 16:44, Ozan ?a?layan a ?crit : > Hi, > > Well I prepared a branch out of the current master to test what I've > done yesterday and I noticed a (big?) problem: There are UI strings in > .js files too. Well this is annoying as client-side JS can't access > the binary gettext catalogs. > There are libraries like Jed for JS > translation with which you convert the translated gettext catalogs to > json and embed the translations inside a js file which is loaded > during runtime. We do ship require.js, there is a plugin i suppose we can ship the extension to require json file. Though it will require some refactoring of or library to use require.js, but they will be done eventually. if it is easier to just have a templated include in the html template, then just go with it, I think as a first step, having to restart the server to change lang is not such a big deal. > What do you think? Is there a way to provide those strings in html > templates or was it mandatory to have them in .js code? An example is > the tour.js for example. Or modal dialogs from savewidget.js What I would suggest is to do a pull request with what you have now, then post a link here. People that are interested can join the PR and it is alway easier to discuss on concrete example, comment on code, and iterate over it than to argue on abstract ideas. Especially if you already have something in your sleeves. -- M http://requirejs.org/docs/api.html#i18n > > Thanks! > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/2297220c/attachment.html> From doug.blank at gmail.com Wed May 28 11:30:22 2014 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 28 May 2014 11:30:22 -0400 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <4C642653-B886-453E-A256-A5361829455E@gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> <4C642653-B886-453E-A256-A5361829455E@gmail.com> Message-ID: <CAAusYCjfT-_KnTZEUKZGTi6NW7GBu+XCE4Jfr8dCppC0cujBFQ@mail.gmail.com> On Wed, May 28, 2014 at 11:04 AM, Matthias BUSSONNIER < bussonniermatthias at gmail.com> wrote: > Hi Ozan, > > Internationalization is a complex process and by lack of manpower we > default > to not doing any work on this side (not that any of us are not native > english speaker). > This mean that we haven't really looked into the way of doing that both on > python side > and javacript side. > > You seem to be already more aware of the tool existing so any input in > what is > possible/necessary is appreciated and can be made part of a pull request. > If you prefer you can even send a PR for the pure python side, and one for > the js side, > that is up to you. > > As Fernando said, we have nothing against including the necessary > infrastructure > to help translation as long as it stays a relatively-low overhead for our > development. > I suppose we can even find ways to have separate python packages for > translation > that can be maintained orthogonally as the Main IPython project. > > Le 28 mai 2014 ? 16:44, Ozan ?a?layan a ?crit : > > Hi, > > Well I prepared a branch out of the current master to test what I've > done yesterday and I noticed a (big?) problem: There are UI strings in > .js files too. Well this is annoying as client-side JS can't access > the binary gettext catalogs. > > > There are libraries like Jed for JS > translation with which you convert the translated gettext catalogs to > json and embed the translations inside a js file which is loaded > during runtime. > > > We do ship require.js, there is a plugin i suppose we can ship the > extension to require json file. > Though it will require some refactoring of or library to use require.js, > but they will be done eventually. > if it is easier to just have a templated include in the html template, > then just go with it, > I think as a first step, having to restart the server to change lang is > not such a big deal. > > > What do you think? Is there a way to provide those strings in html > templates or was it mandatory to have them in .js code? An example is > the tour.js for example. Or modal dialogs from savewidget.js > > > What I would suggest is to do a pull request with what you have now, > then post a link here. People that are interested can join the PR > and it is alway easier to discuss on concrete example, comment on code, > and iterate over it than to argue on abstract ideas. Especially if you > already > have something in your sleeves. > I am also interested in making the IPython infrastructure work with multiple human languages and cultures (internationalization I18n, and localization l10n). Glad to see the work on this front! Having worked on other open source projects that allow other languages, some things we all might consider: 1) gettext is the most widely used system in the open source world, and has countless tools and support for extracting text, and allowing different languages to be packaged up by external translators. It is also very fast, as it caches translations. 2) It can be a little tricky with gettext, but it is possible to change languages on the fly, or to have different notebooks in different languages, for example. Getting it to work with a single, static language can be a good first step, but many users will no doubt want to change more dynamically. 3) I think that there are four components of an IPython system that may need three methods: HTML, JavaScript, the server, and the kernel. Remember that the decimal place separation, and dates can change syntactical format, in addition to just changing text. Also, there are other kernels beyond CPython, which might change even more in a different language context. 4) Windows may be the trickiest environment to work with gettext, but it can be done. 5) This is a fairly well-known problem, although IPython has some unique issues. It might be good to discuss the overall design and proposed dependencies. -Doug > -- > M > http://requirejs.org/docs/api.html#i18n > > > > > Thanks! > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/58a50f5d/attachment.html> From bussonniermatthias at gmail.com Wed May 28 12:16:58 2014 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Wed, 28 May 2014 18:16:58 +0200 Subject: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process In-Reply-To: <553717637.4600670.1401289001244.JavaMail.zimbra@inria.fr> References: <226351764.4576759.1401280320772.JavaMail.zimbra@inria.fr> <9E2514D7-E1E3-4714-A3DA-DE78AB009F5D@gmail.com> <1802796805.4584624.1401283377845.JavaMail.zimbra@inria.fr> <A04B9CE8-9232-4FFF-8282-7AB80C8F0257@gmail.com> <553717637.4600670.1401289001244.JavaMail.zimbra@inria.fr> Message-ID: <E4102552-7B90-470E-A80E-24087B115642@gmail.com> Le 28 mai 2014 ? 16:56, Benjamin Ninassi a ?crit : > Again thanks a lot, I made it work with this snipet of code in custom.js (for the record if someone search through this thread): > > $([IPython.events]).on('notebook_loaded.Notebook', function(){ > var cells = IPython.notebook.get_cells(); > for(var i in cells){ > var cell = cells[i]; > if (!(cell instanceof IPython.CodeCell)) { > cell.code_mirror.setOption('readOnly','nocursor'); > } > } > }) Be careful, with that if your student insert some markdown cell and reload it will prevent him/her from editing. If you wrap it in a extension, you can probably make a pull request there : https://github.com/ipython-contrib/IPython-notebook-extensions > I'll be happy to provide you with feedback ! > > We're preparing a Mooc on robotic with some python exercices that will be available on the governmental french Mooc plateform https://www.france-universite-numerique-mooc.fr/ > (which is based on EDX) at the end of the year, and we were looking for a solution to allow student to quickly be able to do the exercices without having to install python and all the stuff (numpy, matplotlib and so on) on their computer. Oh, great, will it be integrated into France-OS [1] ? > Skulpt and other javascript librairy still can't be used with numpy, so I turned on server-side execution with ipython. > And I'm pretty sure now that ipython will do the trick. :) Also please use Python 3 :-) You might want to have a look at ipydra [2] for deployment. > We may also add some automatic evaluation to, I'll keep you inform on our progress ! You should speak with : - Jessica Hamrick who did something similar [3] Miscs : General thing in english stuff You might want to contact - Greg Wilson from software carpentry/Mozilla with whom you will share some interest in using notebook to teach - Mit Teach Julia using IPython notebook, they have custom stuff, you might want to ping the Julia List. I think that Aaron Culich at Berkeley EECS also probably made some mass deployment of IPython notebook. - People from SageMath might be of help too as they have online IPython notebook. - I prefer not to include link to companies, but ContinuumIO might also be of help as they already deploy wakari. Though, they will probably offer you to go with wakari enterprise[6]. (No explicit contact info private mail me if you can't find) More French specific stuff You might want to contact - Emanuelle Gouillart and Gael Varoquaux who worked on python pour les classes pr?paratoires [4]. (python for undergraduate student french program) They are near Paris though. - Pierre Haessig was involved too in above project IIRC, and should be near you (at Bruz near Rennes), but is finishing his PhD, so might be busy[5]. - Enthought do not have python in the cloud IIRC, but do have French people in their team (Jonathan Rocher at least) which is great if you need support. they are also more hardware oriented than continuum from the demo I have seen, which tend to be better for robotics IIUC. - You might want to join the other thread on internationalization as I know by experience that french student tend to not speak english very well until pretty late (Stargate-SG1 you did a better job than my english teacher) Shameless plug at the end, especially because this seem to be a big project, and also there seem to be some buzz[8] around notre cher Ministre de l'?conomie, du Redressement productif et du Num?rique[7]. We would highly appreciate any contribution on IPython and Open Source community, even more if you could make your hierarchy understand that and officially put some extra people (obviously you are already part of them) or fund to help. If there is any need for someone from the IPython to come to convince peoples, even despite [5], I am in France (for the time being), and Fernando P?rez, speak a a perfect French, so I suppose if it is to convince a government agency to fund a project, he might find some free time. There are also a handful of French speaking people from the SciPy stack I can think of that are around, and I guess could be of help. -- M > > -- > Benjamin Ninassi > INRIA - SEISM & Mooclab > T?l. (+33) 02 99 84 73 43 > benjamin.ninassi at inria.fr [1] http://korben.info/franceos.html <- french, stupid bad joke [2] https://github.com/UnataInc/ipydra [3] https://twitter.com/jhamrick/statuses/463930083447566336 [4] https://github.com/python-prepa/python-prepa (fr) [5] i am too and i spend to much time on IPython ML. [6] http://enterprise.wakari.io/ [7] https://fr.wikipedia.org/wiki/Arnaud_Montebourg (fr) [8] http://www.numerama.com/magazine/29490-orange-travaille-deja-a-l-os-34made-in-france34-voulu-par-montebourg.html (fr) > > ----- Mail original ----- >> De: "Matthias BUSSONNIER" <bussonniermatthias at gmail.com> >> ?: "IPython developers list" <ipython-dev at scipy.org> >> Envoy?: Mercredi 28 Mai 2014 15:49:27 >> Objet: Re: [IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process >> >> >> Le 28 mai 2014 ? 15:22, Benjamin Ninassi a ?crit : >> >>> Thanks a lot for your quick answears ! >>> >>> It should be possible by directly setting the read-only mode to some cell >>> in CodeMiror itself, but it will require a bit of javscript: >>> >>> http://codemirror.net/doc/manual.html#option_readOnly >>> I'll drill into that, thanks ! My major issue will be to identify the cells >>> that i want to disable through the DOM as they have no ID ... is-it >>> possible to give them one with metadata ? >> >> You cannot (yet) get a dom identity through the metadata, but you can a list >> of sell by >> >> IPython.notebook.get_cells() >> >> then loop on all cell and on each cell do approximatively a >> >> var ro = (cell.metadata.my_namespace || {}).readonly >> >> if(ro === true): >> cell.editor.set_options('readOnly','nocursor') >> >> Which should do the desired effect. >> You might want to capture a few other event like execution request on theses >> cell by monkey patching >> the CellClass.prototype.execute >> >> CellClass.prototype.old_execute = CellClass.prototype.execute >> CellClass.prototype.execute = function(){ >> if not read only : >> this.old_execute(arguments) >> >> } >> >> >> >> >> >>> I suppose css with the same target and display:none in custom.css should >>> works. >>> I was supposing that to, but there is a style="display: block;" generated >>> in the html for the header div that overwrite the custom.css >>> #header{ display:none; } ? >> >> Hum, we should probably fix that then. >> >>> No, there is no list. You can grep through the source for IPython.events >>> out should give yo an idea of existing event, >>> >>> The rest depend if when using IPython for a MOOC you will be providing the >>> sever,in which case you can customize it a lot >>> or if you plan on users to install IPython in which case you probably want >>> to avoid too aggressive customization. >>> We will be providing a server, so we can customize it a lot. I'm convince >>> ipython and notebooks are great tools for online education, providing some >>> minor adjustments ! >> >> Then you can probably apply a patch on the template to remove whatever >> element for the time being. >> We'll be happy to get your feedback from using the notebook for teaching. >> >> -- >> M >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/b3cbe03a/attachment.html> From bussonniermatthias at gmail.com Wed May 28 12:45:49 2014 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Wed, 28 May 2014 18:45:49 +0200 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <CAAusYCjfT-_KnTZEUKZGTi6NW7GBu+XCE4Jfr8dCppC0cujBFQ@mail.gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> <4C642653-B886-453E-A256-A5361829455E@gmail.com> <CAAusYCjfT-_KnTZEUKZGTi6NW7GBu+XCE4Jfr8dCppC0cujBFQ@mail.gmail.com> Message-ID: <FEED3A9D-E7DE-46AB-B9A8-8768F3F2CECD@gmail.com> > Le 28 mai 2014 ? 16:44, Ozan ?a?layan a ?crit : >> > > > 3) I think that there are four components of an IPython system that may need three methods: HTML, JavaScript, the server, and the kernel. Remember that the decimal place separation, and dates can change syntactical format, in addition to just changing text. Also, there are other kernels beyond CPython, which might change even more in a different language context. Decimal place and separation should **never** be internationalized. (except maybe in non selectable, carefully chosen UI element) I reserve a special place in hell for people that make things like that happen through OS or Software upgrade. In a more calm way, I do think that internationalization of a kernel is a bad idea. You shouldn't have half internationalized things. And because of the huge amount library you will not be able to fully translate kernels. Beside, especially in software, you can easily translate things in the wrong way which hurt googlability and leads to things like "Ouvrir le Panda Roux" (which read as rip open the red panda) instead of Launch FireFox [1] I do not know about your experience in having non-english software installed, but it is the bane of the existence of most researcher in my lab. Special though to my ex-officemate that had German Laptop/os, with a French-translated Software, manual in english and had to type greek-like things sometime. I know of at least 1 os manufacturer that did it almost right, on my computer I can actually do `cd Desktop`, and it put me on the folder "Bureau", or search "keychain" and it finds the "Trousseau d'access". So it Does display one thing but search also in the english-invisible string which partially help. -- M [1] No firefox is not Renard de feu : http://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/2b8fd028/attachment.html> From doug.blank at gmail.com Wed May 28 14:03:11 2014 From: doug.blank at gmail.com (Doug Blank) Date: Wed, 28 May 2014 14:03:11 -0400 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <FEED3A9D-E7DE-46AB-B9A8-8768F3F2CECD@gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> <4C642653-B886-453E-A256-A5361829455E@gmail.com> <CAAusYCjfT-_KnTZEUKZGTi6NW7GBu+XCE4Jfr8dCppC0cujBFQ@mail.gmail.com> <FEED3A9D-E7DE-46AB-B9A8-8768F3F2CECD@gmail.com> Message-ID: <CAAusYCjqfHCFOZz4Lx4NqV9Zd+djS2y_BUTtwR25gtbXzqX1Sg@mail.gmail.com> On Wed, May 28, 2014 at 12:45 PM, Matthias Bussonnier < bussonniermatthias at gmail.com> wrote: > > Le 28 mai 2014 ? 16:44, Ozan ?a?layan a ?crit : >> >> >> > 3) I think that there are four components of an IPython system that may > need three methods: HTML, JavaScript, the server, and the kernel. Remember > that the decimal place separation, and dates can change syntactical format, > in addition to just changing text. Also, there are other kernels beyond > CPython, which might change even more in a different language context. > > > > Decimal place and separation should **never** be internationalized. > (except maybe in non selectable, carefully chosen UI element) > I reserve a special place in hell for people that make things like that > happen through OS or Software upgrade. > > In a more calm way, I do think that internationalization of a kernel is a > bad idea. You shouldn't have half internationalized > things. And because of the huge amount library you will not be able to > fully translate kernels. > The kinds of things that I would be interested in translating in the kernel would be items like help and doc-strings. When working with students learning to program (especially kids), error messages may also need to be translated (although that has different implications). But I can also imagine a visual programming language that has text on the blocks. I would think those would be translated too. But those are issues for the kernel to determine. > Beside, especially in software, you can easily translate things in the > wrong way which hurt googlability and leads to things like > > "Ouvrir le Panda Roux" (which read as rip open the red panda) instead of > Launch FireFox [1] > Writing text that can be translated, and developing the associated translations is a process very similar to coding... definitely something that can be debugged and get better over time. > I do not know about your experience in having non-english software > installed, but it is the bane of the existence > of most researcher in my lab. Special though to my ex-officemate that had > German Laptop/os, with a French-translated > Software, manual in english and had to type greek-like things sometime. > > I know of at least 1 os manufacturer that did it almost right, on my > computer I can actually do > `cd Desktop`, and it put me on the folder "Bureau", or search "keychain" > and it finds the "Trousseau d'access". > So it Does display one thing but search also in the english-invisible > string which partially help. > Funny! Probably don't want to do it almost right :) -Doug > > -- > M > > [1] No firefox is not Renard de feu : > http://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/ef4b8cab/attachment.html> From maximilian.albert at gmail.com Wed May 28 17:43:01 2014 From: maximilian.albert at gmail.com (Maximilian Albert) Date: Wed, 28 May 2014 22:43:01 +0100 Subject: [IPython-dev] Including IPython notebooks as subsections in a LaTeX document? In-Reply-To: <3F00CFD7-6745-4194-A0E4-6B92F86E5EA4@gmail.com> References: <CAGA_dmg_avQv0E5MROUV5JDRzPGtWgadCd-Ss1PgDHvvAzs=jw@mail.gmail.com> <CAPhiW4hW-m+6fyW1UWoYUFDYBgZUVbam-70z9JG-yu02bUVgsQ@mail.gmail.com> <CAHAreOqyLeDunCw0NucboUKsdP98MinZnsv6jEFiXae3Yym7hw@mail.gmail.com> <3F00CFD7-6745-4194-A0E4-6B92F86E5EA4@gmail.com> Message-ID: <CAGA_dmhShwTsP6fu9KKGYxC6AZFCr1u4sRo8TtaAnQVAcSpiGQ@mail.gmail.com> Hi all, thanks for the quick and helpful replies. I managed to get something to work by copying & pasting a few existing templates. I tried to inherit from them but didn't quite manage to get the desired effect (possibly due to my inexperience with Jinja). I won't have time to dig deeper before next week but will take a closer look then to see if I missed something obvious. I also had some (unrelated) problems with including external images which didn't show up in the converted LaTeX source, but I may discuss this separately next week. @Matthew: Dexy looks very interesting indeed. I remember I had come across it before but forgotten about it. I found a post [1] by Brian Granger from a year ago where he said he might try to use it in conjunction with the IPython notebook. Has anything come of this? Or are there other examples available that it might be useful to follow? Thanks again and best regards, Max [1] http://mail.scipy.org/pipermail/ipython-user/2013-June/012815.html 2014-05-28 7:17 GMT+01:00 Matthias BUSSONNIER <bussonniermatthias at gmail.com> : > > Le 28 mai 2014 ? 04:30, Fernando Perez a ?crit : > > > On Tue, May 27, 2014 at 2:01 PM, Aron Ahmadia <aron at ahmadia.net> wrote: > >> >> Max, your approach sounds correct to me. I'm not aware of many >> simpler/elegant solutions, mostly just "afternoon hacks" :) >> > > Yup, sounds about right too... Those templates are precisely meant to be > modified by end users with use cases like the above? > > > better than copy and pasting you can just inherit ((* extend ?. *)) at the > top of the templates, and only overwrite the blocks you need. > > usually you can just overwrote the blocks you don't want with empty > blocks, put the new file in current working directory and run nbconvert > with the --template=mytemplate options. It should work. > > -- > M > > > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/747ce19e/attachment.html> From ozancag at gmail.com Thu May 29 05:26:02 2014 From: ozancag at gmail.com (=?UTF-8?B?T3phbiDDh2HEn2xheWFu?=) Date: Thu, 29 May 2014 12:26:02 +0300 Subject: [IPython-dev] Internationalisation and creating domain specific Help items In-Reply-To: <CAAusYCjqfHCFOZz4Lx4NqV9Zd+djS2y_BUTtwR25gtbXzqX1Sg@mail.gmail.com> References: <CAL81uW6DjAhEXixNPtTDbFLao_pXEdLBQtyzU9F4p0ETJg1L5Q@mail.gmail.com> <C0755E48-FF96-4488-86EC-2BF8F18ED50E@gmail.com> <CAFub=KRO=hnhshXJ8A7i6bCpC-E1GGsk-U=RBeOAceRyc3SM7Q@mail.gmail.com> <CAHAreOo2=LZHc_jM47X8trCnfZeAoHmMQyPA01PAAVz0KKfhbA@mail.gmail.com> <CAFub=KSSSCiOF66uw_tCLNO-fyov_auBhYzdCAHHXSXYG62p3Q@mail.gmail.com> <4C642653-B886-453E-A256-A5361829455E@gmail.com> <CAAusYCjfT-_KnTZEUKZGTi6NW7GBu+XCE4Jfr8dCppC0cujBFQ@mail.gmail.com> <FEED3A9D-E7DE-46AB-B9A8-8768F3F2CECD@gmail.com> <CAAusYCjqfHCFOZz4Lx4NqV9Zd+djS2y_BUTtwR25gtbXzqX1Sg@mail.gmail.com> Message-ID: <CAFub=KR8A5nDRtu5feEM+yeQ6-ZtdVZ3FrZmDGbfYhuWrMx4yg@mail.gmail.com> Hi, Here's the pull request: https://github.com/ipython/ipython/pull/5922 From telnet2 at gmail.com Thu May 29 11:15:48 2014 From: telnet2 at gmail.com (Joohwi Lee) Date: Thu, 29 May 2014 11:15:48 -0400 Subject: [IPython-dev] ipython notebook access log Message-ID: <CAM_upJSTvFz9pLO1eSrM568pC3uCuJFVFxS76-BYbEvTA4vfWg@mail.gmail.com> Hello, I've tried to find out how to configure the iPython notebook to store access logs into a separate files. Among several logs, I want to store [tornado.access] logs into tornado.access.log. Does anyone let me know how to set up this? In addition, I would like to include remote ip addresses in the access log. Hope any help! Thanks in advance, Best regards, Joowhi Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140529/a6c80186/attachment.html> From claresloggett at gmail.com Sat May 31 05:05:52 2014 From: claresloggett at gmail.com (Clare Sloggett) Date: Sat, 31 May 2014 19:05:52 +1000 Subject: [IPython-dev] Sourcing a javascript file from a notebook, and writing local javascript Message-ID: <CAETqNqF2wwg53tGvXWD+09bfVs8P98P6NhY3mcuPfXNZ3hiquA@mail.gmail.com> Hi all, I was playing around with embeddable javascript libraries and seeing if I could make use them from a Notebook. My first attempt was to try the simplest thing possible; embed it in a markdown cell. The javascript I was trying to embed wants to both source an external file, and then use it via some local javascript code, like <script language="javascript" src="http://some-url/library.js"></script> <script language="javascript"> ... code ... </script> In Notebook 1.x, the local code executes but throws an error about undefined variables, suggesting that the external javascript file was not loaded. Is this expected? In Notebook 2.0, so far as I can tell, none of it executes at all. Am I right in thinking that embedding Javascript into a markdown cell has been deprecated? Do I need to put it into custom.js instead? And, will I be able to source the remote file from there, or will I need to make that library local as well? Sorry if this is a naive question, a lot of aspects of this are new to me. I'm just looking for the most straightforward and lightweight approach so I can experiment with my code. Thanks in advance, Clare -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140531/7d5564fe/attachment.html> From andrew.gibiansky at gmail.com Sat May 31 12:41:23 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Sat, 31 May 2014 12:41:23 -0400 Subject: [IPython-dev] Sourcing a javascript file from a notebook, and writing local javascript In-Reply-To: <CAETqNqF2wwg53tGvXWD+09bfVs8P98P6NhY3mcuPfXNZ3hiquA@mail.gmail.com> References: <CAETqNqF2wwg53tGvXWD+09bfVs8P98P6NhY3mcuPfXNZ3hiquA@mail.gmail.com> Message-ID: <CAF-LYK+soRCNN=dReOMS+F0-ftmZ5mbjZ_OxXH_t3=oXqwBk5g@mail.gmail.com> I'm not an IPython dev, but I *believe* that embedding JS into a Markdown cell has indeed been deprecated, for security reasons. I now experiment by putting things in custom.js. Code in custom.js I think has all the privileges that normal Javascript has, so you should be free to load external files and scripts. You can include your own JS files using require.js: require(['/static/custom/my_file.js']); In a similar way you should be able to load foreign JS files, I think; I don't know require.js very well though. You could probably also just append a <script> tag to the DOM with a proper src attribute :) -- Andrew Gibiansky On Sat, May 31, 2014 at 5:05 AM, Clare Sloggett <claresloggett at gmail.com> wrote: > Hi all, > > I was playing around with embeddable javascript libraries and seeing if I > could make use them from a Notebook. My first attempt was to try the > simplest thing possible; embed it in a markdown cell. The javascript I was > trying to embed wants to both source an external file, and then use it via > some local javascript code, like > <script language="javascript" src="http://some-url/library.js > "></script> > <script language="javascript"> > ... code ... > </script> > > In Notebook 1.x, the local code executes but throws an error about > undefined variables, suggesting that the external javascript file was not > loaded. Is this expected? > > In Notebook 2.0, so far as I can tell, none of it executes at all. > > Am I right in thinking that embedding Javascript into a markdown cell has > been deprecated? Do I need to put it into custom.js instead? And, will I be > able to source the remote file from there, or will I need to make that > library local as well? > > Sorry if this is a naive question, a lot of aspects of this are new to me. > I'm just looking for the most straightforward and lightweight approach so I > can experiment with my code. > > Thanks in advance, > Clare > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140531/64ef3ce1/attachment.html>