From patrick.surry at gmail.com Thu Nov 5 09:51:07 2015 From: patrick.surry at gmail.com (Patrick Surry) Date: Thu, 5 Nov 2015 09:51:07 -0500 Subject: [IPython-dev] SVG backend rescales chart differently than PNG backend? Message-ID: I've been using matplotlib fig.figimage(...) to insert a PNG image into a chart. But no matter what I did, the image was blurred as if it had been rescaled to an odd size. When I tried plt.savefig(...) the image in the chart looked crisp. There's an example and screenshot at the bottom, compare the bug's legs. I discovered the different default dpi setting, but that didn't help. Turns out that I was using the SVG backend, which renders the chart seems to render the chart as a bitmapped SVG image, but then displays it in the notebook with 'pt' instead of 'px' dimensions, which causes it to display slightly bigger and blurry. I'm using IPython 3.1.0 on OS X. Here's an example using the stinkbug image found at http://matplotlib.org/users/image_tutorial.html. With both the PNG or SVG backend, the rendered chart saved with savefig is 342x256px, but with the SVG backend, the div displaying the output in the notebook is sized in pt, not px, which causes it to rescale the previously rendered image at a slightly bigger size. Is there a way to fix that? If you edit the HTML and change "width: 342pt; height: 255pt" to "width: 342px; height: 255px" then the rendered chart looks crisp again. (The dimensions in the SVG element don't seem to matter because of the 100% style declaration.)
%matplotlib inline %config InlineBackend.rc = {'savefig.dpi': 100} import matplotlib.pyplot as plt import matplotlib.image as mpimg img=mpimg.imread('stinkbug.png') # with png backend, the rendered chart in the notebook and the saved image are exactly the same %config InlineBackend.figure_formats = set(['png']) plt.imshow(img) plt.savefig('pngfig.png', bbox_inches='tight') # with svg backend, the rendered chart is larger than the saved image, which is exactly the same size as the prior pngfig. %config InlineBackend.figure_formats = set(['svg']) plt.imshow(img) plt.savefig('svgfig.png', bbox_inches='tight') [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 183954 bytes Desc: not available URL: From tritemio at gmail.com Mon Nov 9 17:01:06 2015 From: tritemio at gmail.com (Antonino Ingargiola) Date: Mon, 9 Nov 2015 14:01:06 -0800 Subject: [IPython-dev] Notebook execution freeze in run-mode when using Run All Message-ID: Hi, I have a long running notebook which runs many other notebooks (using nbconvert). The total run time is between 10 and 30 minutes. It used to work with notebook < 4. Recently (notebook >=4) the notebook UI gets stuck in execution mode (the UI shows cells executed half way through the notebook while the remaining cells have In[*] prompt) when I run the cells with Run All menu. In this frozen mode the CPU is idle and the computation does not complete. Sometimes (not always) in the terminal I read this: [IPKernelApp] WARNING | Timeout waiting for IOPub output The point where the notebook gets stuck is not always the same. No other messages, even in debug mode except for the occasional notebook autosave. Any ideas what is the cause of the issue? This is on windows x64, python 3.4, notebook 4.0.6 and miniconda3 installation. Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Tue Nov 10 01:02:31 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Mon, 9 Nov 2015 22:02:31 -0800 Subject: [IPython-dev] Deprecating the IPython Color* API & IPython Theming Message-ID: <1B887BDF-9AAC-48B3-9071-D24E6EFCEE39@gmail.com> Hello list, TL;DR: Who is relying on IPython.utils.Pycolorize.Parser, and other ColorAnsi functionality ? I?m wondering if/how much deprecation time and backward compatibility is needed. Are you using ?Embed? in esoteric ways (like through pexpect/subprocess ?) Please speak now. Longer version Hi all, I?m working on refactoring all the ANSI code handling of IPython[1]. Some code in here is more than a decade old, and have a lot a redundant code, which often now is available with a better API[2] in libraries like Pygments. This part of the code also deals with prompt formatting Because yes you can put CWD, and date in IPython prompt if you like, and in color, and it is relatively annoying to keep compatibility with old and new API at the same time. So are any of you heavy users of the API in these region of the code base ? If so can you point me at your usage, so that I could make the migration to the new API easier in your use case ? Also if you are using IPython-embed through Expect or subprocess and alike, the new ASCII escape sequence might break previously made assumptions, I want to make sure these are not broken either. Thank you for reading me until the end, here is a gif[3][4] of the potential new IPython themes as a reward. -- [1] https://github.com/ipython/ipython/pull/8966 [2] well, mostly, the naming of ascii color is discutable. [3] https://twitter.com/Mbussonn/status/663953838521520128?cn=cmV0d2VldA%3D%3D&refsrc=email [4] It?s pronounced Jif not Gif: http://mashable.com/2014/07/16/how-to-say-gif/#FQuOGTRNREqp -------------- next part -------------- An HTML attachment was scrubbed... URL: From asmeurer at gmail.com Tue Nov 10 02:09:47 2015 From: asmeurer at gmail.com (Aaron Meurer) Date: Tue, 10 Nov 2015 01:09:47 -0600 Subject: [IPython-dev] Deprecating the IPython Color* API & IPython Theming In-Reply-To: <1B887BDF-9AAC-48B3-9071-D24E6EFCEE39@gmail.com> References: <1B887BDF-9AAC-48B3-9071-D24E6EFCEE39@gmail.com> Message-ID: I hope you also take this opportunity to make it easier for people to customize their prompts. You have to go through some silly hoops (which IIRC aren't really documented) to make the prompt execute some code every time it is displayed, which is necessary to do things like put the date or cwd in your prompt. I also found it annoying that I couldn't just inject something into some dictionary (I forget which at this point) because in IPython's type system dictionaries are immutable for some reason. I also want to say that I'm stoked that IPython is finally getting proper theming support in the terminal. Aaron Meurer On Tue, Nov 10, 2015 at 12:02 AM, Matthias Bussonnier wrote: > Hello list, > > TL;DR: > > Who is relying on IPython.utils.Pycolorize.Parser, and other ColorAnsi > functionality ? > I?m wondering if/how much deprecation time and backward compatibility is > needed. > Are you using ?Embed? in esoteric ways (like through pexpect/subprocess ?) > Please speak now. > > Longer version > > Hi all, I?m working on refactoring all the ANSI code handling of IPython[1]. > Some code in here is more than a decade old, and have a lot a redundant > code, which often now > is available with a better API[2] in libraries like Pygments. > This part of the code also deals with prompt formatting Because yes you can > put CWD, > and date in IPython prompt if you like, and in color, and it is relatively > annoying to keep compatibility with old and new API > at the same time. > > So are any of you heavy users of the API in these region of the code base ? > If so can you point me at your usage, so that I could make the migration to > the new API > easier in your use case ? > > Also if you are using IPython-embed through Expect or subprocess and alike, > the new ASCII escape sequence > might break previously made assumptions, I want to make sure these are not > broken either. > > Thank you for reading me until the end, here is a gif[3][4] of the potential > new IPython themes as a reward. > > -- > [1] https://github.com/ipython/ipython/pull/8966 > [2] well, mostly, the naming of ascii color is discutable. > [3] > https://twitter.com/Mbussonn/status/663953838521520128?cn=cmV0d2VldA%3D%3D&refsrc=email > [4] It?s pronounced Jif not Gif: > http://mashable.com/2014/07/16/how-to-say-gif/#FQuOGTRNREqp > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > From bussonniermatthias at gmail.com Tue Nov 10 03:33:19 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Tue, 10 Nov 2015 00:33:19 -0800 Subject: [IPython-dev] Deprecating the IPython Color* API & IPython Theming In-Reply-To: References: <1B887BDF-9AAC-48B3-9071-D24E6EFCEE39@gmail.com> Message-ID: Hi Aaron, > On Nov 9, 2015, at 23:09, Aaron Meurer wrote: > > I hope you also take this opportunity to make it easier for people to > customize their prompts. > You have to go through some silly hoops > (which IIRC aren't really documented) to make the prompt execute some > code every time it is displayed, which is necessary to do things like > put the date or cwd in your prompt. Maybe not in the same PR, cwd and date should have custom markers to make that easier. > I also found it annoying that I > couldn't just inject something into some dictionary (I forget which at > this point) because in IPython's type system dictionaries are > immutable for some reason. Now that IPython can have dependencies, I things one can use Jinja2, or other templating library to simplify prompts. > I also want to say that I'm stoked that IPython is finally getting > proper theming support in the terminal. Well, I helped fixing a syntax highlighting bug, and slippery slope... this was not really on the roadmap... Might take some times to be released as is touch some pretty deep part of IPython though. -- M > > Aaron Meurer > > On Tue, Nov 10, 2015 at 12:02 AM, Matthias Bussonnier > wrote: >> Hello list, >> >> TL;DR: >> >> Who is relying on IPython.utils.Pycolorize.Parser, and other ColorAnsi >> functionality ? >> I?m wondering if/how much deprecation time and backward compatibility is >> needed. >> Are you using ?Embed? in esoteric ways (like through pexpect/subprocess ?) >> Please speak now. >> >> Longer version >> >> Hi all, I?m working on refactoring all the ANSI code handling of IPython[1]. >> Some code in here is more than a decade old, and have a lot a redundant >> code, which often now >> is available with a better API[2] in libraries like Pygments. >> This part of the code also deals with prompt formatting Because yes you can >> put CWD, >> and date in IPython prompt if you like, and in color, and it is relatively >> annoying to keep compatibility with old and new API >> at the same time. >> >> So are any of you heavy users of the API in these region of the code base ? >> If so can you point me at your usage, so that I could make the migration to >> the new API >> easier in your use case ? >> >> Also if you are using IPython-embed through Expect or subprocess and alike, >> the new ASCII escape sequence >> might break previously made assumptions, I want to make sure these are not >> broken either. >> >> Thank you for reading me until the end, here is a gif[3][4] of the potential >> new IPython themes as a reward. >> >> -- >> [1] https://github.com/ipython/ipython/pull/8966 >> [2] well, mostly, the naming of ascii color is discutable. >> [3] >> https://twitter.com/Mbussonn/status/663953838521520128?cn=cmV0d2VldA%3D%3D&refsrc=email >> [4] It?s pronounced Jif not Gif: >> http://mashable.com/2014/07/16/how-to-say-gif/#FQuOGTRNREqp >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev >> > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From asmeurer at gmail.com Tue Nov 10 11:25:07 2015 From: asmeurer at gmail.com (Aaron Meurer) Date: Tue, 10 Nov 2015 10:25:07 -0600 Subject: [IPython-dev] Deprecating the IPython Color* API & IPython Theming In-Reply-To: References: <1B887BDF-9AAC-48B3-9071-D24E6EFCEE39@gmail.com> Message-ID: On Tue, Nov 10, 2015 at 2:33 AM, Matthias Bussonnier wrote: > Hi Aaron, > >> On Nov 9, 2015, at 23:09, Aaron Meurer wrote: >> >> I hope you also take this opportunity to make it easier for people to >> customize their prompts. >> You have to go through some silly hoops >> (which IIRC aren't really documented) to make the prompt execute some >> code every time it is displayed, which is necessary to do things like >> put the date or cwd in your prompt. > > Maybe not in the same PR, cwd and date should have custom markers > to make that easier. Those are bad examples then. Something that isn't built in but does require re-execution at each prompt. Aaron Meurer > > >> I also found it annoying that I >> couldn't just inject something into some dictionary (I forget which at >> this point) because in IPython's type system dictionaries are >> immutable for some reason. > > Now that IPython can have dependencies, I things one can use Jinja2, > or other templating library to simplify prompts. > >> I also want to say that I'm stoked that IPython is finally getting >> proper theming support in the terminal. > > Well, I helped fixing a syntax highlighting bug, and slippery slope... > this was not really on the roadmap... > > Might take some times to be released as is touch some pretty deep part of IPython though. > > -- > M > > >> >> Aaron Meurer >> >> On Tue, Nov 10, 2015 at 12:02 AM, Matthias Bussonnier >> wrote: >>> Hello list, >>> >>> TL;DR: >>> >>> Who is relying on IPython.utils.Pycolorize.Parser, and other ColorAnsi >>> functionality ? >>> I?m wondering if/how much deprecation time and backward compatibility is >>> needed. >>> Are you using ?Embed? in esoteric ways (like through pexpect/subprocess ?) >>> Please speak now. >>> >>> Longer version >>> >>> Hi all, I?m working on refactoring all the ANSI code handling of IPython[1]. >>> Some code in here is more than a decade old, and have a lot a redundant >>> code, which often now >>> is available with a better API[2] in libraries like Pygments. >>> This part of the code also deals with prompt formatting Because yes you can >>> put CWD, >>> and date in IPython prompt if you like, and in color, and it is relatively >>> annoying to keep compatibility with old and new API >>> at the same time. >>> >>> So are any of you heavy users of the API in these region of the code base ? >>> If so can you point me at your usage, so that I could make the migration to >>> the new API >>> easier in your use case ? >>> >>> Also if you are using IPython-embed through Expect or subprocess and alike, >>> the new ASCII escape sequence >>> might break previously made assumptions, I want to make sure these are not >>> broken either. >>> >>> Thank you for reading me until the end, here is a gif[3][4] of the potential >>> new IPython themes as a reward. >>> >>> -- >>> [1] https://github.com/ipython/ipython/pull/8966 >>> [2] well, mostly, the naming of ascii color is discutable. >>> [3] >>> https://twitter.com/Mbussonn/status/663953838521520128?cn=cmV0d2VldA%3D%3D&refsrc=email >>> [4] It?s pronounced Jif not Gif: >>> http://mashable.com/2014/07/16/how-to-say-gif/#FQuOGTRNREqp >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> https://mail.scipy.org/mailman/listinfo/ipython-dev >>> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From sebastian.kremiec at gmail.com Fri Nov 13 07:07:22 2015 From: sebastian.kremiec at gmail.com (Sebastian Kremiec) Date: Fri, 13 Nov 2015 12:07:22 +0000 Subject: [IPython-dev] New project - K3D Message-ID: Hi everyone, I'd like to announce a new project named K3D, which main goal is to bring WebGL based 3D visualization capabilities to Jupyter. It's is still quite fresh and under heavy development, but you can already can get an idea. Project is hosted at https://github.com/K3D-tools/K3D-jupyter and any contribution is very welcome. Greetings, K3D Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.freder at gmail.com Fri Nov 13 15:23:25 2015 From: jon.freder at gmail.com (Jonathan Frederic) Date: Fri, 13 Nov 2015 12:23:25 -0800 Subject: [IPython-dev] New project - K3D In-Reply-To: References: Message-ID: Hi Sebastian, Neat, you may want to checkout pythreejs by jasongrout https://github.com/jovyan/pythreejs which does that too and allows for bidirectional communication via the widgets. Cheers, Jon On Fri, Nov 13, 2015 at 4:07 AM, Sebastian Kremiec < sebastian.kremiec at gmail.com> wrote: > Hi everyone, > > I'd like to announce a new project named K3D, which main goal is to bring > WebGL based 3D visualization capabilities to Jupyter. > It's is still quite fresh and under heavy development, but you can already > can get an idea. > Project is hosted at https://github.com/K3D-tools/K3D-jupyter and any > contribution is very welcome. > > Greetings, > K3D Team > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.quarendon at teamwpc.co.uk Sat Nov 14 06:21:52 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Sat, 14 Nov 2015 11:21:52 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? Message-ID: I?m trying to figure out how the CodeMirror mode is loaded by the notebook in response to a kernel info request, and how I would add support for a language not provided by the CodeMirror distribution included in the notebook distribution. In other words I?m developing a kernel for a language not supported by the normal CodeMirror distribution. I can plug in a kernel just fine, but there seems to be no equivalent for the CodeMirror mode for the notebook. From what I can see, it appears that it will only load modes that in the normal CodeMirror distribution, so if I want to add a new mode, I would rather crudely have to just put a suitable mode in the CodeMirror mode directory buried deep inside the jupyter notebook python module in my python lib directory? Is this the case, or is there a better way? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Nov 14 11:29:05 2015 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 14 Nov 2015 08:29:05 -0800 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: References: Message-ID: What I ended up doing for Maxima-Jupyter is to put the appropriate JS (created by hacking the one for another language) into the CodeMirror installation directory, also putting the new file name on the list of modes which is also in the CM installation. Maybe there is a better way, but I couldn't figure it out. Hope this helps, Robert Dodier From bussonniermatthias at gmail.com Sat Nov 14 11:49:25 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Sat, 14 Nov 2015 08:49:25 -0800 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: References: Message-ID: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> > On Nov 14, 2015, at 08:29, Robert Dodier wrote: > > What I ended up doing for Maxima-Jupyter is to put the appropriate JS > (created by hacking the one for another language) into the CodeMirror > installation directory, also putting the new file name on the list of > modes which is also in the CM installation. You can drop a kernel.js next to your kernel.json at installation time, it should describe an AMD module that define a `unload` method that will be called when you switch to you r kernel. The can manually load/register a code mirror mode in the notebook. -- M > > Maybe there is a better way, but I couldn't figure it out. > > Hope this helps, > > Robert Dodier > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From tom.quarendon at teamwpc.co.uk Sat Nov 14 12:27:13 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Sat, 14 Nov 2015 17:27:13 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> Message-ID: <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> Aha. That sounds like the kind of solution I'm after. Thanks. Sent from my iPhone > On 14 Nov 2015, at 4:49 p.m., Matthias Bussonnier wrote: > > >> On Nov 14, 2015, at 08:29, Robert Dodier wrote: >> >> What I ended up doing for Maxima-Jupyter is to put the appropriate JS >> (created by hacking the one for another language) into the CodeMirror >> installation directory, also putting the new file name on the list of >> modes which is also in the CM installation. > > You can drop a kernel.js next to your kernel.json at installation time, > it should describe an AMD module that define a `unload` method that will be called when you switch > to you r kernel. > > The can manually load/register a code mirror mode in the notebook. > -- > M > > >> >> Maybe there is a better way, but I couldn't figure it out. >> >> Hope this helps, >> >> Robert Dodier >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From tom.quarendon at teamwpc.co.uk Mon Nov 16 08:39:21 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Mon, 16 Nov 2015 13:39:21 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> Message-ID: > You can drop a kernel.js next to your kernel.json at installation > time, it should describe an AMD module that define an `onload` method > that will be called when you switch to your kernel. The thing it's just taken me a *very* long time to figure out is that because of the way that the kernel.js file is loaded, you can't use relative module IDs in require or define calls. So in my kernel.js file I naively had; define( function(require) { return { onload: function() { require('./js/mymode'); } }; }); However it only works if you make it "mymode.js", and then if any require calls that "mymode.js" has also use ".js" suffixes on the filenames, a pain because I'm using TypeScript generated javascript. Doing it this way won't resolve "module IDs", and this is a function of the way that the kernel.js file is loaded (it's loaded as an explicit path with a leading /, so anything resolved relative to it also has a leading slash, and if you have a leading slash it bypasses the "module ID" path resolution bits in require.js). Anyway. What I *finally* worked out is that if I write: require('kernelspecs/mykernel/js/mymode'); Instead (NO leading slash), it all works, and I don?t have to modify my code, this "kernel.js" file can do all the adaptation I need. Anyway. In case anyone else has the same problem :-) From tom.quarendon at teamwpc.co.uk Mon Nov 16 08:57:15 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Mon, 16 Nov 2015 13:57:15 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> Message-ID: > You can drop a kernel.js next to your kernel.json at installation > time, it should describe an AMD module that define an `onload` method > that will be called when you switch to your kernel. What I'd *really* like to be able to do, but so far have failed, is modify the require.js configuration from within my kernel.js file. So my code mirror mode makes us of another javascript library to provide the actual tokenisation and linting code that the code mirror mode then consumes. It finds that code through dependencies, but the way that I've written it requires that there be a path set up in require. So in other words my CodeMirror mode looks like: define(["require", "codemirror/lib/codemirror", "A/tokenization", "A/lint" ], function(require, CodeMirror, tokenizer, linter) { CodeMirror.defineMode("mymode", ... Now maybe this shows my lack of experience with require.js (which amounts to about a week), but I did it this way as I wanted to separate the interesting parts (the tokenisation and linting) and reuse them elsewhere easily, as this is code that can be used outside of CodeMirror. Anyway, upshot is that what I really want to do in my kernel.js is add to the require configuration to say that path "A" should resolve to "kernelspecs/mykernel/js". I suspect though that I can't do this? I suspect that I need to accept that anywhere I use my CodeMirror mode, it finds its dependencies in the same directory, so I refer to them as "./tokenizer" and "./linter" etc. Thanks. From tom.quarendon at teamwpc.co.uk Mon Nov 16 09:03:00 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Mon, 16 Nov 2015 14:03:00 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> Message-ID: OK, I posted too hastily :-) If in my kernel.js file I put: /* following myst go here, not inside define, and not inside onload. */ requirejs({ paths:{ A:"/kernelspecs/mykernel/js" } }); define( function(require) { return { onload: function() { require('kernelspecs/mykernel/js/mymode'); } }; }); Then it works :-) In case anyone else encounters the same. Thanks. -----Original Message----- From: IPython-dev [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Tom Quarendon Sent: 16 November 2015 13:57 To: IPython developers list Subject: Re: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? > You can drop a kernel.js next to your kernel.json at installation > time, it should describe an AMD module that define an `onload` method > that will be called when you switch to your kernel. What I'd *really* like to be able to do, but so far have failed, is modify the require.js configuration from within my kernel.js file. So my code mirror mode makes us of another javascript library to provide the actual tokenisation and linting code that the code mirror mode then consumes. It finds that code through dependencies, but the way that I've written it requires that there be a path set up in require. So in other words my CodeMirror mode looks like: define(["require", "codemirror/lib/codemirror", "A/tokenization", "A/lint" ], function(require, CodeMirror, tokenizer, linter) { CodeMirror.defineMode("mymode", ... Now maybe this shows my lack of experience with require.js (which amounts to about a week), but I did it this way as I wanted to separate the interesting parts (the tokenisation and linting) and reuse them elsewhere easily, as this is code that can be used outside of CodeMirror. Anyway, upshot is that what I really want to do in my kernel.js is add to the require configuration to say that path "A" should resolve to "kernelspecs/mykernel/js". I suspect though that I can't do this? I suspect that I need to accept that anywhere I use my CodeMirror mode, it finds its dependencies in the same directory, so I refer to them as "./tokenizer" and "./linter" etc. Thanks. _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev From bussonniermatthias at gmail.com Mon Nov 16 11:18:07 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Mon, 16 Nov 2015 08:18:07 -0800 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> <3FC13160-3B12-40F8-8C33-4E572C3A745C@teamwpc.co.uk> Message-ID: <6A639D3E-F0AF-472E-BF52-E2BAD779C8D3@gmail.com> Having to do that is definitively annoying. Can you open a bug report so that we can find a better solution ? Envoy? de mon iPhone > Le 16 nov. 2015 ? 06:03, Tom Quarendon a ?crit : > > OK, I posted too hastily :-) > > If in my kernel.js file I put: > /* following myst go here, not inside define, and not inside onload. */ > requirejs({ > paths:{ > A:"/kernelspecs/mykernel/js" > } > }); > define( > function(require) { > return { > onload: function() { > require('kernelspecs/mykernel/js/mymode'); > } > }; > }); > > Then it works :-) > > In case anyone else encounters the same. > > Thanks. > > -----Original Message----- > From: IPython-dev [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Tom Quarendon > Sent: 16 November 2015 13:57 > To: IPython developers list > Subject: Re: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? > >> You can drop a kernel.js next to your kernel.json at installation >> time, it should describe an AMD module that define an `onload` method >> that will be called when you switch to your kernel. > > What I'd *really* like to be able to do, but so far have failed, is modify the require.js configuration from within my kernel.js file. > > So my code mirror mode makes us of another javascript library to provide the actual tokenisation and linting code that the code mirror mode then consumes. It finds that code through dependencies, but the way that I've written it requires that there be a path set up in require. So in other words my CodeMirror mode looks like: > > define(["require", > "codemirror/lib/codemirror", > "A/tokenization", > "A/lint" ], > function(require, CodeMirror, tokenizer, linter) { > CodeMirror.defineMode("mymode", ... > > Now maybe this shows my lack of experience with require.js (which amounts to about a week), but I did it this way as I wanted to separate the interesting parts (the tokenisation and linting) and reuse them elsewhere easily, as this is code that can be used outside of CodeMirror. > > Anyway, upshot is that what I really want to do in my kernel.js is add to the require configuration to say that path "A" should resolve to "kernelspecs/mykernel/js". > > I suspect though that I can't do this? I suspect that I need to accept that anywhere I use my CodeMirror mode, it finds its dependencies in the same directory, so I refer to them as "./tokenizer" and "./linter" etc. > > Thanks. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From tom.quarendon at teamwpc.co.uk Wed Nov 18 11:43:27 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Wed, 18 Nov 2015 16:43:27 +0000 Subject: [IPython-dev] Can I safely ignore "comm_open" for ipywidgets.CommInfo/ipython.widgets Message-ID: When we run our kernel from a notebook the kernel gets a ?comm_open? request with widget class ?ipywidgets.CommInfo?, target name ?ipython.widgets?. What do we do with this? Can I safely ignore this message and any other comm_open messages? Should I respond to any comm_open messages with a comm_close as suggested in the docs (?If the target_name key is not found on the receiving side, then it should immediately reply with a comm_close message to avoid an inconsistent state.? But it?s unclear what the ?target_name key is not found on the receiving side? means). Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.freder at gmail.com Wed Nov 18 13:18:30 2015 From: jon.freder at gmail.com (Jonathan Frederic) Date: Wed, 18 Nov 2015 10:18:30 -0800 Subject: [IPython-dev] Can I safely ignore "comm_open" for ipywidgets.CommInfo/ipython.widgets In-Reply-To: References: Message-ID: Hi Tom, If you don't plan on implementing ipywidget support in your kernel, you shouldn't have to worry about implementing that. It's a channel used to determine what widget comms existing in the backend in order to reconnect them to the front end on page refresh. Regarding "target_name key is not found on the receiving side", I suggest you read the comm spec here: https://github.com/ipython/ipython/wiki/IPEP-21%3A-Widget-Messages . Basically comm handlers are registered by target_name, that's how the comms are matched accross the front end / back end boundary. Cheers, Jon On Wed, Nov 18, 2015 at 8:43 AM, Tom Quarendon wrote: > When we run our kernel from a notebook the kernel gets a ?comm_open? > request with widget class ?ipywidgets.CommInfo?, target name > ?ipython.widgets?. > > What do we do with this? > > > > Can I safely ignore this message and any other comm_open messages? Should > I respond to any comm_open messages with a comm_close as suggested in the > docs (?If the target_name key is not found on the receiving side, then it > should immediately reply with a comm_close message to avoid an inconsistent > state.? But it?s unclear what the ?target_name key is not found on the > receiving side? means). > > > > Thanks. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.quarendon at teamwpc.co.uk Thu Nov 19 03:00:52 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Thu, 19 Nov 2015 08:00:52 +0000 Subject: [IPython-dev] Can I safely ignore "comm_open" for ipywidgets.CommInfo/ipython.widgets In-Reply-To: References: Message-ID: OK, thanks. I think that makes a little bit more sense of the ipywidgets code. My reading of it is this. The notebook creates a widget in the kernel. It is then expected that what that widget do is send a message to the front end where the message looks like: { Comm_id: ?uuid?, data : { content { comms:{} } }, method:?custom? } The comms dictionary consists of the target_name and something else that I can?t figure out. Sorry my python skills aren?t great to be able to work out what the code in CommInfo does, and since no widgets are created initially Wireshark doesn?t shed any light on the format of that part as it?s empty. After sending that message it should then close. So it looks like completely ignoring the message wouldn?t be ideal as it?s going to leave stuff lying around in the notebook waiting for the response. But since we don?t actually support widgets, we can just return a message as above, with an empty comms{} dictionary. Thanks. From: IPython-dev [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Jonathan Frederic Sent: 18 November 2015 18:19 To: IPython developers list Subject: Re: [IPython-dev] Can I safely ignore "comm_open" for ipywidgets.CommInfo/ipython.widgets Hi Tom, If you don't plan on implementing ipywidget support in your kernel, you shouldn't have to worry about implementing that. It's a channel used to determine what widget comms existing in the backend in order to reconnect them to the front end on page refresh. Regarding "target_name key is not found on the receiving side", I suggest you read the comm spec here: https://github.com/ipython/ipython/wiki/IPEP-21%3A-Widget-Messages . Basically comm handlers are registered by target_name, that's how the comms are matched accross the front end / back end boundary. Cheers, Jon On Wed, Nov 18, 2015 at 8:43 AM, Tom Quarendon > wrote: When we run our kernel from a notebook the kernel gets a ?comm_open? request with widget class ?ipywidgets.CommInfo?, target name ?ipython.widgets?. What do we do with this? Can I safely ignore this message and any other comm_open messages? Should I respond to any comm_open messages with a comm_close as suggested in the docs (?If the target_name key is not found on the receiving side, then it should immediately reply with a comm_close message to avoid an inconsistent state.? But it?s unclear what the ?target_name key is not found on the receiving side? means). Thanks. _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Thu Nov 19 16:42:21 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 19 Nov 2015 13:42:21 -0800 Subject: [IPython-dev] [JOB] Project Jupyter is hiring two postdoctoral fellows @ UC Berkeley. Message-ID: Hi all, We are delighted to announce today that Project Jupyter/IPython has two postdoctoral fellowships open at UC Berkeley, open immediately. Interested candidates can apply here: https://aprecruit.berkeley.edu/apply/JPF00899 We hope to find candidates who will work on a number of challenging questions over the next few years, as described in our grant proposal here: http://blog.jupyter.org/2015/07/07/project-jupyter-computational-narratives-as-the-engine-of-collaborative-data-science/ Interested candidates should carefully read that proposal before applying to familiarize themselves with the full scope of the questions we intend to tackle. We'd like to thank the support of the Helmsley Trust, the Gordon and Betty Moore Foundation and the Alfred P. Sloan Foundation. Cheers, Brian Granger and Fernando Perez. -- 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: From cyrille.rossant at gmail.com Sun Nov 22 14:26:07 2015 From: cyrille.rossant at gmail.com (Cyrille Rossant) Date: Sun, 22 Nov 2015 20:26:07 +0100 Subject: [IPython-dev] ANN: New edition of the IPython minibook Message-ID: Hi all, The second edition of the book *Learning IPython for Interactive Computing and Data Visualization* has been released (Packt Publishing). The book now targets Python 3, IPython 4, and the Jupyter Notebook. There is a new introduction to the Python programming language for complete beginners, as well as new code examples covering pandas and NumPy for data analysis and numerical computing. There are also contents for more advanced users, like parallel computing with IPython and high-performance computing with Numba and Cython. All code examples are available on GitHub as Jupyter notebooks. You'll find more information here: * IPython Books website: * Book page on Packt's website: * GitHub repo: Cyrille From ellisonbg at gmail.com Sun Nov 22 15:39:11 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Sun, 22 Nov 2015 12:39:11 -0800 Subject: [IPython-dev] [jupyter] ANN: New edition of the IPython minibook In-Reply-To: References: Message-ID: Fantastic and *many* congrats!!! On Sun, Nov 22, 2015 at 11:26 AM, Cyrille Rossant wrote: > Hi all, > > The second edition of the book *Learning IPython for Interactive > Computing and Data Visualization* has been released (Packt > Publishing). > > The book now targets Python 3, IPython 4, and the Jupyter Notebook. > There is a new introduction to the Python programming language for > complete beginners, as well as new code examples covering pandas and > NumPy for data analysis and numerical computing. There are also > contents for more advanced users, like parallel computing with IPython > and high-performance computing with Numba and Cython. > > All code examples are available on GitHub as Jupyter notebooks. > > You'll find more information here: > > * IPython Books website: > * Book page on Packt's website: > > * GitHub repo: > > Cyrille > > -- > You received this message because you are subscribed to the Google Groups "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe at googlegroups.com. > To post to this group, send email to jupyter at googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CA%2B-1RQRZjWq1mWWMBts-Q0uosP8QhC7tT_vWRUsaKnUKYe7-7w%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com From pierre.villeneuve at gmail.com Sun Nov 22 16:51:58 2015 From: pierre.villeneuve at gmail.com (Pierre Villeneuve) Date: Sun, 22 Nov 2015 13:51:58 -0800 Subject: [IPython-dev] JavaScript extension cheat or not? In-Reply-To: References: Message-ID: In my work I rarely need to dive deep into technical details on notebook extensions. In fact I'd like to keep it that way since the entire Jupyter landscape and ecosystem is evolving so rapidly (that's great!). I wrote an extension last year under IPython 3 that worked just nicely using jupyter-pip. But now that I've updated to the latest Jupyter 4 something is broken with locating my JS file after install. Option 1 is to dig in and make it work correctly with Jupyter's current nbextension system. Option 2 is to programmatically read the JS file and then use IPython's enhanced display mechanism to pipe the JS to the browser. Option 2 worked nicely for me in the past and its so easy to manage. But what's the downside? Is it considered "cheating"? :) When is that method not reliable? Thanks! Pierre Villeneuve pierre.villeneuve at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Sun Nov 22 18:05:27 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Sun, 22 Nov 2015 15:05:27 -0800 Subject: [IPython-dev] JavaScript extension cheat or not? In-Reply-To: References: Message-ID: I think the cheat is perfectly fine for now. In the next 6 months we will be moving over to using npm packages for all of our JavaScript code. But the cheat will continue to work. Cheers, Brian On Sun, Nov 22, 2015 at 1:51 PM, Pierre Villeneuve wrote: > In my work I rarely need to dive deep into technical details on notebook > extensions. In fact I'd like to keep it that way since the entire Jupyter > landscape and ecosystem is evolving so rapidly (that's great!). > > I wrote an extension last year under IPython 3 that worked just nicely using > jupyter-pip. But now that I've updated to the latest Jupyter 4 something is > broken with locating my JS file after install. > > Option 1 is to dig in and make it work correctly with Jupyter's current > nbextension system. Option 2 is to programmatically read the JS file and > then use IPython's enhanced display mechanism to pipe the JS to the browser. > > Option 2 worked nicely for me in the past and its so easy to manage. But > what's the downside? Is it considered "cheating"? :) When is that method > not reliable? > > Thanks! > > Pierre Villeneuve > pierre.villeneuve at gmail.com > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com From fperez.net at gmail.com Mon Nov 23 01:02:00 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 22 Nov 2015 22:02:00 -0800 Subject: [IPython-dev] ANN: New edition of the IPython minibook In-Reply-To: References: Message-ID: Awesome, congratulations!! Please don't forget to submit a PR to update the links/images on the site :) On Sun, Nov 22, 2015 at 11:26 AM, Cyrille Rossant wrote: > Hi all, > > The second edition of the book *Learning IPython for Interactive > Computing and Data Visualization* has been released (Packt > Publishing). > > The book now targets Python 3, IPython 4, and the Jupyter Notebook. > There is a new introduction to the Python programming language for > complete beginners, as well as new code examples covering pandas and > NumPy for data analysis and numerical computing. There are also > contents for more advanced users, like parallel computing with IPython > and high-performance computing with Numba and Cython. > > All code examples are available on GitHub as Jupyter notebooks. > > You'll find more information here: > > * IPython Books website: > * Book page on Packt's website: > < > https://www.packtpub.com/big-data-and-business-intelligence/learning-ipython-interactive-computing-and-data-visualization-sec > > > * GitHub repo: > > Cyrille > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://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: From fperez.net at gmail.com Mon Nov 23 02:02:40 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 22 Nov 2015 23:02:40 -0800 Subject: [IPython-dev] ANN: New edition of the IPython minibook In-Reply-To: References: Message-ID: Actually, just saw there was already a PR open, just merged it, thanks! On Sun, Nov 22, 2015 at 10:02 PM, Fernando Perez wrote: > Awesome, congratulations!! > > Please don't forget to submit a PR to update the links/images on the site > :) > > On Sun, Nov 22, 2015 at 11:26 AM, Cyrille Rossant < > cyrille.rossant at gmail.com> wrote: > >> Hi all, >> >> The second edition of the book *Learning IPython for Interactive >> Computing and Data Visualization* has been released (Packt >> Publishing). >> >> The book now targets Python 3, IPython 4, and the Jupyter Notebook. >> There is a new introduction to the Python programming language for >> complete beginners, as well as new code examples covering pandas and >> NumPy for data analysis and numerical computing. There are also >> contents for more advanced users, like parallel computing with IPython >> and high-performance computing with Numba and Cython. >> >> All code examples are available on GitHub as Jupyter notebooks. >> >> You'll find more information here: >> >> * IPython Books website: >> * Book page on Packt's website: >> < >> https://www.packtpub.com/big-data-and-business-intelligence/learning-ipython-interactive-computing-and-data-visualization-sec >> > >> * GitHub repo: >> >> Cyrille >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://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 > -- 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: From ndbecker2 at gmail.com Mon Nov 23 07:07:26 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Mon, 23 Nov 2015 07:07:26 -0500 Subject: [IPython-dev] ipython broken on update to 4.0 (pip fedora 23) Message-ID: after updating today to ipython 4.0, using pip, ipython notebook doesn't work. I have tried checking that there is no older versions installed (and also rm'ing all ipython parts in ~/.local/lib/pythonxx/site-packages and re- installing via pip). This is fedora 23. [nbecker at nbecker2 ~]$ ipython2 notebook Traceback (most recent call last): File "/home/nbecker/.local/bin/ipython2", line 11, in sys.exit(start_ipython()) File "/home/nbecker/.local/lib/python2.7/site- packages/IPython/__init__.py", line 118, in start_ipython return launch_new_instance(argv=argv, **kwargs) File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 591, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python2.7/site- packages/IPython/terminal/ipapp.py", line 305, in initialize super(TerminalIPythonApp, self).initialize(argv) File "", line 2, in initialize File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python2.7/site- packages/IPython/core/application.py", line 386, in initialize self.parse_command_line(argv) File "/home/nbecker/.local/lib/python2.7/site- packages/IPython/terminal/ipapp.py", line 300, in parse_command_line return super(TerminalIPythonApp, self).parse_command_line(argv) File "", line 2, in parse_command_line File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 487, in parse_command_line return self.initialize_subcommand(subc, subargv) File "", line 2, in initialize_subcommand File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python2.7/site- packages/traitlets/config/application.py", line 418, in initialize_subcommand subapp = import_item(subapp) File "/home/nbecker/.local/lib/python2.7/site- packages/ipython_genutils/importstring.py", line 31, in import_item module = __import__(package, fromlist=[obj]) ImportError: No module named notebook.notebookapp [nbecker at nbecker2 ~]$ ipython3 notebook Traceback (most recent call last): File "/home/nbecker/.local/bin/ipython3", line 11, in sys.exit(start_ipython()) File "/home/nbecker/.local/lib/python3.4/site- packages/IPython/__init__.py", line 118, in start_ipython return launch_new_instance(argv=argv, **kwargs) File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 591, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python3.4/site- packages/IPython/terminal/ipapp.py", line 305, in initialize super(TerminalIPythonApp, self).initialize(argv) File "", line 2, in initialize File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python3.4/site- packages/IPython/core/application.py", line 386, in initialize self.parse_command_line(argv) File "/home/nbecker/.local/lib/python3.4/site- packages/IPython/terminal/ipapp.py", line 300, in parse_command_line return super(TerminalIPythonApp, self).parse_command_line(argv) File "", line 2, in parse_command_line File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 487, in parse_command_line return self.initialize_subcommand(subc, subargv) File "", line 2, in initialize_subcommand File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/home/nbecker/.local/lib/python3.4/site- packages/traitlets/config/application.py", line 418, in initialize_subcommand subapp = import_item(subapp) File "/home/nbecker/.local/lib/python3.4/site- packages/ipython_genutils/importstring.py", line 31, in import_item module = __import__(package, fromlist=[obj]) ImportError: No module named 'notebook' [nbecker at nbecker2 ~]$ From ndbecker2 at gmail.com Mon Nov 23 07:15:22 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Mon, 23 Nov 2015 07:15:22 -0500 Subject: [IPython-dev] ipython broken on update to 4.0 (pip fedora 23) References: Message-ID: OK, I see that I needed to install pip install jupyter seperately now. Sorry for the noise. From tom.quarendon at teamwpc.co.uk Tue Nov 24 08:19:08 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Tue, 24 Nov 2015 13:19:08 +0000 Subject: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? In-Reply-To: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> References: <6676F8EF-1B27-4753-BFB8-49242CC3E0FB@gmail.com> Message-ID: OK, so I can't get this to work reliably. It's a timing thing. The way I've implemented it is simply to do onload: function() { require('kernelspecs/mykernel/mymode'); } In my kernel.js However, the success of that depends on the asynchronous timing of that being executed verses the call to set_codemirror_mode here (notebook.js): this.events.on('kernel_ready.Kernel', function(event, data) { ... that.set_codemirror_mode(cm_mode); }); So I suspect I need to do something more sophisticated. Bearing in mind my lack of knowledge of require etc (i.e spell it out please!), can anyone suggest anything? Cal I explicitly call set_codemirror_mode myself somehow (I don't know how I'd get hold of a suitable object to call the method on though)? Thanks. -----Original Message----- From: IPython-dev [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Matthias Bussonnier Sent: 14 November 2015 16:49 To: IPython developers list Subject: Re: [IPython-dev] Notebook codemirror support for language not distributed with codemirror? > On Nov 14, 2015, at 08:29, Robert Dodier wrote: > > What I ended up doing for Maxima-Jupyter is to put the appropriate JS > (created by hacking the one for another language) into the CodeMirror > installation directory, also putting the new file name on the list of > modes which is also in the CM installation. You can drop a kernel.js next to your kernel.json at installation time, it should describe an AMD module that define a `unload` method that will be called when you switch to you r kernel. The can manually load/register a code mirror mode in the notebook. -- M > > Maybe there is a better way, but I couldn't figure it out. > > Hope this helps, > > Robert Dodier > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev From rosborn at anl.gov Sat Nov 28 16:08:25 2015 From: rosborn at anl.gov (Osborn, Raymond) Date: Sat, 28 Nov 2015 21:08:25 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app Message-ID: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> We have been developing an application, called NeXpy (http://nexpy.github.io/nexpy/), that embeds an IPython (or Jupyter) shell within a PyQt GUI. Much of the code was based on the IPython v3 code for the qtconsoleapp, and I was relieved that we were able to make the switch to IPython 4 reasonably easily based on the qtconsoleapp.py in the new qtconsole package. However, I only just noticed that we seem to have lost the ability to do multiline editing, without using the Ctrl key modifier. Even with the modifier, the indent is not correctly set, so the behavior has diverged from the ipython qtconsole, where multiline editing is automatic if the code is not complete and a proper indent is set. Multiline editing works fine if I paste code into the shell - it?s only if I try to type it in that it never enters multiline editing mode. I made the change a while ago, and set the console config variable execute_on_complete_input to False. When set to the default value of True, it does automatically go into editing mode with an incomplete line, but it then never completes even when the code is complete. It?s a complicated program, so I?m not sure what code extract might be helpful to diagnose the problem, but I hoped that readers of this list might be aware of the changes from the IPython QtConsole that could have triggered this change. I will of course provide whatever extra information is needed on request. Thanks in advance, Ray -- Ray Osborn Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: ROsborn at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Sun Nov 29 07:22:35 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Sun, 29 Nov 2015 12:22:35 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> Message-ID: Hi Ray, On 28 November 2015 at 21:08, Osborn, Raymond wrote: > However, I only just noticed that we seem to have lost the ability to do > multiline editing, without using the Ctrl key modifier. Even with the > modifier, the indent is not correctly set, so the behavior has diverged > from the ipython qtconsole, where multiline editing is automatic if the > code is not complete and a proper indent is set. I think I know what you're running into. In previous versions of the Qt console, the frontend decided whether to prompt for another line and how much to indent it by processing the Python code that was typed in. As we've moved towards supporting multiple languages, it's not appropriate for the frontend to make that decision, so it has to ask the kernel about it. It does that by making is_complete_request to the kernel: http://jupyter-client.readthedocs.org/en/latest/messaging.html#code-completeness Assuming you're using the Qt console with an IPython kernel, it should still be straightforward to use that, but I guess it needs some changes in your integration code to make sure the message gets through. The widget object now has an is_complete method, which you can see here: https://github.com/jupyter/qtconsole/blob/f2c8a31c387ce1e020ccdbb020091de2ee98dbf9/qtconsole/frontend_widget.py#L260 Best wishes, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From rosborn at anl.gov Sun Nov 29 09:47:52 2015 From: rosborn at anl.gov (Osborn, Raymond) Date: Sun, 29 Nov 2015 14:47:52 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> Message-ID: <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> Thanks for your reply. My inheritance chain includes the console_widget, so I have access to the _is_complete function, but it looks like I might have a different problem. I?ve been running this through my debugger again, and if I set ?execute_on_complete_input? to False, it doesn?t call the _is_complete function and assumes everything is complete. The shell then works apart from multiline editing. However, if I set ?execute_on_complete_input? to True (the default), then it calls the _is_complete function, sends an ?is_complete? request to the frontend, but never gets a reply. It calls the get_msg function in jupyiter_client/blocking/channels.py, but this always raises Empty. Sometimes the debugger causes timeout problems, but even when I remove all the breakpoints except for call to self._recv, it is never triggered, and this seems to explain why no lines in the shell are recorded as complete. I?ll see if I can reproduce this chain in the IPython qtconsole. Ray On Nov 29, 2015, at 6:22 AM, Thomas Kluyver > wrote: Hi Ray, On 28 November 2015 at 21:08, Osborn, Raymond > wrote: However, I only just noticed that we seem to have lost the ability to do multiline editing, without using the Ctrl key modifier. Even with the modifier, the indent is not correctly set, so the behavior has diverged from the ipython qtconsole, where multiline editing is automatic if the code is not complete and a proper indent is set. I think I know what you're running into. In previous versions of the Qt console, the frontend decided whether to prompt for another line and how much to indent it by processing the Python code that was typed in. As we've moved towards supporting multiple languages, it's not appropriate for the frontend to make that decision, so it has to ask the kernel about it. It does that by making is_complete_request to the kernel: http://jupyter-client.readthedocs.org/en/latest/messaging.html#code-completeness Assuming you're using the Qt console with an IPython kernel, it should still be straightforward to use that, but I guess it needs some changes in your integration code to make sure the message gets through. The widget object now has an is_complete method, which you can see here: https://github.com/jupyter/qtconsole/blob/f2c8a31c387ce1e020ccdbb020091de2ee98dbf9/qtconsole/frontend_widget.py#L260 Best wishes, Thomas _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev -- Ray Osborn, Senior Scientist Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: ROsborn at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From rosborn at anl.gov Sun Nov 29 12:27:47 2015 From: rosborn at anl.gov (Osborn, Raymond) Date: Sun, 29 Nov 2015 17:27:47 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> Message-ID: It occurs to me that I should mention that I?m using the inprocess kernel. I am wondering if the ?is_complete? request is trying to be sent to a real socket rather than the dummy socket that the inprocess client is using. Perhaps I have to reassign the blocking client it uses for such requests. Ray On Nov 29, 2015, at 8:47 AM, Ray Osborn > wrote: Thanks for your reply. My inheritance chain includes the console_widget, so I have access to the _is_complete function, but it looks like I might have a different problem. I?ve been running this through my debugger again, and if I set ?execute_on_complete_input? to False, it doesn?t call the _is_complete function and assumes everything is complete. The shell then works apart from multiline editing. However, if I set ?execute_on_complete_input? to True (the default), then it calls the _is_complete function, sends an ?is_complete? request to the frontend, but never gets a reply. It calls the get_msg function in jupyiter_client/blocking/channels.py, but this always raises Empty. Sometimes the debugger causes timeout problems, but even when I remove all the breakpoints except for call to self._recv, it is never triggered, and this seems to explain why no lines in the shell are recorded as complete. I?ll see if I can reproduce this chain in the IPython qtconsole. Ray On Nov 29, 2015, at 6:22 AM, Thomas Kluyver > wrote: Hi Ray, On 28 November 2015 at 21:08, Osborn, Raymond > wrote: However, I only just noticed that we seem to have lost the ability to do multiline editing, without using the Ctrl key modifier. Even with the modifier, the indent is not correctly set, so the behavior has diverged from the ipython qtconsole, where multiline editing is automatic if the code is not complete and a proper indent is set. I think I know what you're running into. In previous versions of the Qt console, the frontend decided whether to prompt for another line and how much to indent it by processing the Python code that was typed in. As we've moved towards supporting multiple languages, it's not appropriate for the frontend to make that decision, so it has to ask the kernel about it. It does that by making is_complete_request to the kernel: http://jupyter-client.readthedocs.org/en/latest/messaging.html#code-completeness Assuming you're using the Qt console with an IPython kernel, it should still be straightforward to use that, but I guess it needs some changes in your integration code to make sure the message gets through. The widget object now has an is_complete method, which you can see here: https://github.com/jupyter/qtconsole/blob/f2c8a31c387ce1e020ccdbb020091de2ee98dbf9/qtconsole/frontend_widget.py#L260 Best wishes, Thomas _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev -- Ray Osborn, Senior Scientist Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: ROsborn at anl.gov -- Ray Osborn, Senior Scientist Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: ROsborn at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Sun Nov 29 12:42:42 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Sun, 29 Nov 2015 17:42:42 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> Message-ID: On 29 November 2015 at 17:27, Osborn, Raymond wrote: > It occurs to me that I should mention that I?m using the inprocess kernel. > I am wondering if the ?is_complete? request is trying to be sent to a real > socket rather than the dummy socket that the inprocess client is using. > Perhaps I have to reassign the blocking client it uses for such requests. > Aha. The inprocess kernel is decidedly unloved, and it may well cause problems with this. I seem to remember Min saying something about this. On the plus side, the in process kernel has to be Python, so it would be practical to reuse the kernel machinery to determine completeness. Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From rosborn at anl.gov Sun Nov 29 15:36:58 2015 From: rosborn at anl.gov (Osborn, Raymond) Date: Sun, 29 Nov 2015 20:36:58 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> Message-ID: <36371C14-3709-4BF9-A99A-A39EB0BA0976@anl.gov> After a lot of digging through the weeds, it turned out that the answer was surprisingly simple. As you suggested, the machinery is all there. I had to subclass the RichJupyterWidget to handle calls to ?_is_complete': from qtconsole.rich_jupyter_widget import RichJupyterWidget class NXRichJupyterWidget(RichJupyterWidget): def _is_complete(self, source, interactive=True): shell = self.kernel_manager.kernel.shell status, indent_spaces = shell.input_transformer_manager.check_complete(source) if indent_spaces is None: indent = '' else: indent = ' ' * indent_spaces return status != 'incomplete', indent I?m not sure if this is appropriate for a pull request, because I don?t know where you would put the above code. Perhaps the RichJupyterWidget could be subclassed in qtconsole/inprocess.py, since my solution is specific to the in-process kernel. If you can see any other problems with the above, please let me know. I would like to issue a fix to NeXpy, as long as I?ve understood all its implications. Thanks for your guidance, Ray On Nov 29, 2015, at 11:42 AM, Thomas Kluyver > wrote: On 29 November 2015 at 17:27, Osborn, Raymond > wrote: It occurs to me that I should mention that I?m using the inprocess kernel. I am wondering if the ?is_complete? request is trying to be sent to a real socket rather than the dummy socket that the inprocess client is using. Perhaps I have to reassign the blocking client it uses for such requests. Aha. The inprocess kernel is decidedly unloved, and it may well cause problems with this. I seem to remember Min saying something about this. On the plus side, the in process kernel has to be Python, so it would be practical to reuse the kernel machinery to determine completeness. Thomas _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev -- Ray Osborn, Senior Scientist Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: ROsborn at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Mon Nov 30 06:20:48 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 30 Nov 2015 11:20:48 +0000 Subject: [IPython-dev] Multiline editing in a qtconsole-style app In-Reply-To: <36371C14-3709-4BF9-A99A-A39EB0BA0976@anl.gov> References: <0B4F9EAF-FDEF-4FFD-B860-20919E9247A3@anl.gov> <4737CB21-45C1-40B1-ABBB-9847752ED63B@anl.gov> <36371C14-3709-4BF9-A99A-A39EB0BA0976@anl.gov> Message-ID: Hi Ray, I think that fix looks good. On 29 November 2015 at 20:36, Osborn, Raymond wrote: > I?m not sure if this is appropriate for a pull request, because I don?t > know where you would put the above code. Perhaps the RichJupyterWidget > could be subclassed in qtconsole/inprocess.py, since my solution is > specific to the in-process kernel. > I think that makes sense. It's really more an in-process-executing variant of the console widget than an in-process kernel, so I think subclassing the widget is a reasonable approach. Do you want to submit a pull request doing that? Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: