From rjtskolasinski at gmail.com Fri Jan 2 12:43:48 2015 From: rjtskolasinski at gmail.com (=?UTF-8?Q?Rafa=C5=82_Skolasi=C5=84ski?=) Date: Fri, 2 Jan 2015 18:43:48 +0100 Subject: [IPython-dev] Making custom converter/template with nbconvert In-Reply-To: References: <17558727-CFFE-4B0F-87F9-B0C7B5C58799@gmail.com> Message-ID: Hi guys, My converter starts to take the final form. I am now working on handling used figures in some clever way. All of them that are generated in notebooks and are in output fields go in smooth way. I have some problem with figures that are put inside text in markdowns, i.ex. as ![some_caption](files/dot.png) which goes in html into some_caption

caption

(as a template very similar to basic one). How can force converter to not skip 'files/' to have src="files/dot.png"? Probably it lies somewhere in template but I couldn't localize it. Cheers, Rafa? 2014-12-19 17:57 GMT+01:00 Rafa? Skolasi?ski : > Ok. I found it. > Now the corresponding line should be > exportHtml = > HTMLExporter(config=Config({'HTMLExporter':{'template_file':'basic'}})) > instead of > exportHtml = > HTMLExporter(config=Config({'HTMLExporter':{'default_template':'basic'}})) > > > 2014-12-19 17:12 GMT+01:00 Rafa? Skolasi?ski : >> >> Hi guys, >> >> I got some kind of working version. It almost do what I want from it (at >> least for first working version). >> http://pastebin.com/bi0003LS >> >> Of course later there will come more functionality and polishing. >> >> Although I got strange problem. It looks like my converter ignores fact I >> ask it for using 'basic' template. >> >> Does the syntax for it changed? I was basing on this old tutorial: >> >> http://nbviewer.ipython.org/github/ipython/ipython-in-depth/blob/master/examples/Notebook/Using%20nbconvert%20as%20a%20Library.ipynb >> >> Best, >> Rafal >> >> 2014-12-18 22:38 GMT+01:00 Rafa? Skolasi?ski : >>> >>> I will ; - ) >>> >>> 2014-12-18 22:36 GMT+01:00 Fernando Perez : >>> >>>> >>>> On Thu, Dec 18, 2014 at 9:06 AM, Rafa? Skolasi?ski < >>>> rjtskolasinski at gmail.com> wrote: >>>>> >>>>> I will let you know if I will encounter any problems. >>>> >>>> >>>> And please post here on the list once you have something up and >>>> running. It's very important for the project to show how others use it not >>>> only as an interactive environment, but also as infrastructure to build >>>> upon. That's the kind of clear value that helps us secure resources to >>>> sustain its development. >>>> >>>> Best >>>> >>>> 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 >>>> >>>> _______________________________________________ >>>> 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: From dsdale24 at gmail.com Sat Jan 3 10:45:41 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Sat, 03 Jan 2015 15:45:41 +0000 Subject: [IPython-dev] embedding ipython, namespace question References: Message-ID: Hi Ray, On Sat Dec 27 2014 at 8:48:20 PM Osborn, Raymond wrote: > I don?t really understand what you are trying to achieve, but the > ?user_ns? dictionary isn?t an isolated namespace - it?s the namespace that > is used by the console, and I would have thought you would have to do some > kind of injection to add other objects from within the application. > What I am trying to achieve is explicitly documented at http://ipython.org/ipython-doc/dev/interactive/reference.html#embedding-ipython : --- It is also possible to embed an IPython shell in a namespace in your Python code. This allows you to evaluate dynamically the state of your code, operate with your variables, analyze them, etc. Note however that any changes you make to values while in the shell do not propagate back to the running code, so it is safe to modify your values because you won?t break your code in bizarre ways by doing so. Note At present, embedding IPython cannot be done from inside IPython. Run the code samples below outside IPython. [DD: I am not attempting to embed ipython from inside ipython] This feature allows you to easily have a fully functional python environment for doing object introspection anywhere in your code with a simple function call. In some cases a simple print statement is enough, but if you need to do more detailed analysis of a code fragment this feature can be very valuable. It can also be useful in scientific computing situations where it is common to need to do some automatic, computationally intensive part and then stop to look at data, plots, etc. Opening an IPython instance will give you full access to your data and functions, and you can resume program execution once you are done with the interactive part (perhaps to stop again later, as many times as needed). The following code snippet is the bare minimum you need to include in your Python programs for this to work (detailed examples follow later): from IPython import embed embed() # this call anywhere in your program will start IPython You can also embed an IPython kernel, for use with qtconsole, etc. via IPython.embed_kernel(). This should function work the same way, but you can connect an external frontend (ipython qtconsole or ipython console), rather than interacting with it in the terminal. --- This is impressively simple for the embed function: --- C:\Users\darren> python Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://binstar.org >>> from IPython import embed >>> a=1 >>> embed() Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) [MSC v.1500 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information. IPython 2.3.1 -- An enhanced Interactive Python. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://binstar.org ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: a Out[1]: 1 --- But I have not been able to achieve the same behavior with the qt in-process console. Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From ra092767 at ime.unicamp.br Sat Jan 3 21:27:02 2015 From: ra092767 at ime.unicamp.br (Raniere Silva) Date: Sun, 4 Jan 2015 00:27:02 -0200 Subject: [IPython-dev] Making custom converter/template with nbconvert In-Reply-To: References: <17558727-CFFE-4B0F-87F9-B0C7B5C58799@gmail.com> Message-ID: <20150104022702.GM1209@buriti.rgaiacs.com> Hi Rafa?, > I have some problem with figures that are put inside text in markdowns, > i.ex. as > ![some_caption](files/dot.png) > which goes in html into some_caption

class="caption">caption

> (as a template very similar to basic one). > > How can force converter to not skip 'files/' to have src="files/dot.png"? > Probably it lies somewhere in template but I couldn't localize it. I couldn't reproduce your problem. $ cat sample.ipynb { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![foo](folder/bar.jpg)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "IPython (Python 3)", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3" }, "signature": "sha256:5c8cb31d4083cbf815d3e1dff7a3cc229fa54b9c02cff82af4548cef72581573" }, "nbformat": 4, "nbformat_minor": 0 } $ ipython nbconvert --to html sample.ipynb [NbConvertApp] Using existing profile dir: '/home/raniere/.ipython/profile_default' [NbConvertApp] Converting notebook sample.ipynb to html [NbConvertApp] Support files will be in sample_files/ [NbConvertApp] Loaded template full.tpl [NbConvertApp] Writing 223380 bytes to sample.html $ grep 'foo

What version of IPython/Jupyter are you using? I tested with $ ipython --version 3.0.0-dev Cheers, Raniere -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From fperez.net at gmail.com Sat Jan 3 22:29:50 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 3 Jan 2015 19:29:50 -0800 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team Message-ID: We'd like to welcome Kyle Kelley and Nick Bollweg to the core development team. In Kyle's case this is a long-overdue announcement, as Kyle has been a core dev for quite a while now, we just hadn't been very good about communicating that on-list. Kyle, thanks to Racksspace's generous support for the project, Trying to redress that lack of communication, in Nick's case we're not waiting :) Nick has been making great contributions to nbviewer, widgets, and overall discussions in the project, and accepted to be a core developer moving forward, as his other obligations allow. Welcome (if belatedly) to both! 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: From rjtskolasinski at gmail.com Sun Jan 4 08:19:01 2015 From: rjtskolasinski at gmail.com (=?UTF-8?Q?Rafa=C5=82_Skolasi=C5=84ski?=) Date: Sun, 4 Jan 2015 14:19:01 +0100 Subject: [IPython-dev] Making custom converter/template with nbconvert In-Reply-To: <20150104022702.GM1209@buriti.rgaiacs.com> References: <17558727-CFFE-4B0F-87F9-B0C7B5C58799@gmail.com> <20150104022702.GM1209@buriti.rgaiacs.com> Message-ID: Hi Raniere, The problem occurred when folder was named 'files'. When I renamed it to 'figures' it behaves as in your example. I must say that this very weird behavior but there must be some reason for that probably. Cheers, Rafa? 2015-01-04 3:27 GMT+01:00 Raniere Silva : > Hi Rafa?, > > > I have some problem with figures that are put inside text in markdowns, > > i.ex. as > > ![some_caption](files/dot.png) > > which goes in html into some_caption

> class="caption">caption

> > (as a template very similar to basic one). > > > > How can force converter to not skip 'files/' to have src="files/dot.png"? > > Probably it lies somewhere in template but I couldn't localize it. > > I couldn't reproduce your problem. > > $ cat sample.ipynb > { > "cells": [ > { > "cell_type": "markdown", > "metadata": {}, > "source": [ > "![foo](folder/bar.jpg)" > ] > }, > { > "cell_type": "code", > "execution_count": null, > "metadata": { > "collapsed": true > }, > "outputs": [], > "source": [] > } > ], > "metadata": { > "kernelspec": { > "display_name": "IPython (Python 3)", > "name": "python3" > }, > "language_info": { > "codemirror_mode": { > "name": "ipython", > "version": 3 > }, > "file_extension": ".py", > "mimetype": "text/x-python", > "name": "python", > "nbconvert_exporter": "python", > "pygments_lexer": "ipython3" > }, > "signature": > "sha256:5c8cb31d4083cbf815d3e1dff7a3cc229fa54b9c02cff82af4548cef72581573" > }, > "nbformat": 4, > "nbformat_minor": 0 > } > $ ipython nbconvert --to html sample.ipynb > [NbConvertApp] Using existing profile dir: > '/home/raniere/.ipython/profile_default' > [NbConvertApp] Converting notebook sample.ipynb to html > [NbConvertApp] Support files will be in sample_files/ > [NbConvertApp] Loaded template full.tpl > [NbConvertApp] Writing 223380 bytes to sample.html > $ grep '

foo

> > What version of IPython/Jupyter are you using? I tested with > > $ ipython --version > 3.0.0-dev > > Cheers, > Raniere > > _______________________________________________ > 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: From schueller at phimeca.com Sun Jan 4 12:31:00 2015 From: schueller at phimeca.com (Julien Schueller) Date: Sun, 4 Jan 2015 18:31:00 +0100 (CET) Subject: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook In-Reply-To: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> References: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> Message-ID: <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> Hello, I'm having trouble overloading _repr_svg_ for graph inlining in the notebook; my object is displayed twice if I call plt.plot just before. I assumed a figure was left open or something, but even if I call plt.close('all') between the matplotlib calls, the result remains the same. I did some imports first: import numpy as np import matplotlib.pyplot as plt import matplotlib from scipy.stats import norm import sys import io print('matplotlib version %s' % matplotlib.__version__) import IPython print('IPython version %s' % IPython.__version__) Here'my object: class NormGraph(object): def __init__(self): super(NormGraph, self).__init__() def _repr_svg_(self): if sys.version_info[0] >= 3: output = io.StringIO() else: output = io.BytesIO() self._fig = plt.figure() axes_kwargs = {} plot_kwargs = {} self._ax = [self._fig.add_subplot(111, **axes_kwargs)] x = np.arange(-10, 10, 0.001) y = norm.pdf(x,0,2) self._ax[0].plot(x, y, **plot_kwargs) self._fig.savefig(output, format='svg') return output.getvalue() Then a basic call to pyplot: %matplotlib inline plt.plot(0, 1) Then if I try to inline my object it's displayed twice: NormGraph() I atached the complete notebook. -- Julien Schueller Phimeca Engineering www.phimeca.com -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled0.ipynb Type: application/octet-stream Size: 40341 bytes Desc: not available URL: From ssanderson at quantopian.com Sun Jan 4 13:01:24 2015 From: ssanderson at quantopian.com (ssanderson) Date: Sun, 4 Jan 2015 10:01:24 -0800 (PST) Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: Message-ID: <1420394484530-5082155.post@n6.nabble.com> Congrats! -- View this message in context: http://python.6.x6.nabble.com/Welcoming-Kyle-Kelley-and-Nick-Bollweg-to-the-core-Jupyter-IPython-team-tp5082131p5082155.html Sent from the IPython - Development mailing list archive at Nabble.com. From takowl at gmail.com Mon Jan 5 12:43:57 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 5 Jan 2015 17:43:57 +0000 Subject: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook In-Reply-To: <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> References: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> Message-ID: If you've done '%matplotlib inline' previously, when you create a figure inside a cell, it will automatically be displayed at the end of that cell, separately from the regular repr system. So your _repr_svg_ method is getting called once, and the figure you create in that is being displayed again. I'm not sure what the best way to deal with that is. Thomas On 4 January 2015 at 17:31, Julien Schueller wrote: > > > > Hello, > > I'm having trouble overloading _repr_svg_ for graph inlining in the > notebook; my object is displayed twice if I call plt.plot just before. > I assumed a figure was left open or something, but even if I call > plt.close('all') between the matplotlib calls, the result remains the same. > > I did some imports first: > import numpy as np > import matplotlib.pyplot as plt > import matplotlib > from scipy.stats import norm > import sys > import io > print('matplotlib version %s' % matplotlib.__version__) > import IPython > print('IPython version %s' % IPython.__version__) > > > Here'my object: > class NormGraph(object): > def __init__(self): > super(NormGraph, self).__init__() > def _repr_svg_(self): > if sys.version_info[0] >= 3: > output = io.StringIO() > else: > output = io.BytesIO() > self._fig = plt.figure() > axes_kwargs = {} > plot_kwargs = {} > self._ax = [self._fig.add_subplot(111, **axes_kwargs)] > x = np.arange(-10, 10, 0.001) > y = norm.pdf(x,0,2) > self._ax[0].plot(x, y, **plot_kwargs) > self._fig.savefig(output, format='svg') > > return output.getvalue() > > > Then a basic call to pyplot: > %matplotlib inline > plt.plot(0, 1) > > Then if I try to inline my object it's displayed twice: > NormGraph() > > I atached the complete notebook. > > -- > Julien Schueller > Phimeca Engineering > www.phimeca.com > > _______________________________________________ > 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: From tritemio at gmail.com Mon Jan 5 14:06:50 2015 From: tritemio at gmail.com (Antonino Ingargiola) Date: Mon, 5 Jan 2015 11:06:50 -0800 Subject: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook In-Reply-To: References: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> Message-ID: Hi, I don't know if it helps but with plain matplotlib you can close the figure and call display(fig) on the closed figure. I use this trick to plot several figures in a loop (closing them at each iteration) or for updating plots via widgets. Antonio On Mon, Jan 5, 2015 at 9:43 AM, Thomas Kluyver wrote: > If you've done '%matplotlib inline' previously, when you create a figure > inside a cell, it will automatically be displayed at the end of that cell, > separately from the regular repr system. So your _repr_svg_ method is > getting called once, and the figure you create in that is being displayed > again. I'm not sure what the best way to deal with that is. > > Thomas > > On 4 January 2015 at 17:31, Julien Schueller > wrote: > >> >> >> >> Hello, >> >> I'm having trouble overloading _repr_svg_ for graph inlining in the >> notebook; my object is displayed twice if I call plt.plot just before. >> I assumed a figure was left open or something, but even if I call >> plt.close('all') between the matplotlib calls, the result remains the same. >> >> I did some imports first: >> import numpy as np >> import matplotlib.pyplot as plt >> import matplotlib >> from scipy.stats import norm >> import sys >> import io >> print('matplotlib version %s' % matplotlib.__version__) >> import IPython >> print('IPython version %s' % IPython.__version__) >> >> >> Here'my object: >> class NormGraph(object): >> def __init__(self): >> super(NormGraph, self).__init__() >> def _repr_svg_(self): >> if sys.version_info[0] >= 3: >> output = io.StringIO() >> else: >> output = io.BytesIO() >> self._fig = plt.figure() >> axes_kwargs = {} >> plot_kwargs = {} >> self._ax = [self._fig.add_subplot(111, **axes_kwargs)] >> x = np.arange(-10, 10, 0.001) >> y = norm.pdf(x,0,2) >> self._ax[0].plot(x, y, **plot_kwargs) >> self._fig.savefig(output, format='svg') >> >> return output.getvalue() >> >> >> Then a basic call to pyplot: >> %matplotlib inline >> plt.plot(0, 1) >> >> Then if I try to inline my object it's displayed twice: >> NormGraph() >> >> I atached the complete notebook. >> >> -- >> Julien Schueller >> Phimeca Engineering >> www.phimeca.com >> >> _______________________________________________ >> 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: From darcamo at gmail.com Mon Jan 5 14:14:56 2015 From: darcamo at gmail.com (darcamo at gmail.com) Date: Mon, 05 Jan 2015 19:14:56 +0000 Subject: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook References: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> Message-ID: Call plt.close(self._fig) after savefig and the inline plot should not be shown. Since you are using the figure only to convert to svg with savefig and you need to close it to avoid the inline plot, then there is no reason to keep it as an instance attribute. It might also be a good idea to disable matplotlib interactive mode by calling plt.ioff() before creating the figure object and reenabling it after the figure is closed by calling plt.ion(). -- Darlan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Mon Jan 5 17:01:53 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 5 Jan 2015 14:01:53 -0800 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: <1420394484530-5082155.post@n6.nabble.com> References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: Thanks so much for your work Kyle and Nick! Cheers, Brian On Sun, Jan 4, 2015 at 10:01 AM, ssanderson wrote: > Congrats! > > > > -- > View this message in context: > http://python.6.x6.nabble.com/Welcoming-Kyle-Kelley-and-Nick-Bollweg-to-the-core-Jupyter-IPython-team-tp5082131p5082155.html > Sent from the IPython - Development mailing list archive at Nabble.com. > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From schueller at phimeca.com Tue Jan 6 04:20:52 2015 From: schueller at phimeca.com (Julien Schueller) Date: Tue, 6 Jan 2015 10:20:52 +0100 (CET) Subject: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook In-Reply-To: References: <2107085751.5438082.1418729306654.JavaMail.zimbra@phimeca.com> <1095968995.59454.1420392660687.JavaMail.zimbra@phimeca.com> Message-ID: <1463575469.219037.1420536052858.JavaMail.zimbra@phimeca.com> ----- Mail original ----- > De: darcamo at gmail.com > ?: "IPython developers list" > Envoy?: Lundi 5 Janvier 2015 20:14:56 > Objet: Re: [IPython-dev] graph displayed twice while overloading _repr_svg_ for notebook > > Call plt.close(self._fig) after savefig and the inline plot should not be > shown. Since you are using the figure only to convert to svg with savefig > and you need to close it to avoid the inline plot, then there is no reason > to keep it as an instance attribute. > > It might also be a good idea to disable matplotlib interactive mode by > calling plt.ioff() before creating the figure object and reenabling it after > the figure is closed by calling plt.ion(). > > -- > Darlan > That was it, thanks! From ellisonbg at gmail.com Tue Jan 6 13:53:06 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 6 Jan 2015 10:53:06 -0800 Subject: [IPython-dev] Change in weekly dev meeting times Message-ID: Hi all! In the past we have had two weekly dev meetings: * Tuesday 9:30-11am PST = special topics as needed * Thursday 9:30-11am PST = general topics, always happens Because of some scheduling conflicts, we are going to swap those starting this week: * Tuesday 9:30-11am PST = general topics, always happens * Thursday 9:30-11am PST = special topics as needed Thus, this Th, we will not have a regular, general meeting. We may have a special topics meeting if needed, but we aren't sure yet. Out next general meeting will be next Tuesday 9:30am PST. Se you all soon! Cheers, Brian -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Thu Jan 8 13:04:10 2015 From: benjaminrk at gmail.com (MinRK) Date: Thu, 8 Jan 2015 10:04:10 -0800 Subject: [IPython-dev] Notebook websocket change Message-ID: Alternative notebook frontend authors: There is an upcoming change to websocket connections to the notebook server. Instead of three websockets per notebook, one for each zmq channel, there is a single websocket connection between the server and client. The channel associated with each message is identified by a channel key in the message dict itself. Relevant changes: - url is /channels instead of /shell, etc. - when sending a message, add a channel key with the channel name ('shell', 'stdin') - when receiving a message, check the channel key for routing -MinRK ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wstein at gmail.com Thu Jan 8 13:10:10 2015 From: wstein at gmail.com (William Stein) Date: Thu, 8 Jan 2015 10:10:10 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: > Alternative notebook frontend authors: > > There is an upcoming change to websocket connections to the notebook server. > Instead of three websockets per notebook, one for each zmq channel, there is > a single websocket connection between the server and client. The channel > associated with each message is identified by a channel key in the message > dict itself. > > Relevant changes: > > url is /channels instead of /shell, etc. > when sending a message, add a channel key with the channel name ('shell', > 'stdin') > when receiving a message, check the channel key for routing > > -MinRK Thanks. Of related interest, what the situation involving providing a fallback to websockets? I tried to only support websockets connections with SageMathCloud for a few weeks, and immediately ran into many complaints from users who couldn't connect as a result. This is even with https and so on -- it's just a sad fact that in some corporate or otherwise constrained environments that websockets don't work. By far the best approach I found was to use Primus + Engine.io, which uses websockets if possible, but will fallback to polling. So this is what SMC does now, and everything works, even for people that don't have websockets as an option... except for IPython-in-SMC of course, which doesn't work. Another unrelated issue is that I'm now hardcoding making this change around line 171 of IPython/html/notebookapp.py, since I want to serve the purely static html of IPython from a completely different web server: #static_url_prefix = url_path_join(base_url,'/static/'), static_url_prefix = '/static/ipython/', (Sorry for derailing the thread.) -- William > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- William Stein Professor of Mathematics University of Washington http://wstein.org From ellisonbg at gmail.com Thu Jan 8 13:19:19 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 8 Jan 2015 10:19:19 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: So far we have felt that it isn't worth the complexity cost for us to support people that deliberately choose to break the internet. It is not like WebSockets is some crazy, insecure, unsupported hack over a weird port. It is just different bytes going over the same HTTP/HTTPS socket connection and is essentially a formal standard (I know you know this - this is our messaging to companies who complain). Our situation is a bit different though than SMC because most of our current users run the notebook on their own computers. This may be something that we eventually want to rethink as more people run this in the cloud. However, I would like to push back on the companies choosing to break the internet really hard before giving in. I am guessing that in most cases, WebSockets are broken in enterprise setting not because of some important deliberate choice, but rather because people don't understand it and are using default settings that disable them (I could be wrong though).... Cheers, Brian On Thu, Jan 8, 2015 at 10:10 AM, William Stein wrote: > On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: > > Alternative notebook frontend authors: > > > > There is an upcoming change to websocket connections to the notebook > server. > > Instead of three websockets per notebook, one for each zmq channel, > there is > > a single websocket connection between the server and client. The channel > > associated with each message is identified by a channel key in the > message > > dict itself. > > > > Relevant changes: > > > > url is /channels instead of /shell, etc. > > when sending a message, add a channel key with the channel name ('shell', > > 'stdin') > > when receiving a message, check the channel key for routing > > > > -MinRK > > Thanks. > > Of related interest, what the situation involving providing a fallback > to websockets? > > I tried to only support websockets connections with SageMathCloud for > a few weeks, and immediately ran into many complaints from users who > couldn't connect as a result. This is even with https and so on -- > it's just a sad fact that in some corporate or otherwise constrained > environments that websockets don't work. By far the best approach I > found was to use Primus + Engine.io, which uses websockets if > possible, but will fallback to polling. So this is what SMC does > now, and everything works, even for people that don't have websockets > as an option... except for IPython-in-SMC of course, which doesn't > work. > > Another unrelated issue is that I'm now hardcoding making this change > around line 171 of IPython/html/notebookapp.py, since I want to serve > the purely static html of IPython from a completely different web > server: > > #static_url_prefix = url_path_join(base_url,'/static/'), > static_url_prefix = '/static/ipython/', > > (Sorry for derailing the thread.) > > -- William > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wstein at gmail.com Thu Jan 8 13:55:53 2015 From: wstein at gmail.com (William Stein) Date: Thu, 8 Jan 2015 10:55:53 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger wrote: > So far we have felt that it isn't worth the complexity cost for us to > support people that deliberately choose to break the internet. It is not > like WebSockets is some crazy, insecure, unsupported hack over a weird port. > It is just different bytes going over the same HTTP/HTTPS socket connection > and is essentially a formal standard (I know you know this - this is our > messaging to companies who complain). I know -- that's why I switched SMC to pure websockets for a while. Then I received complaints at a rate of about 2 very desperate users per week, and these were the people who cared enough to complain repeatedly. > Our situation is a bit different though than SMC because most of our current > users run the notebook on their own computers. This may be something that we > eventually want to rethink as more people run this in the cloud. However, I > would like to push back on the companies choosing to break the internet > really hard before giving in. I am guessing that in most cases, WebSockets > are broken in enterprise setting not because of some important deliberate > choice, but rather because people don't understand it and are using default > settings that disable them (I could be wrong though).... In my experience, for some people that's exactly the problem. For one person I helped it turned out their specific problem was the Windows install they had access to had websockets explicitly disabled -- perhaps that was an IT policy. For other people the problem is further along the stack (e.g., possibly involving caching). Anyway, this change so that "there is a single websocket connection between the server and client. " makes implementing an alternative to WebSocket as a fallback dramatically easier, which I greatly appreciate. > Our situation is a bit different though than SMC because most of our current > users run the notebook on their own computers. This may be something that we Just curious -- how do you know that most people using IPython aren't already using it through SMC? William > > Cheers, > > Brian > > > > On Thu, Jan 8, 2015 at 10:10 AM, William Stein wrote: >> >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: >> > Alternative notebook frontend authors: >> > >> > There is an upcoming change to websocket connections to the notebook >> > server. >> > Instead of three websockets per notebook, one for each zmq channel, >> > there is >> > a single websocket connection between the server and client. The channel >> > associated with each message is identified by a channel key in the >> > message >> > dict itself. >> > >> > Relevant changes: >> > >> > url is /channels instead of /shell, etc. >> > when sending a message, add a channel key with the channel name >> > ('shell', >> > 'stdin') >> > when receiving a message, check the channel key for routing >> > >> > -MinRK >> >> Thanks. >> >> Of related interest, what the situation involving providing a fallback >> to websockets? >> >> I tried to only support websockets connections with SageMathCloud for >> a few weeks, and immediately ran into many complaints from users who >> couldn't connect as a result. This is even with https and so on -- >> it's just a sad fact that in some corporate or otherwise constrained >> environments that websockets don't work. By far the best approach I >> found was to use Primus + Engine.io, which uses websockets if >> possible, but will fallback to polling. So this is what SMC does >> now, and everything works, even for people that don't have websockets >> as an option... except for IPython-in-SMC of course, which doesn't >> work. >> >> Another unrelated issue is that I'm now hardcoding making this change >> around line 171 of IPython/html/notebookapp.py, since I want to serve >> the purely static html of IPython from a completely different web >> server: >> >> #static_url_prefix = url_path_join(base_url,'/static/'), >> static_url_prefix = '/static/ipython/', >> >> (Sorry for derailing the thread.) >> >> -- William >> >> > >> > >> > _______________________________________________ >> > IPython-dev mailing list >> > IPython-dev at scipy.org >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> >> >> >> -- >> William Stein >> Professor of Mathematics >> University of Washington >> http://wstein.org >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > @ellisonbg on Twitter and GitHub > bgranger at calpoly.edu and ellisonbg at gmail.com > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- William Stein Professor of Mathematics University of Washington http://wstein.org From benjaminrk at gmail.com Thu Jan 8 14:18:43 2015 From: benjaminrk at gmail.com (MinRK) Date: Thu, 8 Jan 2015 11:18:43 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: Some time ago, I made a PR to IPython switching to socket.io, which required the same basic changes since it only allowed a single connection per page, so I know it's not too hard. We may start to see more pressure as hosted instances, and reconsider the fallback in the future, but at this point, we don't feel that pressure. Wind proper websockets to be sufficiently preferable that we will wait as long as we can before appeasing old, broken, or misconfigured network environments that prevent websockets from working. The majority of notebook users seem to be running as a desktop app via localhost, where websockets are rarely a problem (The nightmare of Sophos AV/firewall on Windows excluded). -MinRK On Thu, Jan 8, 2015 at 10:55 AM, William Stein wrote: > On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger > wrote: > > So far we have felt that it isn't worth the complexity cost for us to > > support people that deliberately choose to break the internet. It is not > > like WebSockets is some crazy, insecure, unsupported hack over a weird > port. > > It is just different bytes going over the same HTTP/HTTPS socket > connection > > and is essentially a formal standard (I know you know this - this is our > > messaging to companies who complain). > > I know -- that's why I switched SMC to pure websockets for a while. > Then I received complaints at a rate of about 2 very desperate users > per week, and these were the people who cared enough to complain > repeatedly. > > > Our situation is a bit different though than SMC because most of our > current > > users run the notebook on their own computers. This may be something > that we > > eventually want to rethink as more people run this in the cloud. > However, I > > would like to push back on the companies choosing to break the internet > > really hard before giving in. I am guessing that in most cases, > WebSockets > > are broken in enterprise setting not because of some important deliberate > > choice, but rather because people don't understand it and are using > default > > settings that disable them (I could be wrong though).... > > In my experience, for some people that's exactly the problem. For one > person I helped it turned out their specific problem was the Windows > install they had access to had websockets explicitly disabled -- > perhaps that was an IT policy. For other people the problem is > further along the stack (e.g., possibly involving caching). > > Anyway, this change so that "there is a single websocket connection > between the server and client. " makes implementing an alternative to > WebSocket as a fallback dramatically easier, which I greatly > appreciate. > > > Our situation is a bit different though than SMC because most of our > current > > users run the notebook on their own computers. This may be something > that we > > Just curious -- how do you know that most people using IPython aren't > already using it through SMC? > > William > > > > > Cheers, > > > > Brian > > > > > > > > On Thu, Jan 8, 2015 at 10:10 AM, William Stein wrote: > >> > >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: > >> > Alternative notebook frontend authors: > >> > > >> > There is an upcoming change to websocket connections to the notebook > >> > server. > >> > Instead of three websockets per notebook, one for each zmq channel, > >> > there is > >> > a single websocket connection between the server and client. The > channel > >> > associated with each message is identified by a channel key in the > >> > message > >> > dict itself. > >> > > >> > Relevant changes: > >> > > >> > url is /channels instead of /shell, etc. > >> > when sending a message, add a channel key with the channel name > >> > ('shell', > >> > 'stdin') > >> > when receiving a message, check the channel key for routing > >> > > >> > -MinRK > >> > >> Thanks. > >> > >> Of related interest, what the situation involving providing a fallback > >> to websockets? > >> > >> I tried to only support websockets connections with SageMathCloud for > >> a few weeks, and immediately ran into many complaints from users who > >> couldn't connect as a result. This is even with https and so on -- > >> it's just a sad fact that in some corporate or otherwise constrained > >> environments that websockets don't work. By far the best approach I > >> found was to use Primus + Engine.io, which uses websockets if > >> possible, but will fallback to polling. So this is what SMC does > >> now, and everything works, even for people that don't have websockets > >> as an option... except for IPython-in-SMC of course, which doesn't > >> work. > >> > >> Another unrelated issue is that I'm now hardcoding making this change > >> around line 171 of IPython/html/notebookapp.py, since I want to serve > >> the purely static html of IPython from a completely different web > >> server: > >> > >> #static_url_prefix = url_path_join(base_url,'/static/'), > >> static_url_prefix = '/static/ipython/', > >> > >> (Sorry for derailing the thread.) > >> > >> -- William > >> > >> > > >> > > >> > _______________________________________________ > >> > IPython-dev mailing list > >> > IPython-dev at scipy.org > >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > > >> > >> > >> > >> -- > >> William Stein > >> Professor of Mathematics > >> University of Washington > >> http://wstein.org > >> _______________________________________________ > >> IPython-dev mailing list > >> IPython-dev at scipy.org > >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > -- > > Brian E. Granger > > Cal Poly State University, San Luis Obispo > > @ellisonbg on Twitter and GitHub > > bgranger at calpoly.edu and ellisonbg at gmail.com > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.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: From rgbkrk at gmail.com Thu Jan 8 14:33:52 2015 From: rgbkrk at gmail.com (Kyle Kelley) Date: Thu, 8 Jan 2015 13:33:52 -0600 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: You're right Brian, it's about them buying some $FIREWALL_IPS_SUPER_PRICEY_DEVICE that doesn't proxy websockets appropriately and the person purchasing having no clue other than the fact that $VENDOR gave them a neat trinket at a conference. Firewalls and proxies that do handle websockets appropriately do exist. I'd be tempted to make a list of ones that do it well and display them prominently, if only for the benefit of our own users. I have witnessed these flavors of IPython in the wild (not including our own recent stunts): * Corporate entities using an Anaconda server (websockets not a problem internally but were externally) * People of all backgrounds using Anaconda's IPython notebook bundling * Vanilla installations from package managers or pip * Hosted instance of their own flavor * DIT4C Most users that we hear from are using a local installation and there's probably a large amount of confirmation bias. It would be great if we had actual shared metrics between us but we only know: * Unique viewers/users of the Nature demo (> 14,000 total, according to GA) * Viewers on the notebook viewer (> 200k per month, also according to GA) * Downloads on PyPI (skewed, not unique) * Clones from github (also skewed) We could actually be tracking who has websocket support of those hitting the notebook viewer for a bigger sense of potential users (since viewers are not necessarily IPython/Jupyter users). On Thu, Jan 8, 2015 at 12:55 PM, William Stein wrote: > On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger > wrote: > > So far we have felt that it isn't worth the complexity cost for us to > > support people that deliberately choose to break the internet. It is not > > like WebSockets is some crazy, insecure, unsupported hack over a weird > port. > > It is just different bytes going over the same HTTP/HTTPS socket > connection > > and is essentially a formal standard (I know you know this - this is our > > messaging to companies who complain). > > I know -- that's why I switched SMC to pure websockets for a while. > Then I received complaints at a rate of about 2 very desperate users > per week, and these were the people who cared enough to complain > repeatedly. > > > Our situation is a bit different though than SMC because most of our > current > > users run the notebook on their own computers. This may be something > that we > > eventually want to rethink as more people run this in the cloud. > However, I > > would like to push back on the companies choosing to break the internet > > really hard before giving in. I am guessing that in most cases, > WebSockets > > are broken in enterprise setting not because of some important deliberate > > choice, but rather because people don't understand it and are using > default > > settings that disable them (I could be wrong though).... > > In my experience, for some people that's exactly the problem. For one > person I helped it turned out their specific problem was the Windows > install they had access to had websockets explicitly disabled -- > perhaps that was an IT policy. For other people the problem is > further along the stack (e.g., possibly involving caching). > > Anyway, this change so that "there is a single websocket connection > between the server and client. " makes implementing an alternative to > WebSocket as a fallback dramatically easier, which I greatly > appreciate. > > > Our situation is a bit different though than SMC because most of our > current > > users run the notebook on their own computers. This may be something > that we > > Just curious -- how do you know that most people using IPython aren't > already using it through SMC? > > William > > > > > Cheers, > > > > Brian > > > > > > > > On Thu, Jan 8, 2015 at 10:10 AM, William Stein wrote: > >> > >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: > >> > Alternative notebook frontend authors: > >> > > >> > There is an upcoming change to websocket connections to the notebook > >> > server. > >> > Instead of three websockets per notebook, one for each zmq channel, > >> > there is > >> > a single websocket connection between the server and client. The > channel > >> > associated with each message is identified by a channel key in the > >> > message > >> > dict itself. > >> > > >> > Relevant changes: > >> > > >> > url is /channels instead of /shell, etc. > >> > when sending a message, add a channel key with the channel name > >> > ('shell', > >> > 'stdin') > >> > when receiving a message, check the channel key for routing > >> > > >> > -MinRK > >> > >> Thanks. > >> > >> Of related interest, what the situation involving providing a fallback > >> to websockets? > >> > >> I tried to only support websockets connections with SageMathCloud for > >> a few weeks, and immediately ran into many complaints from users who > >> couldn't connect as a result. This is even with https and so on -- > >> it's just a sad fact that in some corporate or otherwise constrained > >> environments that websockets don't work. By far the best approach I > >> found was to use Primus + Engine.io, which uses websockets if > >> possible, but will fallback to polling. So this is what SMC does > >> now, and everything works, even for people that don't have websockets > >> as an option... except for IPython-in-SMC of course, which doesn't > >> work. > >> > >> Another unrelated issue is that I'm now hardcoding making this change > >> around line 171 of IPython/html/notebookapp.py, since I want to serve > >> the purely static html of IPython from a completely different web > >> server: > >> > >> #static_url_prefix = url_path_join(base_url,'/static/'), > >> static_url_prefix = '/static/ipython/', > >> > >> (Sorry for derailing the thread.) > >> > >> -- William > >> > >> > > >> > > >> > _______________________________________________ > >> > IPython-dev mailing list > >> > IPython-dev at scipy.org > >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > > >> > >> > >> > >> -- > >> William Stein > >> Professor of Mathematics > >> University of Washington > >> http://wstein.org > >> _______________________________________________ > >> IPython-dev mailing list > >> IPython-dev at scipy.org > >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > -- > > Brian E. Granger > > Cal Poly State University, San Luis Obispo > > @ellisonbg on Twitter and GitHub > > bgranger at calpoly.edu and ellisonbg at gmail.com > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Kyle Kelley (@rgbkrk ; http://lambdaops.com) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Thu Jan 8 17:08:54 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 8 Jan 2015 14:08:54 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: > > > Just curious -- how do you know that most people using IPython aren't > already using it through SMC? > Great question! As with all such things, if you are asking for a precise data driven answers, then we don't know. But here is the constellation of evidence that would lead me to this conclusion (that SMC represents a minority fraction of the overall number of ipython users): * We estimate that the total ipython user base is in the 0.5-1.5 million range. However, this is likely a very conservative estimate. Fernando has the best summary of where we get these estimates (I don't remember where the most recent information is - probably in a private email to someone). If SMC has this number of users, then my assertion is clearly to be questioned. * We spend a significant amount of time out meeting with ipython users an conferences, universities, research labs, companies. Over this sample, I know of very few people using SMC (less than 1%). I will be the first to admit that this is both anecdotal and subject my the sampling bias of my particular travel schedule... * Users get and use ipython through a large number of avenues: anaconda, pip, github, SMC, Canopy, apt-get, yum, etc. Our overall usage numbers come from trying to estimate the install base of each of these things and adding them up - we then double check with things like nbviewer usage, etc. Anecdotally, it appears that anaconda is the most common way that people get and use ipython, but the most reliable numbers we have come from apt-get and yum. * Commercial usage of the notebook (in private with private data) is quickly overtaking the more open academic and educational uses of the notebook. The difficulty here is that companies tend to keep their usage private. However, each time we get a glimpse at commercial usage (which is happening more and more) we are blown away by the scale of it. My assumption is that industry usage with private code+data is not the main audience for SMC. I want to emphasize that I don't in any way mean to minimize the impact or importance of SMC. We all think it is fantastic what you are doing and I personally recommend it to people all the time. ps - are you willing to share SMC usage stats with us? It would really help us to reduce the error bars on our usage numbers, which is very helpful in talking to funding agencies... Cheers, Brian -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wstein at gmail.com Thu Jan 8 17:33:50 2015 From: wstein at gmail.com (William Stein) Date: Thu, 8 Jan 2015 14:33:50 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 2:08 PM, Brian Granger wrote: >> >> Just curious -- how do you know that most people using IPython aren't >> already using it through SMC? > > > Great question! > > As with all such things, if you are asking for a precise data driven > answers, then we don't know. > > But here is the constellation of evidence that would lead me to this > conclusion (that SMC represents a minority fraction of the overall number of > ipython users): > > * We estimate that the total ipython user base is in the 0.5-1.5 million > range. However, this is likely a very conservative estimate. Fernando has > the best summary of where we get these estimates (I don't remember where the > most recent information is - probably in a private email to someone). If SMC > has this number of users, then my assertion is clearly to be questioned. > * We spend a significant amount of time out meeting with ipython users an > conferences, universities, research labs, companies. Over this sample, I > know of very few people using SMC (less than 1%). I will be the first to > admit that this is both anecdotal and subject my the sampling bias of my > particular travel schedule... > * Users get and use ipython through a large number of avenues: anaconda, > pip, github, SMC, Canopy, apt-get, yum, etc. Our overall usage numbers come > from trying to estimate the install base of each of these things and adding > them up - we then double check with things like nbviewer usage, etc. > Anecdotally, it appears that anaconda is the most common way that people get > and use ipython, but the most reliable numbers we have come from apt-get and > yum. > * Commercial usage of the notebook (in private with private data) is quickly > overtaking the more open academic and educational uses of the notebook. The > difficulty here is that companies tend to keep their usage private. However, > each time we get a glimpse at commercial usage (which is happening more and > more) we are blown away by the scale of it. My assumption is that industry > usage with private code+data is not the main audience for SMC. > > I want to emphasize that I don't in any way mean to minimize the impact or > importance of SMC. We all think it is fantastic what you are doing and I > personally recommend it to people all the time. > > ps - are you willing to share SMC usage stats with us? It would really help > us to reduce the error bars on our usage numbers, which is very helpful in > talking to funding agencies... Thanks for explaining how you measure usage, which I knew nothing about. Regarding my SMC usage stats, it's all here: http://boxen.math.washington.edu/home/schilly/salvus/stats/stats.html There is in theory more precise data, but it's not been mined yet. Usage of SMC appears to be miniscule compared to any of the numbers you list above. William > > Cheers, Brian > > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > @ellisonbg on Twitter and GitHub > bgranger at calpoly.edu and ellisonbg at gmail.com > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- William Stein Professor of Mathematics University of Washington http://wstein.org From ellisonbg at gmail.com Thu Jan 8 17:42:52 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 8 Jan 2015 14:42:52 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: Thanks for sharing this data! This will be really helpful for us! Cheers, Brian On Thu, Jan 8, 2015 at 2:33 PM, William Stein wrote: > On Thu, Jan 8, 2015 at 2:08 PM, Brian Granger wrote: > >> > >> Just curious -- how do you know that most people using IPython aren't > >> already using it through SMC? > > > > > > Great question! > > > > As with all such things, if you are asking for a precise data driven > > answers, then we don't know. > > > > But here is the constellation of evidence that would lead me to this > > conclusion (that SMC represents a minority fraction of the overall > number of > > ipython users): > > > > * We estimate that the total ipython user base is in the 0.5-1.5 million > > range. However, this is likely a very conservative estimate. Fernando has > > the best summary of where we get these estimates (I don't remember where > the > > most recent information is - probably in a private email to someone). If > SMC > > has this number of users, then my assertion is clearly to be questioned. > > * We spend a significant amount of time out meeting with ipython users an > > conferences, universities, research labs, companies. Over this sample, I > > know of very few people using SMC (less than 1%). I will be the first to > > admit that this is both anecdotal and subject my the sampling bias of my > > particular travel schedule... > > * Users get and use ipython through a large number of avenues: anaconda, > > pip, github, SMC, Canopy, apt-get, yum, etc. Our overall usage numbers > come > > from trying to estimate the install base of each of these things and > adding > > them up - we then double check with things like nbviewer usage, etc. > > Anecdotally, it appears that anaconda is the most common way that people > get > > and use ipython, but the most reliable numbers we have come from apt-get > and > > yum. > > * Commercial usage of the notebook (in private with private data) is > quickly > > overtaking the more open academic and educational uses of the notebook. > The > > difficulty here is that companies tend to keep their usage private. > However, > > each time we get a glimpse at commercial usage (which is happening more > and > > more) we are blown away by the scale of it. My assumption is that > industry > > usage with private code+data is not the main audience for SMC. > > > > I want to emphasize that I don't in any way mean to minimize the impact > or > > importance of SMC. We all think it is fantastic what you are doing and I > > personally recommend it to people all the time. > > > > ps - are you willing to share SMC usage stats with us? It would really > help > > us to reduce the error bars on our usage numbers, which is very helpful > in > > talking to funding agencies... > > Thanks for explaining how you measure usage, which I knew nothing > about. Regarding my SMC usage stats, it's all here: > > http://boxen.math.washington.edu/home/schilly/salvus/stats/stats.html > > There is in theory more precise data, but it's not been mined yet. > > Usage of SMC appears to be miniscule compared to any of the numbers > you list above. > > William > > > > > Cheers, Brian > > > > > > > > > > -- > > Brian E. Granger > > Cal Poly State University, San Luis Obispo > > @ellisonbg on Twitter and GitHub > > bgranger at calpoly.edu and ellisonbg at gmail.com > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Thu Jan 8 18:20:03 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 8 Jan 2015 15:20:03 -0800 Subject: [IPython-dev] [jupyter] Re: Notebook websocket change In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 2:08 PM, Brian Granger wrote: > * We estimate that the total ipython user base is in the 0.5-1.5 million > range. However, this is likely a very conservative estimate. Fernando has > the best summary of where we get these estimates (I don't remember where > the most recent information is - probably in a private email to someone). This is how I most recently answered the question "what is the impact and user base of IPython", indeed in the context of a private email as part of the EU Sage-math grant proposal: Getting metrics for usage is very tough, but we have some information. You can read the report we wrote early this year for Sloan, that provides a bunch of info (notebook and PDF format): http://nbviewer.ipython.org/github/ipython/sloan-2013-reports/blob/master/IPython%202013%20Progress%20Report%20-%20Sloan%20Foundation.ipynb http://archive.ipython.org/sloan-2013-reports/IPython%202013%20Progress%20Report%20-%20Sloan%20Foundation.pdf As you can see, rather than a single blurb of download stats, we paint a more complex (but I think richer) picture of broad usage and impact. A few more things since: - Recently highlighted in the cover of Nature: http://www.nature.com/news/interactive-notebooks-sharing-the-code-1.16261 and that article links to a live, interactive demo here: http://www.nature.com/news/ipython-interactive-demo-7.21492 This demo broke readership records for Nature, to the best of our understanding (we blew past the estimates the editors gave us in terms of highest numbers of simultaneous readers to expect). - The NBviewer site has very significant usage, these are the Google Analytics numbers for the period Nov 8, 2014-Dec 8, 2014: Sessions 423,334 Users 215,546 Pageviews 844,523 That's almost 1 million page views for people sharing content as IPython notebooks (that's the only purpose of that site). - Our Gallery of notebooks is a good showcase of the breadth of usage and impact of the notebook across domains: https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks - This list shows the adoption of our kernel architecture across languages: 23 independent implementations and counting, meaning this system is becoming the lingua franca of interactive computing: https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages - Here is a list of other projects (in academia and industry) using IPython: https://github.com/ipython/ipython/wiki/Projects-using-IPython - It's very hard to get accurate user counts, but we *estimate* at least ~2 Million users. This is a rough estimate, but I think realistic (and if anything, a conservative undercount). The estimate goes as follows: a) Estimates of linux users (not datacenter servers) range from 20M for Ubuntu to ~70M across distros: http://en.wikipedia.org/wiki/Ubuntu_(operating_system)#Installed_base http://en.wikipedia.org/wiki/Linux_adoption#Measuring_desktop_adoption b) The Debian 'popcon' statistics: https://qa.debian.org/popcon.php?package=ipython show IPython to be installed on ~ 5% of Debian installs. If we use that as a baseline, and estimate total linux user counts at say ~50M (rough average of the above two numbers), we get about 2.5M installs of IPython on linux. This doesn't count source installs, pip installs, nor any of the Windows and Mac OSX users who get it via Anaconda, Enthought Canopy, etc. Nor does it count the increasing number of server-side hosted deployments we see more and more of. But at least it gives a credible way to justify that IPython probably has *at least* 2M users. -- 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 ellisonbg at gmail.com Thu Jan 8 18:23:32 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 8 Jan 2015 15:23:32 -0800 Subject: [IPython-dev] [jupyter] Re: Notebook websocket change In-Reply-To: References: Message-ID: Thanks Fernando, that was it exactly! On Thu, Jan 8, 2015 at 3:20 PM, Fernando Perez wrote: > On Thu, Jan 8, 2015 at 2:08 PM, Brian Granger wrote: > >> * We estimate that the total ipython user base is in the 0.5-1.5 million >> range. However, this is likely a very conservative estimate. Fernando has >> the best summary of where we get these estimates (I don't remember where >> the most recent information is - probably in a private email to someone). > > > This is how I most recently answered the question "what is the impact and > user base of IPython", indeed in the context of a private email as part of > the EU Sage-math grant proposal: > > > Getting metrics for usage is very tough, but we have some information. You > can read the report we wrote early this year for Sloan, that provides a > bunch of info (notebook and PDF format): > > > http://nbviewer.ipython.org/github/ipython/sloan-2013-reports/blob/master/IPython%202013%20Progress%20Report%20-%20Sloan%20Foundation.ipynb > > > http://archive.ipython.org/sloan-2013-reports/IPython%202013%20Progress%20Report%20-%20Sloan%20Foundation.pdf > > As you can see, rather than a single blurb of download stats, we paint a > more complex (but I think richer) picture of broad usage and impact. A few > more things since: > > - Recently highlighted in the cover of Nature: > > http://www.nature.com/news/interactive-notebooks-sharing-the-code-1.16261 > > and that article links to a live, interactive demo here: > > http://www.nature.com/news/ipython-interactive-demo-7.21492 > > This demo broke readership records for Nature, to the best of our > understanding (we blew past the estimates the editors gave us in terms of > highest numbers of simultaneous readers to expect). > > - The NBviewer site has very significant usage, these are the Google > Analytics numbers for the period Nov 8, 2014-Dec 8, 2014: > > > Sessions > 423,334 > Users > 215,546 > Pageviews > 844,523 > That's almost 1 million page views for people sharing content as IPython > notebooks (that's the only purpose of that site). > > - Our Gallery of notebooks is a good showcase of the breadth of usage and > impact of the notebook across domains: > > > https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks > > - This list shows the adoption of our kernel architecture across > languages: 23 independent implementations and counting, meaning this system > is becoming the lingua franca of interactive computing: > > https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages > > - Here is a list of other projects (in academia and industry) using > IPython: > > https://github.com/ipython/ipython/wiki/Projects-using-IPython > > - It's very hard to get accurate user counts, but we *estimate* at least > ~2 Million users. This is a rough estimate, but I think realistic (and if > anything, a conservative undercount). The estimate goes as follows: > > a) Estimates of linux users (not datacenter servers) range from 20M for > Ubuntu to ~70M across distros: > > http://en.wikipedia.org/wiki/Ubuntu_(operating_system)#Installed_base > http://en.wikipedia.org/wiki/Linux_adoption#Measuring_desktop_adoption > > b) The Debian 'popcon' statistics: > > https://qa.debian.org/popcon.php?package=ipython > > show IPython to be installed on ~ 5% of Debian installs. > > If we use that as a baseline, and estimate total linux user counts at say > ~50M (rough average of the above two numbers), we get about 2.5M installs > of IPython on linux. This doesn't count source installs, pip installs, nor > any of the Windows and Mac OSX users who get it via Anaconda, Enthought > Canopy, etc. Nor does it count the increasing number of server-side hosted > deployments we see more and more of. > > But at least it gives a credible way to justify that IPython probably has > *at least* 2M users. > > > > > > -- > 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 > > -- > 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/CAHAreOrQ%2BWvU2V2uxKYrho%3DXGYqSS6F1BrGmZth88kKU0s4Uaw%40mail.gmail.com > > . > > For more options, visit https://groups.google.com/d/optout. > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jackson_loper at brown.edu Thu Jan 8 22:28:03 2015 From: jackson_loper at brown.edu (Loper, Jackson) Date: Thu, 8 Jan 2015 22:28:03 -0500 Subject: [IPython-dev] threadsafe widgets Message-ID: It is my understanding that the traitlets in most ipython notebook widgets aren't threadsafe. If you're not sure what I mean, I attached a small example at the bottom of this note. What's the best way for me to make a threadsafe widget? I could inherit from DOMWidget and override a whole bunch of methods with a wrapper that puts things inside a threading.Lock, but it seems kinda like overkill. I suppose theoretically you could lock all the traitlets & comms calls, but that also seems like overkill. Or maybe not...I have no sense of proportion for these things. The application is straightforward, maybe there's an easier way to do it. I'd like to be able to edit files from jupyterhub's host directly inside the notebook; CodeMirror is much more responsive than vim over ssh. It was easy to make a text-editing widget based on codemirror, but I'd like to pop up a CodeMirror.dialog if somebody has changed the file being edited. Can't figure out how to do that in a threadsafe way. Happy Thursday! Jackson Loper Pattern Theory Group Division of Applied Math Brown University ====== threadsome danger ===== Running the latest github clone of jupyterhub, code like this is a very bad idea: import IPython.display from IPython.html import widgets, nbextensions import threading from numpy.random import randint isw=widgets.IntSlider() IPython.display.display(isw) def randoset(N): for i in range(N): isw.value=randint(0,50) t1=threading.Thread(target=randoset,args=[100]) t2=threading.Thread(target=randoset,args=[100]) t1.start() t2.start() The jupyterhub logs errors such as Malformed message: [b'comm-....', b'', b'comm-...', b'', ... more stuff.. ] Presumably two attempts at sending data over comms got mixeduptogether here, which is why we ended up with two in one message! -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Thu Jan 8 23:25:51 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 8 Jan 2015 20:25:51 -0800 Subject: [IPython-dev] threadsafe widgets In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 7:28 PM, Loper, Jackson wrote: > The application is straightforward, maybe there's an easier way to do it. > > I'd like to be able to edit files from jupyterhub's host directly inside > the notebook; > Gotta run, so skipping thinking about threads right now :) But indeed, there's an easier way to do the above: git pull. In master of IPython, you can create/edit full files, just try it out at tmpnb.org and let us know how it goes. 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: From dsdale24 at gmail.com Fri Jan 9 11:38:29 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Fri, 09 Jan 2015 16:38:29 +0000 Subject: [IPython-dev] embedding ipython, namespace question References: Message-ID: On Sat Jan 03 2015 at 10:45:42 AM Darren Dale wrote: > Hi Ray, > > On Sat Dec 27 2014 at 8:48:20 PM Osborn, Raymond wrote: > >> I don?t really understand what you are trying to achieve, but the >> ?user_ns? dictionary isn?t an isolated namespace - it?s the namespace that >> is used by the console, and I would have thought you would have to do some >> kind of injection to add other objects from within the application. >> > > What I am trying to achieve is explicitly documented at > http://ipython.org/ipython-doc/dev/interactive/reference.html#embedding-ipython > : > > --- > It is also possible to embed an IPython shell in a namespace in your > Python code. This allows you to evaluate dynamically the state of your > code, operate with your variables, analyze them, etc. Note however that any > changes you make to values while in the shell do not propagate back to the > running code, so it is safe to modify your values because you won?t break > your code in bizarre ways by doing so. > > Note > At present, embedding IPython cannot be done from inside IPython. Run the > code samples below outside IPython. > [DD: I am not attempting to embed ipython from inside ipython] > > This feature allows you to easily have a fully functional python > environment for doing object introspection anywhere in your code with a > simple function call. In some cases a simple print statement is enough, but > if you need to do more detailed analysis of a code fragment this feature > can be very valuable. > > It can also be useful in scientific computing situations where it is > common to need to do some automatic, computationally intensive part and > then stop to look at data, plots, etc. Opening an IPython instance will > give you full access to your data and functions, and you can resume program > execution once you are done with the interactive part (perhaps to stop > again later, as many times as needed). > The following code snippet is the bare minimum you need to include in your > Python programs for this to work (detailed examples follow later): > > from IPython import embed > embed() # this call anywhere in your program will start IPython > > You can also embed an IPython kernel, for use with qtconsole, etc. via > IPython.embed_kernel(). This should function work the same way, but you can > connect an external frontend (ipython qtconsole or ipython console), rather > than interacting with it in the terminal. > --- > > This is impressively simple for the embed function: > > --- > C:\Users\darren> python > Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) > [MSC v.1500 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > Anaconda is brought to you by Continuum Analytics. > Please check out: http://continuum.io/thanks and https://binstar.org > >>> from IPython import embed > >>> a=1 > >>> embed() > Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) > [MSC v.1500 64 bit (AMD64)] > Type "copyright", "credits" or "license" for more information. > > IPython 2.3.1 -- An enhanced Interactive Python. > Anaconda is brought to you by Continuum Analytics. > Please check out: http://continuum.io/thanks and https://binstar.org > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object', use 'object??' for extra details. > > In [1]: a > Out[1]: 1 > --- > > But I have not been able to achieve the same behavior with the qt > in-process console. > If this is not possible, perhaps the documentation should be changed? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jackson_loper at brown.edu Fri Jan 9 17:59:39 2015 From: jackson_loper at brown.edu (Loper, Jackson) Date: Fri, 9 Jan 2015 17:59:39 -0500 Subject: [IPython-dev] threadsafe widgets In-Reply-To: References: Message-ID: Ah, the threading situation seems to be more diresome than I thought. I believe the following code is unsafe to run. === Problem code === import IPython.display from IPython.html import widgets import threading from numpy.random import randint isw1=widgets.IntSlider() IPython.display.display(isw1) isw2=widgets.IntSlider() IPython.display.display(isw2) def randoset(wid,N): for i in range(N): wid.value=randint(0,50) t1=threading.Thread(target=randoset,args=[isw1,100]) t2=threading.Thread(target=randoset,args=[isw2,100]) t1.start() t2.start() This code produces malformed message errors for me in the jupyterhub terminal output. I believe this is because all widgets seem to share the same iopub_socket and write to it whenever the user changes a traitlet. And of course zmq sockets aren't threadsafe. === A few potential solutions === 1) "Quick" -- Wrap iopub_socket in a threadsafe wrapper. Surround every important function call in a mutex. 2) "Hintjens-approved" -- Give every single widget its own inproc PUB socket. We'd have to spin up an extra thread (or a greenlet in some pre-extant thread? I don't really understand what the different IPython threads do...but I could find out...) with a SUB socket to collect them all together and forward them all out on iopub_socket. 3) "Dirty" -- Wrap IPython.kernel.zmq.session.Session.send inside a mutex. Are there use-cases where anybody besides Session actually does anything with iopub_socket? === Motivation === I think there could be valid use-cases for widgets which display results from polling external resources, e.g. widgets which keep track of EC2 instances, widgets which monitor IPython.parallel workerbees, etc. === Conclusion === I'd be happy to attack this problem, if you guys think it would be useful. If so, let me know what would be a good general direction, and I'll put together a pull request. Keep warm! Jackson Loper Pattern Theory Group Division of Applied Math Brown University PS. I love the new text editor feature in the ipython master branch! My days of vim-over-ssh aren't over yet (NERDTree and push-notification of filechange detection are still too useful to me when logging on from multiple machines) but I can see the end in sight! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Fri Jan 9 18:34:43 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Fri, 9 Jan 2015 15:34:43 -0800 Subject: [IPython-dev] threadsafe widgets In-Reply-To: References: Message-ID: Yuck :( but I am not surprised at this... > > > I believe this is because all widgets seem to share the same iopub_socket > and write to it whenever the user changes a traitlet. And of course zmq > sockets aren't threadsafe. > > Yep, they definitely share a single iopub socket. > === A few potential solutions === > > 1) "Quick" -- Wrap iopub_socket in a threadsafe wrapper. Surround every > important function call in a mutex. > Probably my second choice. > 2) "Hintjens-approved" -- Give every single widget its own inproc PUB > socket. We'd have to spin up an extra thread (or a greenlet in some > pre-extant thread? I don't really understand what the different IPython > threads do...but I could find out...) with a SUB socket to collect them all > together and forward them all out on iopub_socket. > Definitely not going to happen. One of the issues we are running into, especially in multiuser deployments of the notebook is that file descriptors get consumed. If anything we are wanting to *reduce* the number of sockets used by ipython. > 3) "Dirty" -- Wrap IPython.kernel.zmq.session.Session.send inside a > mutex. Are there use-cases where anybody besides Session actually does > anything with iopub_socket? > > There shouldn't be any other way that send gets called, so this is probably my top choice. > === Motivation === > > I think there could be valid use-cases for widgets which display results > from polling external resources, e.g. widgets which keep track of EC2 > instances, widgets which monitor IPython.parallel workerbees, etc. > > I have already started to use widgets with threads, but in my case I didn't quite run into issue you are seeing - almost though. This is definitely going to show up more. > === Conclusion === > > I'd be happy to attack this problem, if you guys think it would be > useful. If so, let me know what would be a good general direction, and > I'll put together a pull request. > @minrk is our expert on the zeromq stuff. Can you open an issue on the ipython/ipython repo and mention @minrk and @ellisonbg and @jdfreder Thanks! Brian > > Keep warm! > > Jackson Loper > Pattern Theory Group > Division of Applied Math > Brown University > > PS. I love the new text editor feature in the ipython master branch! My > days of vim-over-ssh aren't over yet (NERDTree and push-notification of > filechange detection are still too useful to me when logging on from > multiple machines) but I can see the end in sight! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Fri Jan 9 18:57:17 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 9 Jan 2015 15:57:17 -0800 Subject: [IPython-dev] threadsafe widgets In-Reply-To: References: Message-ID: On Fri, Jan 9, 2015 at 3:34 PM, Brian Granger wrote: > @minrk is our expert on the zeromq stuff. Can you open an issue on the > ipython/ipython repo and mention @minrk and @ellisonbg and @jdfreder Add me @fperez as well please, I need to keep an eye on where this goes too... -- 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 benjaminrk at gmail.com Fri Jan 9 19:25:15 2015 From: benjaminrk at gmail.com (MinRK) Date: Fri, 9 Jan 2015 16:25:15 -0800 Subject: [IPython-dev] threadsafe widgets In-Reply-To: References: Message-ID: Since there?s already a single-threaded eventloop running (tornado), the easiest way to ensure that actions in threads are properly serialized is to hand them off via IOLoop.add_callback. This has the advantage over the mutexes-everywhere approach that there isn?t anything to do in the vanilla single-threaded case. Where to put this serialization is a bit of an open question. The simplest place to do it is on Session itself, since it would be always correct, but Session isn?t always used in the context of an IOLoop, so to do it at that level would require the most general, and thus most costly, approach (mutex on every send/recv). We could add a send method on Kernel that does any threading checks outside of Session, assuming that tornado is involved, which is always True when there?s a Kernel, unlike for Session. A mockup of threadsafe send in a tornado context: def threadsafe_send(*args, **kwargs): if not in_main_thread: # can't touch zmq sockets except from main thread # call me again ASAP from the main thread io_loop.add_callback(threadsafe_send, *args, **kwargs) return actually_send() The advantage of this over a mutex is that there?s no lock to grab in the 99% case where it is actually called from the main thread. The issue of mixed-up messages is actually a slightly separate from libzmq sockets themselves not being threadsafe. This is additional thread-unsafety provided by pyzmq?s send/recv_multipart, which was allowed because the underlying C socket is also not threadsafe. Making pyzmq itself threadsafe was considered (implemented, even), but it?s easy enough to do this at the application level that pyzmq doesn?t provided it for performance reasons. -MinRK ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsdale24 at gmail.com Sat Jan 10 09:03:45 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Sat, 10 Jan 2015 14:03:45 +0000 Subject: [IPython-dev] embedding ipython, namespace question References: Message-ID: I found the start of a solution by digging into the IPython library, especially https://github.com/ipython/ipython/blob/master/IPython/kernel/zmq/ipkernel.py#L33 . After creating the in-process kernel, it is possible to reinitialize the console namespace with, for example, `kernel.user_ns = globals()`. Now its just a matter of wiring up the gui so the user_ns gets updated whenever the console widget receives focus. On Fri Jan 09 2015 at 11:38:33 AM Darren Dale wrote: > On Sat Jan 03 2015 at 10:45:42 AM Darren Dale wrote: > >> Hi Ray, >> >> On Sat Dec 27 2014 at 8:48:20 PM Osborn, Raymond wrote: >> >>> I don?t really understand what you are trying to achieve, but the >>> ?user_ns? dictionary isn?t an isolated namespace - it?s the namespace that >>> is used by the console, and I would have thought you would have to do some >>> kind of injection to add other objects from within the application. >>> >> >> What I am trying to achieve is explicitly documented at >> http://ipython.org/ipython-doc/dev/interactive/reference. >> html#embedding-ipython : >> >> --- >> It is also possible to embed an IPython shell in a namespace in your >> Python code. This allows you to evaluate dynamically the state of your >> code, operate with your variables, analyze them, etc. Note however that any >> changes you make to values while in the shell do not propagate back to the >> running code, so it is safe to modify your values because you won?t break >> your code in bizarre ways by doing so. >> >> Note >> At present, embedding IPython cannot be done from inside IPython. Run the >> code samples below outside IPython. >> [DD: I am not attempting to embed ipython from inside ipython] >> >> This feature allows you to easily have a fully functional python >> environment for doing object introspection anywhere in your code with a >> simple function call. In some cases a simple print statement is enough, but >> if you need to do more detailed analysis of a code fragment this feature >> can be very valuable. >> >> It can also be useful in scientific computing situations where it is >> common to need to do some automatic, computationally intensive part and >> then stop to look at data, plots, etc. Opening an IPython instance will >> give you full access to your data and functions, and you can resume program >> execution once you are done with the interactive part (perhaps to stop >> again later, as many times as needed). >> The following code snippet is the bare minimum you need to include in >> your Python programs for this to work (detailed examples follow later): >> >> from IPython import embed >> embed() # this call anywhere in your program will start IPython >> >> You can also embed an IPython kernel, for use with qtconsole, etc. via >> IPython.embed_kernel(). This should function work the same way, but you can >> connect an external frontend (ipython qtconsole or ipython console), rather >> than interacting with it in the terminal. >> --- >> >> This is impressively simple for the embed function: >> >> --- >> C:\Users\darren> python >> Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) >> [MSC v.1500 64 bit (AMD64)] on win32 >> Type "help", "copyright", "credits" or "license" for more information. >> Anaconda is brought to you by Continuum Analytics. >> Please check out: http://continuum.io/thanks and https://binstar.org >> >>> from IPython import embed >> >>> a=1 >> >>> embed() >> Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, 15:12:11) >> [MSC v.1500 64 bit (AMD64)] >> Type "copyright", "credits" or "license" for more information. >> >> IPython 2.3.1 -- An enhanced Interactive Python. >> Anaconda is brought to you by Continuum Analytics. >> Please check out: http://continuum.io/thanks and https://binstar.org >> ? -> Introduction and overview of IPython's features. >> %quickref -> Quick reference. >> help -> Python's own help system. >> object? -> Details about 'object', use 'object??' for extra details. >> >> In [1]: a >> Out[1]: 1 >> --- >> >> But I have not been able to achieve the same behavior with the qt >> in-process console. >> > > If this is not possible, perhaps the documentation should be changed? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsdale24 at gmail.com Sat Jan 10 10:30:30 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Sat, 10 Jan 2015 15:30:30 +0000 Subject: [IPython-dev] embedding ipython, namespace question References: Message-ID: In case anyone else may find it useful, attached is a small modification of the qt in-process example that implements the behavior I was looking for. The namespace gets updated each time the mouse enters the widget, so every time you use the console, the environment appears to be the same as that of the GUI. On Sat Jan 10 2015 at 9:03:48 AM Darren Dale wrote: > I found the start of a solution by digging into the IPython library, > especially https://github.com/ipython/ipython/blob/master/IPython/ > kernel/zmq/ipkernel.py#L33 . After creating the in-process kernel, it is > possible to reinitialize the console namespace with, for example, > `kernel.user_ns = globals()`. Now its just a matter of wiring up the gui so > the user_ns gets updated whenever the console widget receives focus. > On Fri Jan 09 2015 at 11:38:33 AM Darren Dale wrote: > >> On Sat Jan 03 2015 at 10:45:42 AM Darren Dale wrote: >> >>> Hi Ray, >>> >>> On Sat Dec 27 2014 at 8:48:20 PM Osborn, Raymond >>> wrote: >>> >>>> I don?t really understand what you are trying to achieve, but the >>>> ?user_ns? dictionary isn?t an isolated namespace - it?s the namespace that >>>> is used by the console, and I would have thought you would have to do some >>>> kind of injection to add other objects from within the application. >>>> >>> >>> What I am trying to achieve is explicitly documented at >>> http://ipython.org/ipython-doc/dev/interactive/reference.htm >>> l#embedding-ipython : >>> >>> --- >>> It is also possible to embed an IPython shell in a namespace in your >>> Python code. This allows you to evaluate dynamically the state of your >>> code, operate with your variables, analyze them, etc. Note however that any >>> changes you make to values while in the shell do not propagate back to the >>> running code, so it is safe to modify your values because you won?t break >>> your code in bizarre ways by doing so. >>> >>> Note >>> At present, embedding IPython cannot be done from inside IPython. Run >>> the code samples below outside IPython. >>> [DD: I am not attempting to embed ipython from inside ipython] >>> >>> This feature allows you to easily have a fully functional python >>> environment for doing object introspection anywhere in your code with a >>> simple function call. In some cases a simple print statement is enough, but >>> if you need to do more detailed analysis of a code fragment this feature >>> can be very valuable. >>> >>> It can also be useful in scientific computing situations where it is >>> common to need to do some automatic, computationally intensive part and >>> then stop to look at data, plots, etc. Opening an IPython instance will >>> give you full access to your data and functions, and you can resume program >>> execution once you are done with the interactive part (perhaps to stop >>> again later, as many times as needed). >>> The following code snippet is the bare minimum you need to include in >>> your Python programs for this to work (detailed examples follow later): >>> >>> from IPython import embed >>> embed() # this call anywhere in your program will start IPython >>> >>> You can also embed an IPython kernel, for use with qtconsole, etc. via >>> IPython.embed_kernel(). This should function work the same way, but you can >>> connect an external frontend (ipython qtconsole or ipython console), rather >>> than interacting with it in the terminal. >>> --- >>> >>> This is impressively simple for the embed function: >>> >>> --- >>> C:\Users\darren> python >>> Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, >>> 15:12:11) [MSC v.1500 64 bit (AMD64)] on win32 >>> Type "help", "copyright", "credits" or "license" for more information. >>> Anaconda is brought to you by Continuum Analytics. >>> Please check out: http://continuum.io/thanks and https://binstar.org >>> >>> from IPython import embed >>> >>> a=1 >>> >>> embed() >>> Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul 2 2014, >>> 15:12:11) [MSC v.1500 64 bit (AMD64)] >>> Type "copyright", "credits" or "license" for more information. >>> >>> IPython 2.3.1 -- An enhanced Interactive Python. >>> Anaconda is brought to you by Continuum Analytics. >>> Please check out: http://continuum.io/thanks and https://binstar.org >>> ? -> Introduction and overview of IPython's features. >>> %quickref -> Quick reference. >>> help -> Python's own help system. >>> object? -> Details about 'object', use 'object??' for extra details. >>> >>> In [1]: a >>> Out[1]: 1 >>> --- >>> >>> But I have not been able to achieve the same behavior with the qt >>> in-process console. >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inprocess_qtconsole.py Type: application/octet-stream Size: 1457 bytes Desc: not available URL: From dsdale24 at gmail.com Sun Jan 11 10:37:22 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Sun, 11 Jan 2015 15:37:22 +0000 Subject: [IPython-dev] Incompatible subclass instances of InteractiveShellEmbed Message-ID: Hello, I'm working on an application with an in-process qt console, following the example at https://github.com/ipython/ipython/blob/master/examples/Embedding/inprocess_qtconsole.py . I would also like to be able to use the `embed` function occassionally for troubleshooting other parts of the application that are unrelated to the in-process qt console. However, calling embed yields an error: "IPython.config.configurable.MultipleInstanceError: Multiple incompatible subclass instances of InteractiveShellEmbed are being created." I can reproduce this with the inprocess example by adding a call to `embed()` just before the call to `guisupport.start_event_loop_qt4(app)`. Any ideas how to make this work? Thanks, Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From rosborn at anl.gov Sun Jan 11 17:49:08 2015 From: rosborn at anl.gov (Osborn, Raymond) Date: Sun, 11 Jan 2015 22:49:08 +0000 Subject: [IPython-dev] Incompatible subclass instances of InteractiveShellEmbed In-Reply-To: References: Message-ID: <7191368A-9B31-4D73-BB7B-D10ACE44F31D@anl.gov> Until someone more knowledgeable replies, this is presumably because InteractiveShellEmbed ultimately inherits from SingletonConfigurable, which only allows one instance to be created. There is some code in embed.py, which saves an existing instance, clears it, and allows another to be created: saved_shell_instance = InteractiveShell._instance if saved_shell_instance is not None: cls = type(saved_shell_instance) cls.clear_instance() shell = InteractiveShellEmbed.instance(**kwargs) If something like that is not in your current code, perhaps you need to add it. Ray On Jan 11, 2015, at 9:37 AM, Darren Dale > wrote: Hello, I'm working on an application with an in-process qt console, following the example at https://github.com/ipython/ipython/blob/master/examples/Embedding/inprocess_qtconsole.py . I would also like to be able to use the `embed` function occassionally for troubleshooting other parts of the application that are unrelated to the in-process qt console. However, calling embed yields an error: "IPython.config.configurable.MultipleInstanceError: Multiple incompatible subclass instances of InteractiveShellEmbed are being created." I can reproduce this with the inprocess example by adding a call to `embed()` just before the call to `guisupport.start_event_loop_qt4(app)`. Any ideas how to make this work? Thanks, Darren _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org http://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 fperez.net at gmail.com Sun Jan 11 22:47:22 2015 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 11 Jan 2015 19:47:22 -0800 Subject: [IPython-dev] IPython 3.0, the homestretch. We need your help! Message-ID: Hi all, we're behind schedule, but there is light at the end of the 3.0 tunnel. Now is the time where we need the help from our community. This is the list of currently open issues tagged for 3.0: https://github.com/ipython/ipython/issues?q=is%3Aopen+is%3Aissue+milestone%3A3.0 If you see anything there for which you can contribute in any way a fix, patch, or even constructive feedback, we'd be very grateful. Eventually some of those will inevitably have to be retargetted for 3.1/4.0, since we won't be able to get to all of them. But there's a reason we'd labeled them 3.0, so it would be great to actually close as many of them as possible (or at least make partial progress on them, enough to address the key problem and perhaps leave an easier but potentially longer tail for 3.1/4). So please jump in! 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: From dsdale24 at gmail.com Mon Jan 12 12:28:34 2015 From: dsdale24 at gmail.com (Darren Dale) Date: Mon, 12 Jan 2015 17:28:34 +0000 Subject: [IPython-dev] Incompatible subclass instances of InteractiveShellEmbed References: <7191368A-9B31-4D73-BB7B-D10ACE44F31D@anl.gov> Message-ID: The following seems to work for me: in my main hexrd/__init__.py, I do `from IPython import embed as debug`. Then, in my gui module, I monkeypatch hexrd.debug so it uses the inprocess qtconsole: class Debug(object): def __init__(self, shell): self.shell = shell def __call__(self): import inspect frame = inspect.currentframe() try: # prepare the debug namespace temp = frame.f_back.f_globals temp.update(frame.f_back.f_locals) finally: del frame # clear and repopulate the qtconsole namespace self.shell.run_line_magic('reset', '-f -s') self.shell.push(temp) hexrd.debug = Debug(kernel_manager.kernel.shell) Darren On Sun Jan 11 2015 at 5:49:16 PM Osborn, Raymond wrote: > Until someone more knowledgeable replies, this is presumably because > InteractiveShellEmbed ultimately inherits from SingletonConfigurable, which > only allows one instance to be created. There is some code in embed.py, > which saves an existing instance, clears it, and allows another to be > created: > > saved_shell_instance = InteractiveShell._instance > if saved_shell_instance is not None: > cls = type(saved_shell_instance) > cls.clear_instance() > shell = InteractiveShellEmbed.instance(**kwargs) > > If something like that is not in your current code, perhaps you need to > add it. > > Ray > > On Jan 11, 2015, at 9:37 AM, Darren Dale wrote: > > Hello, > > I'm working on an application with an in-process qt console, following > the example at > https://github.com/ipython/ipython/blob/master/examples/Embedding/inprocess_qtconsole.py > . I would also like to be able to use the `embed` function occassionally > for troubleshooting other parts of the application that are unrelated to > the in-process qt console. However, calling embed yields an error: > "IPython.config.configurable.MultipleInstanceError: Multiple incompatible > subclass instances of InteractiveShellEmbed are being created." I can > reproduce this with the inprocess example by adding a call to `embed()` > just before the call to `guisupport.start_event_loop_qt4(app)`. Any ideas > how to make this work? > > Thanks, > Darren > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://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 > > > _______________________________________________ > 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: From wstein at gmail.com Wed Jan 14 19:12:50 2015 From: wstein at gmail.com (William Stein) Date: Wed, 14 Jan 2015 16:12:50 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: On Thu, Jan 8, 2015 at 11:18 AM, MinRK wrote: > Some time ago, I made a PR to IPython switching to socket.io, which required > the same basic changes since it only allowed a single connection per page, > so I know it's not too hard. We may start to see more pressure as hosted > instances, and reconsider the fallback in the future, but at this point, we > don't feel that pressure. Wind proper websockets to be sufficiently > preferable that we will wait as long as we can before appeasing old, broken, > or misconfigured network environments that prevent websockets from working. > > The majority of notebook users seem to be running as a desktop app via > localhost, where websockets are rarely a problem (The nightmare of Sophos > AV/firewall on Windows excluded). Do you have a pointer to the above pull request? In my experience battling with websockets and the cloud over the last few years, it's not just an issue of websockets versus fallbacks -- there's also issues with the robustness of the websocket connection, how it's maintained, automatically reconnecting if the connection has problems, heartbeats, etc. If you only use IPython locally then none of this is a problem. However, if you use IPython over a complicated network that drops packets sometimes, flakes out, etc., it can be. I get fairly regular emails from people having trouble specifically with the robustness of the iPython connection inside of SMC. Libraries like socket.io and engine.io [1] seem to have pretty good debuged and thought out code for dealing with these situations (and for fallbacks in case websockets doesn't work). Since this use case is only a tiny part of the total IPython notebook usage, it makes sense for me to take this on myself. I will definitely highly prioritize trying to hack on IPython in order to get it to use engine.io+primus, since I have to deal with this websocket robustness situation to improve my user's experience. For example, I'm getting fairly regular complaints from Randy Leveque and his colleagues at UW. So I'd greatly appreciate a link to that pull request, and of course I'll share anything I do here. [1] https://github.com/Automattic/engine.io > > -MinRK > > On Thu, Jan 8, 2015 at 10:55 AM, William Stein wrote: >> >> On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger >> wrote: >> > So far we have felt that it isn't worth the complexity cost for us to >> > support people that deliberately choose to break the internet. It is not >> > like WebSockets is some crazy, insecure, unsupported hack over a weird >> > port. >> > It is just different bytes going over the same HTTP/HTTPS socket >> > connection >> > and is essentially a formal standard (I know you know this - this is our >> > messaging to companies who complain). >> >> I know -- that's why I switched SMC to pure websockets for a while. >> Then I received complaints at a rate of about 2 very desperate users >> per week, and these were the people who cared enough to complain >> repeatedly. >> >> > Our situation is a bit different though than SMC because most of our >> > current >> > users run the notebook on their own computers. This may be something >> > that we >> > eventually want to rethink as more people run this in the cloud. >> > However, I >> > would like to push back on the companies choosing to break the internet >> > really hard before giving in. I am guessing that in most cases, >> > WebSockets >> > are broken in enterprise setting not because of some important >> > deliberate >> > choice, but rather because people don't understand it and are using >> > default >> > settings that disable them (I could be wrong though).... >> >> In my experience, for some people that's exactly the problem. For one >> person I helped it turned out their specific problem was the Windows >> install they had access to had websockets explicitly disabled -- >> perhaps that was an IT policy. For other people the problem is >> further along the stack (e.g., possibly involving caching). >> >> Anyway, this change so that "there is a single websocket connection >> between the server and client. " makes implementing an alternative to >> WebSocket as a fallback dramatically easier, which I greatly >> appreciate. >> >> > Our situation is a bit different though than SMC because most of our >> > current >> > users run the notebook on their own computers. This may be something >> > that we >> >> Just curious -- how do you know that most people using IPython aren't >> already using it through SMC? >> >> William >> >> > >> > Cheers, >> > >> > Brian >> > >> > >> > >> > On Thu, Jan 8, 2015 at 10:10 AM, William Stein wrote: >> >> >> >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: >> >> > Alternative notebook frontend authors: >> >> > >> >> > There is an upcoming change to websocket connections to the notebook >> >> > server. >> >> > Instead of three websockets per notebook, one for each zmq channel, >> >> > there is >> >> > a single websocket connection between the server and client. The >> >> > channel >> >> > associated with each message is identified by a channel key in the >> >> > message >> >> > dict itself. >> >> > >> >> > Relevant changes: >> >> > >> >> > url is /channels instead of /shell, etc. >> >> > when sending a message, add a channel key with the channel name >> >> > ('shell', >> >> > 'stdin') >> >> > when receiving a message, check the channel key for routing >> >> > >> >> > -MinRK >> >> >> >> Thanks. >> >> >> >> Of related interest, what the situation involving providing a fallback >> >> to websockets? >> >> >> >> I tried to only support websockets connections with SageMathCloud for >> >> a few weeks, and immediately ran into many complaints from users who >> >> couldn't connect as a result. This is even with https and so on -- >> >> it's just a sad fact that in some corporate or otherwise constrained >> >> environments that websockets don't work. By far the best approach I >> >> found was to use Primus + Engine.io, which uses websockets if >> >> possible, but will fallback to polling. So this is what SMC does >> >> now, and everything works, even for people that don't have websockets >> >> as an option... except for IPython-in-SMC of course, which doesn't >> >> work. >> >> >> >> Another unrelated issue is that I'm now hardcoding making this change >> >> around line 171 of IPython/html/notebookapp.py, since I want to serve >> >> the purely static html of IPython from a completely different web >> >> server: >> >> >> >> #static_url_prefix = url_path_join(base_url,'/static/'), >> >> static_url_prefix = '/static/ipython/', >> >> >> >> (Sorry for derailing the thread.) >> >> >> >> -- William >> >> >> >> > >> >> > >> >> > _______________________________________________ >> >> > IPython-dev mailing list >> >> > IPython-dev at scipy.org >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > >> >> >> >> >> >> >> >> -- >> >> William Stein >> >> Professor of Mathematics >> >> University of Washington >> >> http://wstein.org >> >> _______________________________________________ >> >> IPython-dev mailing list >> >> IPython-dev at scipy.org >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> > >> > >> > >> > -- >> > Brian E. Granger >> > Cal Poly State University, San Luis Obispo >> > @ellisonbg on Twitter and GitHub >> > bgranger at calpoly.edu and ellisonbg at gmail.com >> > >> > _______________________________________________ >> > IPython-dev mailing list >> > IPython-dev at scipy.org >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> >> >> >> -- >> William Stein >> Professor of Mathematics >> University of Washington >> http://wstein.org >> _______________________________________________ >> 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 > -- William Stein Professor of Mathematics University of Washington http://wstein.org From benjaminrk at gmail.com Wed Jan 14 19:50:46 2015 From: benjaminrk at gmail.com (MinRK) Date: Wed, 14 Jan 2015 16:50:46 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: The PR is 2321 , switching IPython to use SockJS instead of WebSockets. I?m not sure how informative it is, since things have moved around *a lot* since then, and it is from a time when we were shipping more things in external, rather than accepting them as dependencies. I think a similar patch today would be a great deal simpler, especially now that it doesn?t need to include merging sockets. I also had to include a hack to workaround the fact that SockJS didn?t allow empty messages, and we were sending empty messages as part of the initial handshake (also not true anymore). -MinRK ? On Wed, Jan 14, 2015 at 4:12 PM, William Stein wrote: > On Thu, Jan 8, 2015 at 11:18 AM, MinRK wrote: > > Some time ago, I made a PR to IPython switching to socket.io, which > required > > the same basic changes since it only allowed a single connection per > page, > > so I know it's not too hard. We may start to see more pressure as hosted > > instances, and reconsider the fallback in the future, but at this point, > we > > don't feel that pressure. Wind proper websockets to be sufficiently > > preferable that we will wait as long as we can before appeasing old, > broken, > > or misconfigured network environments that prevent websockets from > working. > > > > The majority of notebook users seem to be running as a desktop app via > > localhost, where websockets are rarely a problem (The nightmare of Sophos > > AV/firewall on Windows excluded). > > Do you have a pointer to the above pull request? > > In my experience battling with websockets and the cloud over the last > few years, it's not just an issue of websockets versus fallbacks -- > there's also issues with the robustness of the websocket connection, > how it's maintained, automatically reconnecting if the connection has > problems, heartbeats, etc. If you only use IPython locally then none > of this is a problem. However, if you use IPython over a complicated > network that drops packets sometimes, flakes out, etc., it can be. I > get fairly regular emails from people having trouble specifically with > the robustness of the iPython connection inside of SMC. Libraries > like socket.io and engine.io [1] seem to have pretty good debuged and > thought out code for dealing with these situations (and for fallbacks > in case websockets doesn't work). > > Since this use case is only a tiny part of the total IPython notebook > usage, it makes sense for me to take this on myself. I will > definitely highly prioritize trying to hack on IPython in order to get > it to use engine.io+primus, since I have to deal with this websocket > robustness situation to improve my user's experience. For example, > I'm getting fairly regular complaints from Randy Leveque and his > colleagues at UW. So I'd greatly appreciate a link to that pull > request, and of course I'll share anything I do here. > > [1] https://github.com/Automattic/engine.io > > > > > -MinRK > > > > On Thu, Jan 8, 2015 at 10:55 AM, William Stein wrote: > >> > >> On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger > >> wrote: > >> > So far we have felt that it isn't worth the complexity cost for us to > >> > support people that deliberately choose to break the internet. It is > not > >> > like WebSockets is some crazy, insecure, unsupported hack over a weird > >> > port. > >> > It is just different bytes going over the same HTTP/HTTPS socket > >> > connection > >> > and is essentially a formal standard (I know you know this - this is > our > >> > messaging to companies who complain). > >> > >> I know -- that's why I switched SMC to pure websockets for a while. > >> Then I received complaints at a rate of about 2 very desperate users > >> per week, and these were the people who cared enough to complain > >> repeatedly. > >> > >> > Our situation is a bit different though than SMC because most of our > >> > current > >> > users run the notebook on their own computers. This may be something > >> > that we > >> > eventually want to rethink as more people run this in the cloud. > >> > However, I > >> > would like to push back on the companies choosing to break the > internet > >> > really hard before giving in. I am guessing that in most cases, > >> > WebSockets > >> > are broken in enterprise setting not because of some important > >> > deliberate > >> > choice, but rather because people don't understand it and are using > >> > default > >> > settings that disable them (I could be wrong though).... > >> > >> In my experience, for some people that's exactly the problem. For one > >> person I helped it turned out their specific problem was the Windows > >> install they had access to had websockets explicitly disabled -- > >> perhaps that was an IT policy. For other people the problem is > >> further along the stack (e.g., possibly involving caching). > >> > >> Anyway, this change so that "there is a single websocket connection > >> between the server and client. " makes implementing an alternative to > >> WebSocket as a fallback dramatically easier, which I greatly > >> appreciate. > >> > >> > Our situation is a bit different though than SMC because most of our > >> > current > >> > users run the notebook on their own computers. This may be something > >> > that we > >> > >> Just curious -- how do you know that most people using IPython aren't > >> already using it through SMC? > >> > >> William > >> > >> > > >> > Cheers, > >> > > >> > Brian > >> > > >> > > >> > > >> > On Thu, Jan 8, 2015 at 10:10 AM, William Stein > wrote: > >> >> > >> >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: > >> >> > Alternative notebook frontend authors: > >> >> > > >> >> > There is an upcoming change to websocket connections to the > notebook > >> >> > server. > >> >> > Instead of three websockets per notebook, one for each zmq channel, > >> >> > there is > >> >> > a single websocket connection between the server and client. The > >> >> > channel > >> >> > associated with each message is identified by a channel key in the > >> >> > message > >> >> > dict itself. > >> >> > > >> >> > Relevant changes: > >> >> > > >> >> > url is /channels instead of /shell, etc. > >> >> > when sending a message, add a channel key with the channel name > >> >> > ('shell', > >> >> > 'stdin') > >> >> > when receiving a message, check the channel key for routing > >> >> > > >> >> > -MinRK > >> >> > >> >> Thanks. > >> >> > >> >> Of related interest, what the situation involving providing a > fallback > >> >> to websockets? > >> >> > >> >> I tried to only support websockets connections with SageMathCloud for > >> >> a few weeks, and immediately ran into many complaints from users who > >> >> couldn't connect as a result. This is even with https and so on -- > >> >> it's just a sad fact that in some corporate or otherwise constrained > >> >> environments that websockets don't work. By far the best approach I > >> >> found was to use Primus + Engine.io, which uses websockets if > >> >> possible, but will fallback to polling. So this is what SMC does > >> >> now, and everything works, even for people that don't have websockets > >> >> as an option... except for IPython-in-SMC of course, which doesn't > >> >> work. > >> >> > >> >> Another unrelated issue is that I'm now hardcoding making this change > >> >> around line 171 of IPython/html/notebookapp.py, since I want to serve > >> >> the purely static html of IPython from a completely different web > >> >> server: > >> >> > >> >> #static_url_prefix = url_path_join(base_url,'/static/'), > >> >> static_url_prefix = '/static/ipython/', > >> >> > >> >> (Sorry for derailing the thread.) > >> >> > >> >> -- William > >> >> > >> >> > > >> >> > > >> >> > _______________________________________________ > >> >> > IPython-dev mailing list > >> >> > IPython-dev at scipy.org > >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> >> > > >> >> > >> >> > >> >> > >> >> -- > >> >> William Stein > >> >> Professor of Mathematics > >> >> University of Washington > >> >> http://wstein.org > >> >> _______________________________________________ > >> >> IPython-dev mailing list > >> >> IPython-dev at scipy.org > >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > > >> > > >> > > >> > > >> > -- > >> > Brian E. Granger > >> > Cal Poly State University, San Luis Obispo > >> > @ellisonbg on Twitter and GitHub > >> > bgranger at calpoly.edu and ellisonbg at gmail.com > >> > > >> > _______________________________________________ > >> > IPython-dev mailing list > >> > IPython-dev at scipy.org > >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > > >> > >> > >> > >> -- > >> William Stein > >> Professor of Mathematics > >> University of Washington > >> http://wstein.org > >> _______________________________________________ > >> 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 > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.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: From wstein at gmail.com Wed Jan 14 19:55:21 2015 From: wstein at gmail.com (William Stein) Date: Wed, 14 Jan 2015 16:55:21 -0800 Subject: [IPython-dev] Notebook websocket change In-Reply-To: References: Message-ID: On Wed, Jan 14, 2015 at 4:50 PM, MinRK wrote: > The PR is 2321, switching IPython to use SockJS instead of WebSockets. I'm > not sure how informative it is, since things have moved around a lot since > then, and it is from a time when we were shipping more things in external, > rather than accepting them as dependencies. I think a similar patch today > would be a great deal simpler, especially now that it doesn't need to > include merging sockets. I also had to include a hack to workaround the fact > that SockJS didn't allow empty messages, and we were sending empty messages > as part of the initial handshake (also not true anymore). > > -MinRK Thanks! I'll carefully think through a range of options. Another might be to just plug into your code to send/receive messages, and just send/receive them over my existing websocket connection, so there is just a single websocket connection, shared across ipython and smc. -- William > > > On Wed, Jan 14, 2015 at 4:12 PM, William Stein wrote: >> >> On Thu, Jan 8, 2015 at 11:18 AM, MinRK wrote: >> > Some time ago, I made a PR to IPython switching to socket.io, which >> > required >> > the same basic changes since it only allowed a single connection per >> > page, >> > so I know it's not too hard. We may start to see more pressure as hosted >> > instances, and reconsider the fallback in the future, but at this point, >> > we >> > don't feel that pressure. Wind proper websockets to be sufficiently >> > preferable that we will wait as long as we can before appeasing old, >> > broken, >> > or misconfigured network environments that prevent websockets from >> > working. >> > >> > The majority of notebook users seem to be running as a desktop app via >> > localhost, where websockets are rarely a problem (The nightmare of >> > Sophos >> > AV/firewall on Windows excluded). >> >> Do you have a pointer to the above pull request? >> >> In my experience battling with websockets and the cloud over the last >> few years, it's not just an issue of websockets versus fallbacks -- >> there's also issues with the robustness of the websocket connection, >> how it's maintained, automatically reconnecting if the connection has >> problems, heartbeats, etc. If you only use IPython locally then none >> of this is a problem. However, if you use IPython over a complicated >> network that drops packets sometimes, flakes out, etc., it can be. I >> get fairly regular emails from people having trouble specifically with >> the robustness of the iPython connection inside of SMC. Libraries >> like socket.io and engine.io [1] seem to have pretty good debuged and >> thought out code for dealing with these situations (and for fallbacks >> in case websockets doesn't work). >> >> Since this use case is only a tiny part of the total IPython notebook >> usage, it makes sense for me to take this on myself. I will >> definitely highly prioritize trying to hack on IPython in order to get >> it to use engine.io+primus, since I have to deal with this websocket >> robustness situation to improve my user's experience. For example, >> I'm getting fairly regular complaints from Randy Leveque and his >> colleagues at UW. So I'd greatly appreciate a link to that pull >> request, and of course I'll share anything I do here. >> >> [1] https://github.com/Automattic/engine.io >> >> > >> > -MinRK >> > >> > On Thu, Jan 8, 2015 at 10:55 AM, William Stein wrote: >> >> >> >> On Thu, Jan 8, 2015 at 10:19 AM, Brian Granger >> >> wrote: >> >> > So far we have felt that it isn't worth the complexity cost for us to >> >> > support people that deliberately choose to break the internet. It is >> >> > not >> >> > like WebSockets is some crazy, insecure, unsupported hack over a >> >> > weird >> >> > port. >> >> > It is just different bytes going over the same HTTP/HTTPS socket >> >> > connection >> >> > and is essentially a formal standard (I know you know this - this is >> >> > our >> >> > messaging to companies who complain). >> >> >> >> I know -- that's why I switched SMC to pure websockets for a while. >> >> Then I received complaints at a rate of about 2 very desperate users >> >> per week, and these were the people who cared enough to complain >> >> repeatedly. >> >> >> >> > Our situation is a bit different though than SMC because most of our >> >> > current >> >> > users run the notebook on their own computers. This may be something >> >> > that we >> >> > eventually want to rethink as more people run this in the cloud. >> >> > However, I >> >> > would like to push back on the companies choosing to break the >> >> > internet >> >> > really hard before giving in. I am guessing that in most cases, >> >> > WebSockets >> >> > are broken in enterprise setting not because of some important >> >> > deliberate >> >> > choice, but rather because people don't understand it and are using >> >> > default >> >> > settings that disable them (I could be wrong though).... >> >> >> >> In my experience, for some people that's exactly the problem. For one >> >> person I helped it turned out their specific problem was the Windows >> >> install they had access to had websockets explicitly disabled -- >> >> perhaps that was an IT policy. For other people the problem is >> >> further along the stack (e.g., possibly involving caching). >> >> >> >> Anyway, this change so that "there is a single websocket connection >> >> between the server and client. " makes implementing an alternative to >> >> WebSocket as a fallback dramatically easier, which I greatly >> >> appreciate. >> >> >> >> > Our situation is a bit different though than SMC because most of our >> >> > current >> >> > users run the notebook on their own computers. This may be something >> >> > that we >> >> >> >> Just curious -- how do you know that most people using IPython aren't >> >> already using it through SMC? >> >> >> >> William >> >> >> >> > >> >> > Cheers, >> >> > >> >> > Brian >> >> > >> >> > >> >> > >> >> > On Thu, Jan 8, 2015 at 10:10 AM, William Stein >> >> > wrote: >> >> >> >> >> >> On Thu, Jan 8, 2015 at 10:04 AM, MinRK wrote: >> >> >> > Alternative notebook frontend authors: >> >> >> > >> >> >> > There is an upcoming change to websocket connections to the >> >> >> > notebook >> >> >> > server. >> >> >> > Instead of three websockets per notebook, one for each zmq >> >> >> > channel, >> >> >> > there is >> >> >> > a single websocket connection between the server and client. The >> >> >> > channel >> >> >> > associated with each message is identified by a channel key in the >> >> >> > message >> >> >> > dict itself. >> >> >> > >> >> >> > Relevant changes: >> >> >> > >> >> >> > url is /channels instead of /shell, etc. >> >> >> > when sending a message, add a channel key with the channel name >> >> >> > ('shell', >> >> >> > 'stdin') >> >> >> > when receiving a message, check the channel key for routing >> >> >> > >> >> >> > -MinRK >> >> >> >> >> >> Thanks. >> >> >> >> >> >> Of related interest, what the situation involving providing a >> >> >> fallback >> >> >> to websockets? >> >> >> >> >> >> I tried to only support websockets connections with SageMathCloud >> >> >> for >> >> >> a few weeks, and immediately ran into many complaints from users who >> >> >> couldn't connect as a result. This is even with https and so on -- >> >> >> it's just a sad fact that in some corporate or otherwise constrained >> >> >> environments that websockets don't work. By far the best approach >> >> >> I >> >> >> found was to use Primus + Engine.io, which uses websockets if >> >> >> possible, but will fallback to polling. So this is what SMC does >> >> >> now, and everything works, even for people that don't have >> >> >> websockets >> >> >> as an option... except for IPython-in-SMC of course, which doesn't >> >> >> work. >> >> >> >> >> >> Another unrelated issue is that I'm now hardcoding making this >> >> >> change >> >> >> around line 171 of IPython/html/notebookapp.py, since I want to >> >> >> serve >> >> >> the purely static html of IPython from a completely different web >> >> >> server: >> >> >> >> >> >> #static_url_prefix = url_path_join(base_url,'/static/'), >> >> >> static_url_prefix = '/static/ipython/', >> >> >> >> >> >> (Sorry for derailing the thread.) >> >> >> >> >> >> -- William >> >> >> >> >> >> > >> >> >> > >> >> >> > _______________________________________________ >> >> >> > IPython-dev mailing list >> >> >> > IPython-dev at scipy.org >> >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> William Stein >> >> >> Professor of Mathematics >> >> >> University of Washington >> >> >> http://wstein.org >> >> >> _______________________________________________ >> >> >> IPython-dev mailing list >> >> >> IPython-dev at scipy.org >> >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > >> >> > >> >> > >> >> > >> >> > -- >> >> > Brian E. Granger >> >> > Cal Poly State University, San Luis Obispo >> >> > @ellisonbg on Twitter and GitHub >> >> > bgranger at calpoly.edu and ellisonbg at gmail.com >> >> > >> >> > _______________________________________________ >> >> > IPython-dev mailing list >> >> > IPython-dev at scipy.org >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > >> >> >> >> >> >> >> >> -- >> >> William Stein >> >> Professor of Mathematics >> >> University of Washington >> >> http://wstein.org >> >> _______________________________________________ >> >> 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 >> > >> >> >> >> -- >> William Stein >> Professor of Mathematics >> University of Washington >> http://wstein.org >> _______________________________________________ >> 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 > -- William Stein Professor of Mathematics University of Washington http://wstein.org From liam.gretton at leicester.ac.uk Thu Jan 15 04:28:03 2015 From: liam.gretton at leicester.ac.uk (Liam Gretton) Date: Thu, 15 Jan 2015 09:28:03 +0000 Subject: [IPython-dev] %load hangs in qtconsole Message-ID: <54B78823.1050506@leicester.ac.uk> I've just built Python 2.7.9, iPython 2.3.1, PyQT 4.11.3 (against Qt 4.8.6) with matplotlib 1.4.2 etc on a Scientific Linux 6.4 system (64 bit). What I'm finding is that any attempt to %load a Python script from within the qtconsole hangs after displaying the final line of the script. The script neither executes nor returns the command prompt. >From within the command line ipython console there's no such problem. Manually typing or pasting in contents to the qtconsole works and the script executes as expected, it just hangs if %load is used. Any ideas what might be causing this? -- Liam Gretton liam.gretton at le.ac.uk Systems Specialist http://www.le.ac.uk/its/ IT Services Tel: +44 (0)116 2522254 University Of Leicester, University Road Leicestershire LE1 7RH, United Kingdom From benjaminrk at gmail.com Thu Jan 15 13:13:45 2015 From: benjaminrk at gmail.com (MinRK) Date: Thu, 15 Jan 2015 10:13:45 -0800 Subject: [IPython-dev] %load hangs in qtconsole In-Reply-To: <54B78823.1050506@leicester.ac.uk> References: <54B78823.1050506@leicester.ac.uk> Message-ID: It looks like it's putting the cursor in the wrong place, confusing the UI. If you place the cursor in the input area, it should allow you to execute the input. -MinRK On Thu, Jan 15, 2015 at 1:28 AM, Liam Gretton wrote: > I've just built Python 2.7.9, iPython 2.3.1, PyQT 4.11.3 (against Qt > 4.8.6) with matplotlib 1.4.2 etc on a Scientific Linux 6.4 system (64 bit). > > What I'm finding is that any attempt to %load a Python script from > within the qtconsole hangs after displaying the final line of the > script. The script neither executes nor returns the command prompt. > > >From within the command line ipython console there's no such problem. > Manually typing or pasting in contents to the qtconsole works and the > script executes as expected, it just hangs if %load is used. > > Any ideas what might be causing this? > > -- > Liam Gretton liam.gretton at le.ac.uk > Systems Specialist http://www.le.ac.uk/its/ > IT Services Tel: +44 (0)116 2522254 > University Of Leicester, University Road > Leicestershire LE1 7RH, United Kingdom > _______________________________________________ > 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: From soumith at fb.com Thu Jan 15 22:26:58 2015 From: soumith at fb.com (Soumith Chintala) Date: Fri, 16 Jan 2015 03:26:58 +0000 Subject: [IPython-dev] iTorch - Weird issues with mkfifo on linux Message-ID: Hey everyone, As some of you might be aware, we released an ipython kernel for Lua (works only with LuaJIT because we use FFI for non-blocking reads). We also integrated visualization of images/video/audio and plotting using Bokeh. https://github.com/facebook/iTorch We use a two-process kernel, one of them handles stdout from the other process and sends it over to ipython. To pipe the processes, we use mkfifo, which is a posix utility. http://pubs.opengroup.org/onlinepubs/009695399/functions/mkfifo.html One problem we oncovered is that on certain (or possibly all linux distros) ipython thinks our kernel died, even though it is alive and well. This only happen if we use mkfifo to redirect the output stream from one process to another. If we use a standard file like with this commit: https://github.com/soumith/iTorch/commit/96e8a26a91a90d47583761a55b308364d391585c we do not see any issues. I am trying to understand Ipython semantics for thinking that a kernel died, as the heartbeat is still ticking. I initially thought a SIGPIPE might be triggering Ipython to think that the kernel died, but I am not sure of that. I tried to set a trap here: https://github.com/soumith/iTorch/blob/master/itorch#L7 for SIGPIPE so that before the launch of ipython, SIGPIPE is trapped completely. However that did not help the ?kernel died? message. The "kernel died? message appears when the first execute_request is processed, not before that. Do let me know if you have any pointers. Thanks, Soumith -------------- next part -------------- An HTML attachment was scrubbed... URL: From liam.gretton at leicester.ac.uk Fri Jan 16 05:34:53 2015 From: liam.gretton at leicester.ac.uk (Liam Gretton) Date: Fri, 16 Jan 2015 10:34:53 +0000 Subject: [IPython-dev] %load hangs in qtconsole In-Reply-To: References: <54B78823.1050506@leicester.ac.uk> Message-ID: <54B8E94D.8080706@leicester.ac.uk> On 15/01/2015 18:13, MinRK wrote: > It looks like it's putting the cursor in the wrong place, confusing the UI. > If you place the cursor in the input area, it should allow you to execute > the input. Yes! That is indeed the problem, thanks. I'll report this in GitHub and I'll take a look at the code myself to see if I can fix it. -- Liam Gretton liam.gretton at le.ac.uk Systems Specialist http://www.le.ac.uk/its/ IT Services Tel: +44 (0)116 2522254 University Of Leicester, University Road Leicestershire LE1 7RH, United Kingdom From takowl at gmail.com Fri Jan 16 13:16:48 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Fri, 16 Jan 2015 10:16:48 -0800 Subject: [IPython-dev] iTorch - Weird issues with mkfifo on linux In-Reply-To: References: Message-ID: On 15 January 2015 at 19:26, Soumith Chintala wrote: > One problem we oncovered is that on certain (or possibly all linux > distros) ipython thinks our kernel died, even though it is alive and well. FIFOs have some bizarre properties which might be related - for instance, opening a FIFO for reading will block until something else opens it for writing (the open() call itself blocks, not just attempts to read). Could it be that an unexpectedly blocking system call is stopping the heartbeat and causing IPython to think that your kernel is dead? Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From soumith at fb.com Fri Jan 16 14:05:44 2015 From: soumith at fb.com (Soumith Chintala) Date: Fri, 16 Jan 2015 19:05:44 +0000 Subject: [IPython-dev] iTorch - Weird issues with mkfifo on linux In-Reply-To: References: Message-ID: This is not a problem of blocking reads, or the heartbeat stopping, I have verified both those parts. But I?ll try investigating more into if it?s a system-call/signaling weirdness. Thanks, Soumith From: Thomas Kluyver > Reply-To: IPython developers list > Date: Friday, January 16, 2015 at 10:16 AM To: IPython developers list > Subject: Re: [IPython-dev] iTorch - Weird issues with mkfifo on linux On 15 January 2015 at 19:26, Soumith Chintala > wrote: One problem we oncovered is that on certain (or possibly all linux distros) ipython thinks our kernel died, even though it is alive and well. FIFOs have some bizarre properties which might be related - for instance, opening a FIFO for reading will block until something else opens it for writing (the open() call itself blocks, not just attempts to read). Could it be that an unexpectedly blocking system call is stopping the heartbeat and causing IPython to think that your kernel is dead? Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Fri Jan 16 23:44:38 2015 From: benjaminrk at gmail.com (MinRK) Date: Fri, 16 Jan 2015 20:44:38 -0800 Subject: [IPython-dev] iTorch - Weird issues with mkfifo on linux In-Reply-To: References: Message-ID: Can you run the server with `--debug`, and post the logs around when the failure occurs? On Fri, Jan 16, 2015 at 11:05 AM, Soumith Chintala wrote: > This is not a problem of blocking reads, or the heartbeat stopping, I > have verified both those parts. > But I?ll try investigating more into if it?s a system-call/signaling > weirdness. > Thanks, > Soumith > > From: Thomas Kluyver > Reply-To: IPython developers list > Date: Friday, January 16, 2015 at 10:16 AM > To: IPython developers list > Subject: Re: [IPython-dev] iTorch - Weird issues with mkfifo on linux > > On 15 January 2015 at 19:26, Soumith Chintala wrote: > >> One problem we oncovered is that on certain (or possibly all linux >> distros) ipython thinks our kernel died, even though it is alive and well. > > > FIFOs have some bizarre properties which might be related - for > instance, opening a FIFO for reading will block until something else opens > it for writing (the open() call itself blocks, not just attempts to read). > Could it be that an unexpectedly blocking system call is stopping the > heartbeat and causing IPython to think that your kernel is dead? > > 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: From rnelsonchem at gmail.com Sat Jan 17 14:14:12 2015 From: rnelsonchem at gmail.com (Ryan Nelson) Date: Sat, 17 Jan 2015 14:14:12 -0500 Subject: [IPython-dev] Run IPython Parallel from custom module? Message-ID: Hello everyone, I'm developing a module for processing some data files. There are several steps to this process, which can be time consuming, so I would like to write a helper function in my module that uses IPython.parallel to spread out the work over several processors. Unfortunately, I'm having trouble getting things to work properly. Note: I can get something similar to work when it is not written as a module... I tried my best to make a simple example that fails with the same error that I'm seeing in the larger case (below); however, it is still a little complicated. After running the test script, I get a "NameError" on the cluster nodes (traceback below). If I check the nodes manually, the objects are defined. I can also define new functions from the IPython terminal that act on those objects, and those work as expected. Any help you can provide is most appreciated. Sorry if this is a duplicate, but I couldn't find it anywhere else. Python 3.4 and 2.7 and IPython 2.3.1 Ryan ________________________________________ Here's the approximate structure of my module: mymod/ __init__.py functs.py : helper functions with Parallel support objects.py : contains my custom processing objects # functs.py # ------------- from IPython.parallel import Client import mymod.objects as objects def process(files): client = Client() dview = client[:] dview.block = True # Do this to make module path known # However, my mod will eventually be installed via pip, so this # isn't necessary to reproduce error in that case with dview.sync_imports(): import sys sys.path.append(['/home/nelson/code/testing/',]) dview['sys.path'] = sys.path File = objects.File1 dview['File'] = File result = dview.map_sync(_do_this, files) return result def _do_this(fname): f = File(fname) f.extra = 'hello' return f ------------- # objects.py # ------------- class File1(object): def __init__(self, fname): self.fname = fname ------------- I also have a test script ("test.py") with the following: ------------- from mymod.functs import process result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) [print(i.fname, i.extra) for i in result] ------------- When I run this script, I get the following errors: importing sys on engine(s) Traceback (most recent call last): File "test2.py", line 3, in result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) File "/home/nelson/code/testing/mymod/functs.py", line 16, in process result = dview.map_sync(_do_this, files) File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line 366, in map_sync return self.map(f,*sequences,**kwargs) File "", line 2, in map File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line 66, in sync_results ret = f(self, *args, **kwargs) File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line 624, in map return pf.map(*sequences) File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", line 271, in map ret = self(*sequences) File "", line 2, in __call__ File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", line 78, in sync_view_results return f(self, *args, **kwargs) File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", line 254, in __call__ return r.get() File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", line 118, in get raise self._exception File "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", line 153, in wait results = error.collect_exceptions(results, self._fname) File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", line 233, in collect_exceptions raise e File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", line 231, in collect_exceptions raise CompositeError(msg, elist) IPython.parallel.error.CompositeError: one or more exceptions from call to method: _do_this [0:apply]: NameError: name 'File' is not defined [1:apply]: NameError: name 'File' is not defined [2:apply]: NameError: name 'File' is not defined [3:apply]: NameError: name 'File' is not defined However, if I jump into an interactive Python terminal, these objects are defined on the cluster nodes. In [1]: from IPython.parallel import Client In [2]: client = Client() In [3]: dview = client[:] In [4]: dview['File'] Out[4]: [mymod.objects.File1, mymod.objects.File1, mymod.objects.File1, mymod.objects.File1] -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Sat Jan 17 15:15:47 2015 From: benjaminrk at gmail.com (MinRK) Date: Sat, 17 Jan 2015 12:15:47 -0800 Subject: [IPython-dev] Run IPython Parallel from custom module? In-Reply-To: References: Message-ID: This is one of the most common sources of confusion with IPython.parallel. When you call a function, it?s globals are resolved to its own module. So when you call _do_this, it is looking for File in mymod, not in the interactive namespace. If you had defined _do_this interactively (in __main__), it would have found File. Similarly, if File were defined in the same module as _do_this, it would also be found. IPython provides a decorator that lets you define functions in modules that will be treated as if they were defined in __main__, and will thus have access to the interactive namespace. from IPython.parallel import interactive @interactivedef _do_this(fname): f = File(fname) ... -MinRK ? On Sat, Jan 17, 2015 at 11:14 AM, Ryan Nelson wrote: > Hello everyone, > > I'm developing a module for processing some data files. There are several > steps to this process, which can be time consuming, so I would like to > write a helper function in my module that uses IPython.parallel to spread > out the work over several processors. Unfortunately, I'm having trouble > getting things to work properly. Note: I can get something similar to work > when it is not written as a module... > > I tried my best to make a simple example that fails with the same error > that I'm seeing in the larger case (below); however, it is still a little > complicated. > > After running the test script, I get a "NameError" on the cluster nodes > (traceback below). If I check the nodes manually, the objects are defined. > I can also define new functions from the IPython terminal that act on those > objects, and those work as expected. > > Any help you can provide is most appreciated. Sorry if this is a > duplicate, but I couldn't find it anywhere else. > > Python 3.4 and 2.7 and IPython 2.3.1 > > Ryan > > ________________________________________ > > Here's the approximate structure of my module: > > mymod/ > __init__.py > functs.py : helper functions with Parallel support > objects.py : contains my custom processing objects > > # functs.py # > ------------- > from IPython.parallel import Client > > import mymod.objects as objects > > def process(files): > client = Client() > dview = client[:] > dview.block = True > > # Do this to make module path known > # However, my mod will eventually be installed via pip, so this > # isn't necessary to reproduce error in that case > with dview.sync_imports(): > import sys > sys.path.append(['/home/nelson/code/testing/',]) > > dview['sys.path'] = sys.path > File = objects.File1 > dview['File'] = File > result = dview.map_sync(_do_this, files) > return result > > def _do_this(fname): > f = File(fname) > f.extra = 'hello' > return f > ------------- > > # objects.py # > ------------- > class File1(object): > def __init__(self, fname): > self.fname = fname > ------------- > > I also have a test script ("test.py") with the following: > ------------- > from mymod.functs import process > result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) > [print(i.fname, i.extra) for i in result] > ------------- > > When I run this script, I get the following errors: > > importing sys on engine(s) > Traceback (most recent call last): > File "test2.py", line 3, in > result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) > File "/home/nelson/code/testing/mymod/functs.py", line 16, in process > result = dview.map_sync(_do_this, files) > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line > 366, in map_sync > return self.map(f,*sequences,**kwargs) > File "", line 2, in map > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line > 66, in sync_results > ret = f(self, *args, **kwargs) > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line > 624, in map > return pf.map(*sequences) > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", > line 271, in map > ret = self(*sequences) > File "", line 2, in __call__ > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", > line 78, in sync_view_results > return f(self, *args, **kwargs) > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", > line 254, in __call__ > return r.get() > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", > line 118, in get > raise self._exception > File > "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", > line 153, in wait > results = error.collect_exceptions(results, self._fname) > File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", > line 233, in collect_exceptions > raise e > File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", > line 231, in collect_exceptions > raise CompositeError(msg, elist) > IPython.parallel.error.CompositeError: one or more exceptions from call to > method: _do_this > [0:apply]: NameError: name 'File' is not defined > [1:apply]: NameError: name 'File' is not defined > [2:apply]: NameError: name 'File' is not defined > [3:apply]: NameError: name 'File' is not defined > > However, if I jump into an interactive Python terminal, these objects are > defined on the cluster nodes. > In [1]: from IPython.parallel import Client > > In [2]: client = Client() > > In [3]: dview = client[:] > > In [4]: dview['File'] > > > Out[4]: > [mymod.objects.File1, > mymod.objects.File1, > mymod.objects.File1, > mymod.objects.File1] > > > > _______________________________________________ > 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: From rnelsonchem at gmail.com Sat Jan 17 16:17:07 2015 From: rnelsonchem at gmail.com (Ryan Nelson) Date: Sat, 17 Jan 2015 16:17:07 -0500 Subject: [IPython-dev] Run IPython Parallel from custom module? In-Reply-To: References: Message-ID: Thanks! Searching for that decorator brings up a bunch of search hits. However, it looks like it isn't really documented in the main document yet (?). I'll try this out. Ryan On Sat, Jan 17, 2015 at 3:15 PM, MinRK wrote: > This is one of the most common sources of confusion with IPython.parallel. > When you call a function, it?s globals are resolved to its own module. So > when you call _do_this, it is looking for File in mymod, not in the > interactive namespace. If you had defined _do_this interactively (in > __main__), it would have found File. Similarly, if File were defined in > the same module as _do_this, it would also be found. > > IPython provides a decorator that lets you define functions in modules > that will be treated as if they were defined in __main__, and will thus > have access to the interactive namespace. > > from IPython.parallel import interactive > @interactivedef _do_this(fname): > f = File(fname) > ... > > -MinRK > ? > > On Sat, Jan 17, 2015 at 11:14 AM, Ryan Nelson > wrote: > >> Hello everyone, >> >> I'm developing a module for processing some data files. There are several >> steps to this process, which can be time consuming, so I would like to >> write a helper function in my module that uses IPython.parallel to spread >> out the work over several processors. Unfortunately, I'm having trouble >> getting things to work properly. Note: I can get something similar to work >> when it is not written as a module... >> >> I tried my best to make a simple example that fails with the same error >> that I'm seeing in the larger case (below); however, it is still a little >> complicated. >> >> After running the test script, I get a "NameError" on the cluster nodes >> (traceback below). If I check the nodes manually, the objects are defined. >> I can also define new functions from the IPython terminal that act on those >> objects, and those work as expected. >> >> Any help you can provide is most appreciated. Sorry if this is a >> duplicate, but I couldn't find it anywhere else. >> >> Python 3.4 and 2.7 and IPython 2.3.1 >> >> Ryan >> >> ________________________________________ >> >> Here's the approximate structure of my module: >> >> mymod/ >> __init__.py >> functs.py : helper functions with Parallel support >> objects.py : contains my custom processing objects >> >> # functs.py # >> ------------- >> from IPython.parallel import Client >> >> import mymod.objects as objects >> >> def process(files): >> client = Client() >> dview = client[:] >> dview.block = True >> >> # Do this to make module path known >> # However, my mod will eventually be installed via pip, so this >> # isn't necessary to reproduce error in that case >> with dview.sync_imports(): >> import sys >> sys.path.append(['/home/nelson/code/testing/',]) >> >> dview['sys.path'] = sys.path >> File = objects.File1 >> dview['File'] = File >> result = dview.map_sync(_do_this, files) >> return result >> >> def _do_this(fname): >> f = File(fname) >> f.extra = 'hello' >> return f >> ------------- >> >> # objects.py # >> ------------- >> class File1(object): >> def __init__(self, fname): >> self.fname = fname >> ------------- >> >> I also have a test script ("test.py") with the following: >> ------------- >> from mymod.functs import process >> result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) >> [print(i.fname, i.extra) for i in result] >> ------------- >> >> When I run this script, I get the following errors: >> >> importing sys on engine(s) >> Traceback (most recent call last): >> File "test2.py", line 3, in >> result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) >> File "/home/nelson/code/testing/mymod/functs.py", line 16, in process >> result = dview.map_sync(_do_this, files) >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >> 366, in map_sync >> return self.map(f,*sequences,**kwargs) >> File "", line 2, in map >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >> 66, in sync_results >> ret = f(self, *args, **kwargs) >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >> 624, in map >> return pf.map(*sequences) >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >> line 271, in map >> ret = self(*sequences) >> File "", line 2, in __call__ >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >> line 78, in sync_view_results >> return f(self, *args, **kwargs) >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >> line 254, in __call__ >> return r.get() >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", >> line 118, in get >> raise self._exception >> File >> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", >> line 153, in wait >> results = error.collect_exceptions(results, self._fname) >> File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", >> line 233, in collect_exceptions >> raise e >> File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", >> line 231, in collect_exceptions >> raise CompositeError(msg, elist) >> IPython.parallel.error.CompositeError: one or more exceptions from call >> to method: _do_this >> [0:apply]: NameError: name 'File' is not defined >> [1:apply]: NameError: name 'File' is not defined >> [2:apply]: NameError: name 'File' is not defined >> [3:apply]: NameError: name 'File' is not defined >> >> However, if I jump into an interactive Python terminal, these objects are >> defined on the cluster nodes. >> In [1]: from IPython.parallel import Client >> >> In [2]: client = Client() >> >> In [3]: dview = client[:] >> >> In [4]: dview['File'] >> >> >> Out[4]: >> [mymod.objects.File1, >> mymod.objects.File1, >> mymod.objects.File1, >> mymod.objects.File1] >> >> >> >> _______________________________________________ >> 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: From rnelsonchem at gmail.com Sat Jan 17 20:23:07 2015 From: rnelsonchem at gmail.com (Ryan Nelson) Date: Sat, 17 Jan 2015 20:23:07 -0500 Subject: [IPython-dev] Run IPython Parallel from custom module? In-Reply-To: References: Message-ID: This worked well for the example that I posted. Thanks again. However, it brings up another question. What are the restrictions on using this on methods inside a custom object? For example, if I change "functs.py" into an object with the following methods: @interactive def _do_this(self, fname): f = File(fname) f.extra = 'hello' self._do_something_else(f) return f @interactive def _do_something_else(self, f): f.junk = 'World' I don't get any errors, but "_do_something_else" doesn't seem to be called, but "_do_this" works fine. (Actually, in my larger code, I'm getting a pickling error... But that's tough to reproduce.) Ryan On Sat, Jan 17, 2015 at 4:17 PM, Ryan Nelson wrote: > Thanks! > > Searching for that decorator brings up a bunch of search hits. However, it > looks like it isn't really documented in the main document yet (?). > > I'll try this out. > > Ryan > > > > On Sat, Jan 17, 2015 at 3:15 PM, MinRK wrote: > >> This is one of the most common sources of confusion with >> IPython.parallel. When you call a function, it?s globals are resolved to >> its own module. So when you call _do_this, it is looking for File in >> mymod, not in the interactive namespace. If you had defined _do_this >> interactively (in __main__), it would have found File. Similarly, if File >> were defined in the same module as _do_this, it would also be found. >> >> IPython provides a decorator that lets you define functions in modules >> that will be treated as if they were defined in __main__, and will thus >> have access to the interactive namespace. >> >> from IPython.parallel import interactive >> @interactivedef _do_this(fname): >> f = File(fname) >> ... >> >> -MinRK >> ? >> >> On Sat, Jan 17, 2015 at 11:14 AM, Ryan Nelson >> wrote: >> >>> Hello everyone, >>> >>> I'm developing a module for processing some data files. There are >>> several steps to this process, which can be time consuming, so I would like >>> to write a helper function in my module that uses IPython.parallel to >>> spread out the work over several processors. Unfortunately, I'm having >>> trouble getting things to work properly. Note: I can get something similar >>> to work when it is not written as a module... >>> >>> I tried my best to make a simple example that fails with the same error >>> that I'm seeing in the larger case (below); however, it is still a little >>> complicated. >>> >>> After running the test script, I get a "NameError" on the cluster nodes >>> (traceback below). If I check the nodes manually, the objects are defined. >>> I can also define new functions from the IPython terminal that act on those >>> objects, and those work as expected. >>> >>> Any help you can provide is most appreciated. Sorry if this is a >>> duplicate, but I couldn't find it anywhere else. >>> >>> Python 3.4 and 2.7 and IPython 2.3.1 >>> >>> Ryan >>> >>> ________________________________________ >>> >>> Here's the approximate structure of my module: >>> >>> mymod/ >>> __init__.py >>> functs.py : helper functions with Parallel support >>> objects.py : contains my custom processing objects >>> >>> # functs.py # >>> ------------- >>> from IPython.parallel import Client >>> >>> import mymod.objects as objects >>> >>> def process(files): >>> client = Client() >>> dview = client[:] >>> dview.block = True >>> >>> # Do this to make module path known >>> # However, my mod will eventually be installed via pip, so this >>> # isn't necessary to reproduce error in that case >>> with dview.sync_imports(): >>> import sys >>> sys.path.append(['/home/nelson/code/testing/',]) >>> >>> dview['sys.path'] = sys.path >>> File = objects.File1 >>> dview['File'] = File >>> result = dview.map_sync(_do_this, files) >>> return result >>> >>> def _do_this(fname): >>> f = File(fname) >>> f.extra = 'hello' >>> return f >>> ------------- >>> >>> # objects.py # >>> ------------- >>> class File1(object): >>> def __init__(self, fname): >>> self.fname = fname >>> ------------- >>> >>> I also have a test script ("test.py") with the following: >>> ------------- >>> from mymod.functs import process >>> result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) >>> [print(i.fname, i.extra) for i in result] >>> ------------- >>> >>> When I run this script, I get the following errors: >>> >>> importing sys on engine(s) >>> Traceback (most recent call last): >>> File "test2.py", line 3, in >>> result = process(['a', 'b', 'c', 'd', 'e', 'f', 'g']) >>> File "/home/nelson/code/testing/mymod/functs.py", line 16, in process >>> result = dview.map_sync(_do_this, files) >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >>> 366, in map_sync >>> return self.map(f,*sequences,**kwargs) >>> File "", line 2, in map >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >>> 66, in sync_results >>> ret = f(self, *args, **kwargs) >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/view.py", line >>> 624, in map >>> return pf.map(*sequences) >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >>> line 271, in map >>> ret = self(*sequences) >>> File "", line 2, in __call__ >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >>> line 78, in sync_view_results >>> return f(self, *args, **kwargs) >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/remotefunction.py", >>> line 254, in __call__ >>> return r.get() >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", >>> line 118, in get >>> raise self._exception >>> File >>> "/usr/lib64/python3.4/site-packages/IPython/parallel/client/asyncresult.py", >>> line 153, in wait >>> results = error.collect_exceptions(results, self._fname) >>> File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", >>> line 233, in collect_exceptions >>> raise e >>> File "/usr/lib64/python3.4/site-packages/IPython/parallel/error.py", >>> line 231, in collect_exceptions >>> raise CompositeError(msg, elist) >>> IPython.parallel.error.CompositeError: one or more exceptions from call >>> to method: _do_this >>> [0:apply]: NameError: name 'File' is not defined >>> [1:apply]: NameError: name 'File' is not defined >>> [2:apply]: NameError: name 'File' is not defined >>> [3:apply]: NameError: name 'File' is not defined >>> >>> However, if I jump into an interactive Python terminal, these objects >>> are defined on the cluster nodes. >>> In [1]: from IPython.parallel import Client >>> >>> In [2]: client = Client() >>> >>> In [3]: dview = client[:] >>> >>> In [4]: dview['File'] >>> >>> >>> Out[4]: >>> [mymod.objects.File1, >>> mymod.objects.File1, >>> mymod.objects.File1, >>> mymod.objects.File1] >>> >>> >>> >>> _______________________________________________ >>> 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: From lev at columbia.edu Sun Jan 18 08:28:55 2015 From: lev at columbia.edu (Lev Givon) Date: Sun, 18 Jan 2015 08:28:55 -0500 Subject: [IPython-dev] question about KernelClient.is_alive() Message-ID: <20150118132855.GA5685@avicenna> I recently tried using IPython.kernel.KernelClient (in IPython 2.3.1 on Ubuntu 14.04.1) to connect to a locally running kernel (started from the command line by running "ipython kernel") by passing it the connection file associated with the latter. While doing so, I noticed that KernelClient.is_alive() returns True even when KernelClient is instantiated with a nonexistent connection file, i.e., import IPython.kernel kc = IPython.kernel.KernelClient(connection_file='/tmp/nonexistent_file') print kc.is_alive() Is this expected? The online documentation seems to imply that is_alive() should return True only if the kernel to which KernelClient is connected is running. -- Lev Givon Bionet Group | Neurokernel Project http://www.columbia.edu/~lev/ http://lebedov.github.io/ http://neurokernel.github.io/ From damianavila at gmail.com Sun Jan 18 09:19:44 2015 From: damianavila at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Avila?=) Date: Sun, 18 Jan 2015 11:19:44 -0300 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: (Belatedly) Congrats! You both make an amazing work every day! Cheers. Damian 2015-01-05 19:01 GMT-03:00 Brian Granger : > Thanks so much for your work Kyle and Nick! > > Cheers, > > Brian > > On Sun, Jan 4, 2015 at 10:01 AM, ssanderson > wrote: > >> Congrats! >> >> >> >> -- >> View this message in context: >> http://python.6.x6.nabble.com/Welcoming-Kyle-Kelley-and-Nick-Bollweg-to-the-core-Jupyter-IPython-team-tp5082131p5082155.html >> Sent from the IPython - Development mailing list archive at Nabble.com. >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > @ellisonbg on Twitter and GitHub > bgranger at calpoly.edu and ellisonbg at gmail.com > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- *Dami?n* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lev at columbia.edu Sun Jan 18 11:43:19 2015 From: lev at columbia.edu (Lev Givon) Date: Sun, 18 Jan 2015 11:43:19 -0500 Subject: [IPython-dev] question about KernelClient.is_alive() In-Reply-To: <20150118132855.GA5685@avicenna> References: <20150118132855.GA5685@avicenna> Message-ID: <20150118164319.GB7084@avicenna.ee.columbia.edu> Received from Lev Givon on Sun, Jan 18, 2015 at 08:28:55AM EST: > I recently tried using IPython.kernel.KernelClient (in IPython 2.3.1 on Ubuntu > 14.04.1) to connect to a locally running kernel (started from the command line > by running "ipython kernel") by passing it the connection file associated with > the latter. While doing so, I noticed that KernelClient.is_alive() returns True > even when KernelClient is instantiated with a nonexistent connection file, i.e., > > import IPython.kernel > kc = IPython.kernel.KernelClient(connection_file='/tmp/nonexistent_file') > print kc.is_alive() > > Is this expected? The online documentation seems to imply that is_alive() should > return True only if the kernel to which KernelClient is connected is running. (Answering my own question for the benefit of others.) The value of KernelClient.is_alive() evidently isn't indicative of actual kernel status until the heartbeat channel is activated and unpaused to determine whether the client is interacting with a live kernel. -- Lev Givon Bionet Group | Neurokernel Project http://www.columbia.edu/~lev/ http://lebedov.github.io/ http://neurokernel.github.io/ From nick.bollweg at gmail.com Sun Jan 18 13:30:40 2015 From: nick.bollweg at gmail.com (Nicholas Bollweg) Date: Sun, 18 Jan 2015 13:30:40 -0500 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: Thanks everybody! Just as an update: we're back from the hospital, and our new little person is doing great! We're all a bit sleepy, so take anything posted at strange hours of the day with a grain of salt :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Sun Jan 18 13:45:09 2015 From: ellisonbg at gmail.com (Brian Granger) Date: Sun, 18 Jan 2015 10:45:09 -0800 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: Congrats! On Sun, Jan 18, 2015 at 10:30 AM, Nicholas Bollweg wrote: > Thanks everybody! > > Just as an update: we're back from the hospital, and our new little person > is doing great! We're all a bit sleepy, so take anything posted at strange > hours of the day with a grain of salt :) > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger at calpoly.edu and ellisonbg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rgbkrk at gmail.com Sun Jan 18 14:31:07 2015 From: rgbkrk at gmail.com (Kyle Kelley) Date: Sun, 18 Jan 2015 13:31:07 -0600 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: Congratulations! We have little ones too, so we understand. The team and community seem to put up with my sleep deprived contributions. ;) Rest well and enjoy the new addition. They're a lot of fun! -- Kyle On Sunday, January 18, 2015, Nicholas Bollweg wrote: > Thanks everybody! > > Just as an update: we're back from the hospital, and our new little person > is doing great! We're all a bit sleepy, so take anything posted at strange > hours of the day with a grain of salt :) > -- Kyle Kelley (@rgbkrk ; http://lambdaops.com) -------------- next part -------------- An HTML attachment was scrubbed... URL: From DavidAnthonyPowell+python at gmail.com Mon Jan 19 01:47:21 2015 From: DavidAnthonyPowell+python at gmail.com (David Powell) Date: Mon, 19 Jan 2015 17:47:21 +1100 Subject: [IPython-dev] WebGL example in IPython notebook based on three.js Message-ID: Hello all, I recently managed to get 3D vector plots working in the IPython notebook, by statically producing three.js output. I thought I'd share it here in case this example is useful for anyone else, or if anyone has any suggestions as to how I could do things better. The advantage of the static approach is that the output survives the nbconvert process, which you can see in this notebook here (which also compares with a couple of other unsatisfactory ways of visualising 3D vector plots). http://nbviewer.ipython.org/github/DavidPowell/openmodes-examples/blob/master/How%20to%20create%203D%20plots.ipynb Another example can be seen at: http://nbviewer.ipython.org/github/DavidPowell/openmodes-examples/blob/master/Using%20and%20creating%20geometric%20shapes.ipynb If you are interested to see how this works, you can check out the python source: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/ipython.py As well as the javascript: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/static/three_js_plot.js and finally the HTML: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/templates/three_js_plot.html By the way, I am aware of the efforts to make a proper three.js IPython widget (https://github.com/jasongrout/pythreejs/), and will probably switch over to this once it is stable, and when the output can survive ipython's nbconvert process. Is this something we can expect for widgets in IPython 3.0? regards David -------------- next part -------------- An HTML attachment was scrubbed... URL: From soumith at fb.com Mon Jan 19 01:50:30 2015 From: soumith at fb.com (Soumith Chintala) Date: Mon, 19 Jan 2015 06:50:30 +0000 Subject: [IPython-dev] WebGL example in IPython notebook based on three.js In-Reply-To: References: Message-ID: This is fantastic! I was going to do some of this work myself over the next month for iTorch (https://github.com/facebook/iTorch), and you saved me some trouble. I will take a look at your code over the next couple of days, I am wondering if you would have any issues if I directly adapted your javascript side of things in iTorch rather than rewriting from scratch. ? Soumith From: David Powell > Reply-To: IPython developers list > Date: Sunday, January 18, 2015 at 10:47 PM To: IPython developers list > Subject: [IPython-dev] WebGL example in IPython notebook based on three.js Hello all, I recently managed to get 3D vector plots working in the IPython notebook, by statically producing three.js output. I thought I'd share it here in case this example is useful for anyone else, or if anyone has any suggestions as to how I could do things better. The advantage of the static approach is that the output survives the nbconvert process, which you can see in this notebook here (which also compares with a couple of other unsatisfactory ways of visualising 3D vector plots). http://nbviewer.ipython.org/github/DavidPowell/openmodes-examples/blob/master/How%20to%20create%203D%20plots.ipynb Another example can be seen at: http://nbviewer.ipython.org/github/DavidPowell/openmodes-examples/blob/master/Using%20and%20creating%20geometric%20shapes.ipynb If you are interested to see how this works, you can check out the python source: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/ipython.py As well as the javascript: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/static/three_js_plot.js and finally the HTML: https://github.com/DavidPowell/OpenModes/blob/master/openmodes/templates/three_js_plot.html By the way, I am aware of the efforts to make a proper three.js IPython widget (https://github.com/jasongrout/pythreejs/), and will probably switch over to this once it is stable, and when the output can survive ipython's nbconvert process. Is this something we can expect for widgets in IPython 3.0? regards David -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Mon Jan 19 06:08:52 2015 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 19 Jan 2015 12:08:52 +0100 Subject: [IPython-dev] WebGL example in IPython notebook based on three.js In-Reply-To: References: Message-ID: Hi all, Le 19 janv. 2015 ? 07:50, Soumith Chintala a ?crit : > This is fantastic! I was going to do some of this work myself over the next month for iTorch (https://github.com/facebook/iTorch), and you saved me some trouble. > I will take a look at your code over the next couple of days, I am wondering if you would have any issues if I directly adapted your javascript side of things in iTorch rather than rewriting from scratch. We still haven't really figured it out how to share javascript in between packages of different languages. (well technically in 3.0 yo can install into $NBEXTENSION directory, but install process is not perfect) If you can figured that out, and that all kernels agree on a set of relatively common JS "plugins" that are often used we might be able to work on making theses plugin available on nbviewer. Long term planning of course, but I'd like people to keep that in mind. -- M -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Mon Jan 19 06:19:02 2015 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 19 Jan 2015 12:19:02 +0100 Subject: [IPython-dev] Welcoming Kyle Kelley and Nick Bollweg to the core Jupyter/IPython team In-Reply-To: References: <1420394484530-5082155.post@n6.nabble.com> Message-ID: <9202D5B9-022F-4A95-B9D2-427E5B2A84A0@gmail.com> Congratulation too, Looking forward to your nightly contributions ! Le 18 janv. 2015 ? 19:30, Nicholas Bollweg a ?crit : > Thanks everybody! > > Just as an update: we're back from the hospital, and our new little person is doing great! We're all a bit sleepy, so take anything posted at strange hours of the day with a grain of salt :) > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From zvoros at gmail.com Mon Jan 19 06:26:00 2015 From: zvoros at gmail.com (=?UTF-8?B?Wm9sdMOhbiBWw7Zyw7Zz?=) Date: Mon, 19 Jan 2015 12:26:00 +0100 Subject: [IPython-dev] status of nbconvert Message-ID: <54BCE9C8.6080304@gmail.com> Hi all, I have recently had problems with nbconvert, and I was wondering, whether I do something improper, or the code is really broken. I have pulled the latest from master, and nbconvert fails outright with a simple notebook. (This eventually leads to a 500 server error, whenever I try to download a notebook.) Here is my traceback: ipython nbconvert test.ipynb Traceback (most recent call last): File "/usr/local/bin/ipython", line 5, in start_ipython() File "/usr/local/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython return launch_new_instance(argv=argv, **kwargs) File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 573, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 321, in initialize super(TerminalIPythonApp, self).initialize(argv) File "", line 2, in initialize File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/IPython/core/application.py", line 369, in initialize self.parse_command_line(argv) File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line return super(TerminalIPythonApp, self).parse_command_line(argv) File "", line 2, in parse_command_line File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 471, in parse_command_line return self.initialize_subcommand(subc, subargv) File "", line 2, in initialize_subcommand File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 402, in initialize_subcommand subapp = import_item(subapp) File "/usr/local/lib/python2.7/dist-packages/IPython/utils/importstring.py", line 42, in import_item module = __import__(package, fromlist=[obj]) File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/__init__.py", line 3, in from .exporters import * File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/__init__.py", line 1, in from .export import * File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/export.py", line 13, in from .templateexporter import TemplateExporter File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 30, in from IPython.nbconvert import filters File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/__init__.py", line 6, in from .markdown import * File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", line 79, in class MathBlockLexer(mistune.BlockLexer): File "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", line 80, in MathBlockLexer default_rules = ['block_math', 'latex_environment'] + mistune.BlockLexer.default_rules AttributeError: type object 'BlockLexer' has no attribute 'default_rules' If, in markdown.py, I remove + mistune.BlockLexer.default_rules on line 80, and + mistune.InlineLexer.default_rules on line 108, then everything seems to work fine. Could it be that the mistune version that I have (0.4) doesn't have the default_rules property, but the version with which ipython was tested on travis has? If so, shouldn't nbconvert bail out when the version requirement is not fulfilled, or shouldn't simply the default_rules property be defined, when the class is inherited in markdown.py? If this is the case, I could file a fix on github. Somewhat related: if there is a server error, wouldn't it be more meaningful to return the traceback, instead of "500: internal server error"? Cheers, Zolt?n From bussonniermatthias at gmail.com Mon Jan 19 06:31:17 2015 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 19 Jan 2015 12:31:17 +0100 Subject: [IPython-dev] status of nbconvert In-Reply-To: <54BCE9C8.6080304@gmail.com> References: <54BCE9C8.6080304@gmail.com> Message-ID: <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> There is definitively a mistune api change, we check dependency in setup.py : https://github.com/ipython/ipython/blob/50799e6943174cbd24998c4fb018eff42aac5cfb/setup.py#L257 'mistune>=0.5' But we definitively don't check at runtime. So the bug should be encounters only by people having installed master some time ago and just pulling new versions. Normal install should not suffer of this. You are right about the 500 though. -- M Le 19 janv. 2015 ? 12:26, Zolt?n V?r?s a ?crit : > Hi all, > > I have recently had problems with nbconvert, and I was wondering, > whether I do something improper, or the code is really broken. I have > pulled the latest from master, and nbconvert fails outright with a > simple notebook. (This eventually leads to a 500 server error, whenever > I try to download a notebook.) > > Here is my traceback: > > ipython nbconvert test.ipynb > Traceback (most recent call last): > File "/usr/local/bin/ipython", line 5, in > start_ipython() > File "/usr/local/lib/python2.7/dist-packages/IPython/__init__.py", > line 120, in start_ipython > return launch_new_instance(argv=argv, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 573, in launch_instance > app.initialize(argv) > File "", line 2, in initialize > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 75, in catch_config_error > return method(app, *args, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line > 321, in initialize > super(TerminalIPythonApp, self).initialize(argv) > File "", line 2, in initialize > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 75, in catch_config_error > return method(app, *args, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/IPython/core/application.py", > line 369, in initialize > self.parse_command_line(argv) > File > "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line > 316, in parse_command_line > return super(TerminalIPythonApp, self).parse_command_line(argv) > File "", line 2, in parse_command_line > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 75, in catch_config_error > return method(app, *args, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 471, in parse_command_line > return self.initialize_subcommand(subc, subargv) > File "", line 2, in initialize_subcommand > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 75, in catch_config_error > return method(app, *args, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", > line 402, in initialize_subcommand > subapp = import_item(subapp) > File > "/usr/local/lib/python2.7/dist-packages/IPython/utils/importstring.py", > line 42, in import_item > module = __import__(package, fromlist=[obj]) > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/__init__.py", > line 3, in > from .exporters import * > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/__init__.py", > line 1, in > from .export import * > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/export.py", > line 13, in > from .templateexporter import TemplateExporter > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", > line 30, in > from IPython.nbconvert import filters > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/__init__.py", > line 6, in > from .markdown import * > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", > line 79, in > class MathBlockLexer(mistune.BlockLexer): > File > "/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", > line 80, in MathBlockLexer > default_rules = ['block_math', 'latex_environment'] + > mistune.BlockLexer.default_rules > AttributeError: type object 'BlockLexer' has no attribute 'default_rules' > > > > If, in markdown.py, I remove > > + mistune.BlockLexer.default_rules on line 80, and > + mistune.InlineLexer.default_rules on line 108, then everything seems > to work fine. > > Could it be that the mistune version that I have (0.4) doesn't have the > default_rules property, but the version with which ipython was tested on > travis has? If so, shouldn't nbconvert bail out when the version > requirement is not fulfilled, or shouldn't simply the default_rules > property be defined, when the class is inherited in markdown.py? If this > is the case, I could file a fix on github. > > Somewhat related: if there is a server error, wouldn't it be more > meaningful to return the traceback, instead of "500: internal server error"? > > Cheers, > Zolt?n > > > _______________________________________________ > 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: From zvoros at gmail.com Mon Jan 19 06:40:45 2015 From: zvoros at gmail.com (=?windows-1252?Q?Zolt=E1n_V=F6r=F6s?=) Date: Mon, 19 Jan 2015 12:40:45 +0100 Subject: [IPython-dev] status of nbconvert In-Reply-To: <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> References: <54BCE9C8.6080304@gmail.com> <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> Message-ID: <54BCED3D.8040705@gmail.com> Hi Matthias, On 01/19/2015 12:31 PM, Matthias BUSSONNIER wrote: > > > There is definitively a mistune api change, > we check dependency in setup.py : > > https://github.com/ipython/ipython/blob/50799e6943174cbd24998c4fb018eff42aac5cfb/setup.py#L257 > > 'mistune>=0.5' > > But we definitively don't check at runtime. > So the bug should be encounters only by people having installed > master some time ago and just pulling new versions. Yes, I think this is what has happened. What is a bit odd, though, is that both easy_install and pip want to install version 0.4. I guess, you installed it from source. Cheers, Zolt?n From bussonniermatthias at gmail.com Mon Jan 19 07:06:00 2015 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Mon, 19 Jan 2015 13:06:00 +0100 Subject: [IPython-dev] status of nbconvert In-Reply-To: <54BCED3D.8040705@gmail.com> References: <54BCE9C8.6080304@gmail.com> <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> <54BCED3D.8040705@gmail.com> Message-ID: <76A22C20-FFC4-4B59-A06D-F144FCF863F2@gmail.com> Le 19 janv. 2015 ? 12:40, Zolt?n V?r?s a ?crit : > Hi Matthias, > > On 01/19/2015 12:31 PM, Matthias BUSSONNIER wrote: >> >> >> There is definitively a mistune api change, >> we check dependency in setup.py : >> >> https://github.com/ipython/ipython/blob/50799e6943174cbd24998c4fb018eff42aac5cfb/setup.py#L257 >> >> 'mistune>=0.5' >> >> But we definitively don't check at runtime. >> So the bug should be encounters only by people having installed >> master some time ago and just pulling new versions. > > Yes, I think this is what has happened. What is a bit odd, though, is > that both easy_install and pip want to install version 0.4. I guess, you > installed it from source. Hum, that's weird. I'll try to have a look. Thanks ! -- M > > Cheers, > Zolt?n > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From zvoros at gmail.com Mon Jan 19 07:33:11 2015 From: zvoros at gmail.com (=?windows-1252?Q?Zolt=E1n_V=F6r=F6s?=) Date: Mon, 19 Jan 2015 13:33:11 +0100 Subject: [IPython-dev] status of nbconvert In-Reply-To: <76A22C20-FFC4-4B59-A06D-F144FCF863F2@gmail.com> References: <54BCE9C8.6080304@gmail.com> <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> <54BCED3D.8040705@gmail.com> <76A22C20-FFC4-4B59-A06D-F144FCF863F2@gmail.com> Message-ID: <54BCF987.3030501@gmail.com> Hi Matthias, On 01/19/2015 01:06 PM, Matthias BUSSONNIER wrote: >> Yes, I think this is what has happened. What is a bit odd, though, is >> that both easy_install and pip want to install version 0.4. I guess, you >> installed it from source. > Hum, that's weird. > > I'll try to have a look. > > Thanks ! I have installed the source, and I no longer have problems with nbconvert. Is there someone whom I could notify to fix pip/easy_install? I have absolutely no idea how that is managed. I have seen that Thomas Kluyver is on the development team. Thomas? Cheers, Zolt?n From cyrille.rossant at gmail.com Mon Jan 19 07:30:15 2015 From: cyrille.rossant at gmail.com (Cyrille Rossant) Date: Mon, 19 Jan 2015 13:30:15 +0100 Subject: [IPython-dev] WebGL example in IPython notebook based on three.js In-Reply-To: References: Message-ID: Thanks for sharing this! I'd like to add that there's also work being done currently for bringing WebGL visualization to the notebook via VisPy. We don't use three.js but custom WebGL code generated by Python. The WebGL backend currently requires a live Python server, but a standalone version is also in the pipes. 2015-01-19 12:08 GMT+01:00 Matthias BUSSONNIER : > Hi all, > Le 19 janv. 2015 ? 07:50, Soumith Chintala a ?crit : > > This is fantastic! I was going to do some of this work myself over the next > month for iTorch (https://github.com/facebook/iTorch), and you saved me some > trouble. > I will take a look at your code over the next couple of days, I am wondering > if you would have any issues if I directly adapted your javascript side of > things in iTorch rather than rewriting from scratch. > > > We still haven't really figured it out how to share javascript in between > packages of different languages. > (well technically in 3.0 yo can install into $NBEXTENSION directory, but > install process is not perfect) > If you can figured that out, and that all kernels agree on a set of > relatively common JS "plugins" that > are often used we might be able to work on making theses plugin available > on nbviewer. > > Long term planning of course, but I'd like people to keep that in mind. > > -- > M > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From takowl at gmail.com Mon Jan 19 12:54:54 2015 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 19 Jan 2015 09:54:54 -0800 Subject: [IPython-dev] status of nbconvert In-Reply-To: <54BCF987.3030501@gmail.com> References: <54BCE9C8.6080304@gmail.com> <467EF986-3EB8-40C8-9C16-38B6DF6D84CF@gmail.com> <54BCED3D.8040705@gmail.com> <76A22C20-FFC4-4B59-A06D-F144FCF863F2@gmail.com> <54BCF987.3030501@gmail.com> Message-ID: On 19 January 2015 at 04:33, Zolt?n V?r?s wrote: > I have installed the source, and I no longer have problems with > nbconvert. Is there someone whom I could notify to fix pip/easy_install? > I have absolutely no idea how that is managed. I have seen that Thomas > Kluyver is on the development team. Thomas? > No ideas, sorry. My pip found mistune 0.5 OK. I wouldn't use easy_install for anything now. Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at payne.org Mon Jan 19 14:30:30 2015 From: andy at payne.org (Andrew Payne) Date: Mon, 19 Jan 2015 14:30:30 -0500 Subject: [IPython-dev] WebGL example in IPython notebook based on three.js In-Reply-To: References: Message-ID: > I recently managed to get 3D vector plots working in the IPython notebook, > by statically producing three.js output. I thought I'd share it here in > case this example is useful for anyone else, or if anyone has any > suggestions as to how I could do things better. > Great work! Thanks for sharing that. Did you consider or explore using require.js to load the three.js library? You can reference and load the library once, and then not have to inline it within each cell. Aside for folks fiddling with Javscript libraries & the Web notebook: the obvious approach of dropping a