From thomas.robitaille at gmail.com Thu Oct 1 08:13:04 2015 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Thu, 1 Oct 2015 14:13:04 +0200 Subject: [IPython-dev] ANN: numtraits v0.2 Message-ID: Hi everyone, (I sent this to ipython-user but didn't realize it was deprecated, so re-sending to this list) We have released a small experimental package called numtraits that builds on top of the traitlets package and provides a NumericalTrait class that can be used to validate properties such as: * number of dimension (for arrays) * shape (for arrays) * domain (e.g. positive, negative, range of values) * units (with support for astropy.units, pint, and quantities) The idea is to be able to write a class like: class Sphere(HasTraits): radius = NumericalTrait(domain='strictly-positive', ndim=0) position = NumericalTrait(shape=(3,)) and all the validation will then be done automatically when the user sets 'radius' or 'position'. In addition, tuples and lists can get automatically converted to arrays, and default values can be specified. You can read more about the package and see examples of it in use here: https://github.com/astrofrog/numtraits and it can be easily installed with pip install numtraits The package supports both Python 3.3+ and Legacy Python (2.7) :) At this point, we would be very interested in feedback - the package is still very young and we can still change the API if needed. Please open issues with suggestions! Cheers, Tom and Francesco From gijsmolenaar at gmail.com Thu Oct 1 08:45:43 2015 From: gijsmolenaar at gmail.com (Gijs Molenaar) Date: Thu, 1 Oct 2015 14:45:43 +0200 Subject: [IPython-dev] embedding js9 into a notebook Message-ID: Hi all! I'm trying to embed JS9 into a notebook, but I'm not successful yet. I hope this is the right place to ask a question about this. JS9 is the javascript version of DS9, an astronomical image viewer: http://js9.si.edu/ You can find my initial work here: https://github.com/gijzelaerr/js9notebook I could not really find documentation on how to create such a thing. My idea was to create a python package which you can pip and load, just like bokeh works. I see multiple ways you can inject javascript into the browser from the python code, but I think using IPython.core.displaypub.publish_display_data is probably best. https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18 I was assuming reading the javascript file like this and then executing it with publish_display_data would be the same as loading it with a script tag, but I keep getting all kind of errors about objects not defined: https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb So basically I have two questions: * Is this the right way to do such a thing? I find it a bit hard to find out where the problems are, isn't it possible to serve the javascript somewhere static? * What am I doing wrong loading javascript this way? Greetings, -- Gijs Molenaar http://pythonic.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2015-10-01 14:24:47.png Type: image/png Size: 114223 bytes Desc: not available URL: From nick.bollweg at gmail.com Thu Oct 1 08:47:40 2015 From: nick.bollweg at gmail.com (Nicholas Bollweg) Date: Thu, 01 Oct 2015 12:47:40 +0000 Subject: [IPython-dev] ANN: numtraits v0.2 In-Reply-To: References: Message-ID: Really awesome! FurlongsPerHogsheadFloatSliders for everyone! When using this with widgets in the notebook, i would desperately want the units/shapes to be available on the frontend in math.js and (some matrix library) wrappers, though I'm not sure how compatible their unit system is with astropy's. Any thoughts about that? We also use openmdao, and would love to be able to use their units directly... Do you think that would be extensible? On 08:13, Thu, Oct 1, 2015 Thomas Robitaille wrote: > Hi everyone, > > (I sent this to ipython-user but didn't realize it was deprecated, so > re-sending to this list) > > We have released a small experimental package called numtraits that > builds on top of the traitlets package and provides a NumericalTrait > class that can be used to validate properties such as: > > * number of dimension (for arrays) > * shape (for arrays) > * domain (e.g. positive, negative, range of values) > * units (with support for astropy.units, pint, and quantities) > > The idea is to be able to write a class like: > > class Sphere(HasTraits): > > radius = NumericalTrait(domain='strictly-positive', ndim=0) > position = NumericalTrait(shape=(3,)) > > and all the validation will then be done automatically when the user > sets 'radius' or 'position'. > > In addition, tuples and lists can get automatically converted to > arrays, and default values can be specified. You can read more about > the package and see examples of it in use here: > > https://github.com/astrofrog/numtraits > > and it can be easily installed with > > pip install numtraits > > The package supports both Python 3.3+ and Legacy Python (2.7) :) > > At this point, we would be very interested in feedback - the package > is still very young and we can still change the API if needed. Please > open issues with suggestions! > > Cheers, > > Tom and Francesco > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Oct 1 09:04:45 2015 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 1 Oct 2015 08:04:45 -0500 Subject: [IPython-dev] ANN: numtraits v0.2 In-Reply-To: References: Message-ID: "Numerical properties for Python objects" https://github.com/astrofrog/numtraits /blob/master/README.md at first glance, thanks! other relevant type constraints work: * https://andreacensi.github.io/contracts/ * http://mypy-lang.org/examples.html * https://www.python.org/dev/peps/pep-0482/ PEP 0482 -- Literature Overview for Type Hints * https://www.python.org/dev/peps/pep-0484/ PEP 0484 -- Type Hints * XSD other relevant units work: * https://wrdrd.com/docs/consulting/units#rdf-and-units * QUDT https://wrdrd.com/docs/consulting/knowledge-engineering#qudt scipy pydata ecosystem support: - how do I save this schema and these units (metadata) with the data? is this compositional? - [ ] .meta colspec w/ datatype URIs and unit URIs (pandasrdf#1) - [ ] ... looks great; thanks again! On Oct 1, 2015 7:13 AM, "Thomas Robitaille" wrote: Hi everyone, (I sent this to ipython-user but didn't realize it was deprecated, so re-sending to this list) We have released a small experimental package called numtraits that builds on top of the traitlets package and provides a NumericalTrait class that can be used to validate properties such as: * number of dimension (for arrays) * shape (for arrays) * domain (e.g. positive, negative, range of values) * units (with support for astropy.units, pint, and quantities) The idea is to be able to write a class like: class Sphere(HasTraits): radius = NumericalTrait(domain='strictly-positive', ndim=0) position = NumericalTrait(shape=(3,)) and all the validation will then be done automatically when the user sets 'radius' or 'position'. In addition, tuples and lists can get automatically converted to arrays, and default values can be specified. You can read more about the package and see examples of it in use here: https://github.com/astrofrog/numtraits and it can be easily installed with pip install numtraits The package supports both Python 3.3+ and Legacy Python (2.7) :) At this point, we would be very interested in feedback - the package is still very young and we can still change the API if needed. Please open issues with suggestions! Cheers, Tom and Francesco _______________________________________________ IPython-dev mailing list IPython-dev at scipy.org https://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From kikocorreoso at gmail.com Thu Oct 1 09:08:26 2015 From: kikocorreoso at gmail.com (Kiko) Date: Thu, 1 Oct 2015 15:08:26 +0200 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: 2015-10-01 14:45 GMT+02:00 Gijs Molenaar : > Hi all! I'm trying to embed JS9 into a notebook, but I'm not successful > yet. I hope this is the right place to ask a question about this. JS9 is > the javascript version of DS9, an astronomical image viewer: > > http://js9.si.edu/ > > You can find my initial work here: > > https://github.com/gijzelaerr/js9notebook > > I could not really find documentation on how to create such a thing. My > idea was to create a python package which you can pip and load, just like > bokeh works. I see multiple ways you can inject javascript into the > browser from the python code, but I think using > IPython.core.displaypub.publish_display_data is probably best. > > > https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18 > > I was assuming reading the javascript file like this and then executing it > with publish_display_data would be the same as loading it with a script > tag, but I keep getting all kind of errors about objects not defined: > > > https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb > > So basically I have two questions: > > * Is this the right way to do such a thing? I find it a bit hard to find > out where the problems are, isn't it possible to serve the javascript > somewhere static? > * What am I doing wrong loading javascript this way? > > > Greetings, > Hi, Maybe the following links can help you to find the path: https://github.com/jdfreder/jupyter-pip https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter If you are successfull and you have time it would be great to document it. :-D > -- > Gijs Molenaar > http://pythonic.nl > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Oct 1 09:15:23 2015 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 1 Oct 2015 08:15:23 -0500 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: On Oct 1, 2015 8:08 AM, "Kiko" wrote: > > > > 2015-10-01 14:45 GMT+02:00 Gijs Molenaar : >> >> Hi all! I'm trying to embed JS9 into a notebook, but I'm not successful yet. I hope this is the right place to ask a question about this. JS9 is the javascript version of DS9, an astronomical image viewer: >> >> http://js9.si.edu/ >> >> You can find my initial work here: >> >> https://github.com/gijzelaerr/js9notebook >> >> I could not really find documentation on how to create such a thing. My idea was to create a python package which you can pip and load, just like bokeh works. I see multiple ways you can inject javascript into the browser from the python code, but I think using IPython.core.displaypub.publish_display_data is probably best. >> >> https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18 >> >> I was assuming reading the javascript file like this and then executing it with publish_display_data would be the same as loading it with a script tag, but I keep getting all kind of errors about objects not defined: >> >> https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb >> >> So basically I have two questions: >> >> * Is this the right way to do such a thing? I find it a bit hard to find out where the problems are, isn't it possible to serve the javascript somewhere static? >> * What am I doing wrong loading javascript this way? >> >> >> Greetings, > > > Hi, > > Maybe the following links can help you to find the path: > > https://github.com/jdfreder/jupyter-pip > https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter > > If you are successfull and you have time it would be great to document it. is this similar to the pattern your are looking for? https://github.com/ricklupton/ipython-d3-sankey/blob/master/setup.py > > :-D > >> >> -- >> Gijs Molenaar >> http://pythonic.nl >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev >> > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gijsmolenaar at gmail.com Thu Oct 1 09:16:04 2015 From: gijsmolenaar at gmail.com (Gijs Molenaar) Date: Thu, 1 Oct 2015 15:16:04 +0200 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: Hi Kiko, I was looking into extensions, but wasn't sure if that was the right way to go. As far is I know for example bokeh is not an extension. Also as far as I know one needs to manually enable an extension to use them. Please correct me if i'm wrong. greetings, - Gijs 2015-10-01 15:08 GMT+02:00 Kiko : > > > 2015-10-01 14:45 GMT+02:00 Gijs Molenaar : > >> Hi all! I'm trying to embed JS9 into a notebook, but I'm not successful >> yet. I hope this is the right place to ask a question about this. JS9 is >> the javascript version of DS9, an astronomical image viewer: >> >> http://js9.si.edu/ >> >> You can find my initial work here: >> >> https://github.com/gijzelaerr/js9notebook >> >> I could not really find documentation on how to create such a thing. My >> idea was to create a python package which you can pip and load, just like >> bokeh works. I see multiple ways you can inject javascript into the >> browser from the python code, but I think using >> IPython.core.displaypub.publish_display_data is probably best. >> >> >> https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18 >> >> I was assuming reading the javascript file like this and then executing >> it with publish_display_data would be the same as loading it with a script >> tag, but I keep getting all kind of errors about objects not defined: >> >> >> https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb >> >> So basically I have two questions: >> >> * Is this the right way to do such a thing? I find it a bit hard to find >> out where the problems are, isn't it possible to serve the javascript >> somewhere static? >> * What am I doing wrong loading javascript this way? >> >> >> Greetings, >> > > Hi, > > Maybe the following links can help you to find the path: > > https://github.com/jdfreder/jupyter-pip > > https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter > > If you are successfull and you have time it would be great to document it. > > :-D > > >> -- >> Gijs Molenaar >> http://pythonic.nl >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Gijs Molenaar http://pythonic.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From kikocorreoso at gmail.com Thu Oct 1 09:37:44 2015 From: kikocorreoso at gmail.com (Kiko) Date: Thu, 1 Oct 2015 15:37:44 +0200 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: 2015-10-01 15:16 GMT+02:00 Gijs Molenaar : > Hi Kiko, > > one needs to manually enable an extension to use them > Like a library ;-) There are libraries that have a notebook mode. See, for instance, the approach made by this library: https://github.com/quantopian/qgrid#how-it-works -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.bollweg at gmail.com Thu Oct 1 13:57:39 2015 From: nick.bollweg at gmail.com (Nicholas Bollweg) Date: Thu, 01 Oct 2015 17:57:39 +0000 Subject: [IPython-dev] ANN: numtraits v0.2 In-Reply-To: References: Message-ID: To answer my own questions: NumericalTrait doesn't yet work with ipywidgets. But it probably could! We made an example that uses a passthrough traitlet: http://nbviewer.ipython.org/gist/anonymous/0358c8fee545f6ab5853 Everything works pretty well, with two sliders exposing the same value, automatically handling the translation. Nice! The javascript side is a bit ugly, as there isn't a ton of resources for potentially complex forms. As it is, quantities is the best option. It also looks like openmdao units would be possible, but it's all pretty baked in... perhaps this is an opportunity for entry_points? As an aside, we tried to put that gist up as a binder, but ran into some issues... i'll raise them appropriately! -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Oct 1 17:52:56 2015 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 1 Oct 2015 16:52:56 -0500 Subject: [IPython-dev] ANN: numtraits v0.2 In-Reply-To: References: Message-ID: On Thu, Oct 1, 2015 at 12:57 PM, Nicholas Bollweg wrote: > To answer my own questions: > NumericalTrait doesn't yet work with ipywidgets. But it probably could! > > We made an example that uses a passthrough traitlet: > http://nbviewer.ipython.org/gist/anonymous/0358c8fee545f6ab5853 > > Everything works pretty well, with two sliders exposing the same value, > automatically handling the translation. Nice! > > The javascript side is a bit ugly, as there isn't a ton of resources for > potentially complex forms. As it is, quantities > is the best option. > - NumPy Support: https://pint.readthedocs.org/en/0.6/numpy.html - Would [CSVW (csv2json, csv2rdf)] JSON-LD with e.g. QUDT be the most flexible option for working with javascript <> [python] data with Jupyter widgets? - CSVW: https://w3c.github.io/csvw/ - JSON-LD: http://json-ld.org/ - QUDT: http://lov.okfn.org/dataset/lov/vocabs/qudt > > It also looks like openmdao units would be possible, but it's all pretty > baked in... perhaps this is an opportunity for entry_points? > > As an aside, we tried to put that gist up as a binder, but ran into some > issues... i'll raise them appropriately! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Oct 1 17:55:08 2015 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 1 Oct 2015 16:55:08 -0500 Subject: [IPython-dev] ANN: numtraits v0.2 In-Reply-To: References: Message-ID: On Thu, Oct 1, 2015 at 12:57 PM, Nicholas Bollweg wrote: > To answer my own questions: > NumericalTrait doesn't yet work with ipywidgets. But it probably could! > - [ ] ENH: ipywidget support - [ ] ENH: _repr_json_, _repr_html_, _repr_latex_ https://github.com/jrjohansson/version_information/blob/master/version_information/version_information.py > > We made an example that uses a passthrough traitlet: > http://nbviewer.ipython.org/gist/anonymous/0358c8fee545f6ab5853 > > Everything works pretty well, with two sliders exposing the same value, > automatically handling the translation. Nice! > > The javascript side is a bit ugly, as there isn't a ton of resources for > potentially complex forms. As it is, quantities > is the best option. > > It also looks like openmdao units would be possible, but it's all pretty > baked in... perhaps this is an opportunity for entry_points? > > As an aside, we tried to put that gist up as a binder, but ran into some > issues... i'll raise them appropriately! > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gijsmolenaar at gmail.com Fri Oct 2 08:08:52 2015 From: gijsmolenaar at gmail.com (Gijs Molenaar) Date: Fri, 2 Oct 2015 14:08:52 +0200 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: Thanks for the answers! I'm still trying to get my head around this, but I still don't fully understand the advantage of having an extension. The only advantage I see is that you can serve static files that you copied from outside the webserver tree? Also, I would say having a Python module is more intuitive as an API than having magic functions installing files into your IPython configuration. But that is maybe preference. meanwhile I'm understanding my problems a bit better now. Basically publish_display_data pushes the javascript code to the browser where it is put into eval(). This works for most javascript code, but not for fabricjs. I posted a question about that on the fabric mailinglist: https://groups.google.com/forum/#!topic/fabricjs/W09fEtKopkk 2015-10-01 15:37 GMT+02:00 Kiko : > > > 2015-10-01 15:16 GMT+02:00 Gijs Molenaar : > >> Hi Kiko, >> >> one needs to manually enable an extension to use them >> > > Like a library ;-) > > There are libraries that have a notebook mode. > > See, for instance, the approach made by this library: > https://github.com/quantopian/qgrid#how-it-works > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Gijs Molenaar http://pythonic.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.bollweg at gmail.com Fri Oct 2 10:24:18 2015 From: nick.bollweg at gmail.com (Nicholas Bollweg) Date: Fri, 02 Oct 2015 14:24:18 +0000 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: Started a draft earlier, lost it. js9 looks very cool! I'd love to see it integrated! I would recommend doing an nbextension and wrapping your view in a widget, packaged up as a python module. Then you either have to tell the user to install the files to the magic location, or do it for them (as qgrid, with its nbinstall) based on something they do. Though they are not the same thing, the big advantage to nbextensions and widgets are: - widgets: interactive integration with all the other widget things: layouts, controls, etc. - Some Day being able to use your front end work with another kernel When integrating with the notebook front end from python "simply", a higher order pattern than publish_display_data is: *def show(data): display.display(Javascript("..**.data..."))* Every time you want to change something, you call show. If you want to have the frontend do something to the backend, you do something like *IPython.kernel.execute("something")* Eventually, you will end up reimplementing most of what widgets do. With widgets, *class SomeWidget(Widget): _view_module = Unicode ("nbextensions/extension/file"* *) _view_name = Unicode ("SomeView") Data = SomeTrait()* *x = SomeWidget() display.display(x) x.data = data* You can work with the widget instance as a normal python object... But it has a secret life up in the browser, and you don't have to worry about state, which is huge. Now your view/backend is part of the larger widget ecosystem, and other widgets can be linked to it without any additional integration work, and you're really pushing All that being said, this is not as easy as it could be. The issue arises from "the notebook" as the user perceives it, actually being: - the kernel: do compute - the server: provision compute, serve static assets - their code and data The single user, native kernel, local install experience has suffered somewhat from the needs of the distributed, multi-user, multi-kernel experience. In the case of javascript, the kernel doesn't even know it's running a notebook (could be running shell or qt... or whatever). So we're stuck right now with: - install your backend package into the kernel - install the extension into the server Here is an exhaustive issue describing some of the issues (with pictures!): https://github.com/jupyter/notebook/issues/116 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gijsmolenaar at gmail.com Fri Oct 2 10:29:11 2015 From: gijsmolenaar at gmail.com (Gijs Molenaar) Date: Fri, 2 Oct 2015 16:29:11 +0200 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: Hi Nicholas, Thanks for your answer! meanwhile I found out why pushing some javascript to the browser using publish_display_data doens't work. It is related to this issue: http://stackoverflow.com/questions/4670805/javascript-eval-on-global-scope When I load the javascript files using `$.globaleval()` I get everything to work. Not sure how to make that work with an IPython notebook though. 2015-10-02 16:24 GMT+02:00 Nicholas Bollweg : > Started a draft earlier, lost it. > > js9 looks very cool! I'd love to see it integrated! > > I would recommend doing an nbextension and wrapping your view in a widget, > packaged up as a python module. Then you either have to tell the user to > install the files to the magic location, or do it for them (as qgrid, with > its nbinstall) based on something they do. > > Though they are not the same thing, the big advantage to nbextensions and > widgets are: > > - widgets: interactive integration with all the other widget things: > layouts, controls, etc. > - Some Day being able to use your front end work with another kernel > > When integrating with the notebook front end from python "simply", a > higher order pattern than publish_display_data is: > > > *def show(data): display.display(Javascript("..**.data..."))* > > Every time you want to change something, you call show. If you want to > have the frontend do something to the backend, you do something like > > *IPython.kernel.execute("something")* > > Eventually, you will end up reimplementing most of what widgets do. > > With widgets, > > > *class SomeWidget(Widget): _view_module = Unicode > ("nbextensions/extension/file"* > > *) _view_name = Unicode ("SomeView") Data = SomeTrait()* > > > > *x = SomeWidget() display.display(x) x.data = data* > > You can work with the widget instance as a normal python object... But it > has a secret life up in the browser, and you don't have to worry about > state, which is huge. Now your view/backend is part of the larger widget > ecosystem, and other widgets can be linked to it without any additional > integration work, and you're really pushing > All that being said, this is not as easy as it could be. The issue arises > from "the notebook" as the user perceives it, actually being: > > - the kernel: do compute > - the server: provision compute, serve static assets > - their code and data > > The single user, native kernel, local install experience has suffered > somewhat from the needs of the distributed, multi-user, multi-kernel > experience. In the case of javascript, the kernel doesn't even know it's > running a notebook (could be running shell or qt... or whatever). > > So we're stuck right now with: > > - install your backend package into the kernel > - install the extension into the server > > Here is an exhaustive issue describing some of the issues (with pictures!): > https://github.com/jupyter/notebook/issues/116 > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -- Gijs Molenaar http://pythonic.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick.bollweg at gmail.com Fri Oct 2 17:29:50 2015 From: nick.bollweg at gmail.com (Nicholas Bollweg) Date: Fri, 02 Oct 2015 21:29:50 +0000 Subject: [IPython-dev] embedding js9 into a notebook In-Reply-To: References: Message-ID: You wouldn't want to eval yourself anyway... if you do it the notebook way with display(Javascript()), you'll have access to a lovely element variable, which is the cell output where you are right now. Looking a bit deeper, I see all the dependencies, both frontend and backend. Here's a notebook with my amateurish means of exploring the kinds of things that will fail: http://nbviewer.org/1259dd3bb7cef8988e92 It's going to be a pretty long road to make everything play nice, widget or no. But hopefully this helps. On Fri, Oct 2, 2015 at 10:29 AM Gijs Molenaar wrote: > Hi Nicholas, > > Thanks for your answer! > > meanwhile I found out why pushing some javascript to the browser using publish_display_data > doens't work. It is related to this issue: > > http://stackoverflow.com/questions/4670805/javascript-eval-on-global-scope > > When I load the javascript files using `$.globaleval()` I get everything > to work. Not sure how to make that work with an IPython notebook though. > > > 2015-10-02 16:24 GMT+02:00 Nicholas Bollweg : > >> Started a draft earlier, lost it. >> >> js9 looks very cool! I'd love to see it integrated! >> >> I would recommend doing an nbextension and wrapping your view in a >> widget, packaged up as a python module. Then you either have to tell the >> user to install the files to the magic location, or do it for them (as >> qgrid, with its nbinstall) based on something they do. >> >> Though they are not the same thing, the big advantage to nbextensions and >> widgets are: >> >> - widgets: interactive integration with all the other widget things: >> layouts, controls, etc. >> - Some Day being able to use your front end work with another kernel >> >> When integrating with the notebook front end from python "simply", a >> higher order pattern than publish_display_data is: >> >> >> *def show(data): display.display(Javascript("..**.data..."))* >> >> Every time you want to change something, you call show. If you want to >> have the frontend do something to the backend, you do something like >> >> *IPython.kernel.execute("something")* >> >> Eventually, you will end up reimplementing most of what widgets do. >> >> With widgets, >> >> >> *class SomeWidget(Widget): _view_module = Unicode >> ("nbextensions/extension/file"* >> >> *) _view_name = Unicode ("SomeView") Data = SomeTrait()* >> >> >> >> *x = SomeWidget() display.display(x) x.data = data* >> >> You can work with the widget instance as a normal python object... But it >> has a secret life up in the browser, and you don't have to worry about >> state, which is huge. Now your view/backend is part of the larger widget >> ecosystem, and other widgets can be linked to it without any additional >> integration work, and you're really pushing >> All that being said, this is not as easy as it could be. The issue arises >> from "the notebook" as the user perceives it, actually being: >> >> - the kernel: do compute >> - the server: provision compute, serve static assets >> - their code and data >> >> The single user, native kernel, local install experience has suffered >> somewhat from the needs of the distributed, multi-user, multi-kernel >> experience. In the case of javascript, the kernel doesn't even know it's >> running a notebook (could be running shell or qt... or whatever). >> >> So we're stuck right now with: >> >> - install your backend package into the kernel >> - install the extension into the server >> >> Here is an exhaustive issue describing some of the issues (with >> pictures!): >> https://github.com/jupyter/notebook/issues/116 >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> https://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > > > -- > Gijs Molenaar > http://pythonic.nl > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andresete.chaos at gmail.com Tue Oct 6 17:06:00 2015 From: andresete.chaos at gmail.com (=?UTF-8?Q?Omar_Andr=C3=A9s_Zapata_Mesa?=) Date: Tue, 6 Oct 2015 16:06:00 -0500 Subject: [IPython-dev] custom kernel with custom magics Message-ID: Hi Dears, I am writing my own kernel I am trying to create my own magics according to https://ipython.org/ipython-doc/dev/config/custommagics.html but into my kernel class the function get_ipython() is returning None. My questing is, is possible to get an ipython instance into my kernel class? Best Regards Omar. -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Wed Oct 7 05:30:19 2015 From: benjaminrk at gmail.com (MinRK) Date: Wed, 7 Oct 2015 11:30:19 +0200 Subject: [IPython-dev] custom kernel with custom magics In-Reply-To: References: Message-ID: On Tue, Oct 6, 2015 at 11:06 PM, Omar Andr?s Zapata Mesa < andresete.chaos at gmail.com> wrote: > Hi Dears, > > I am writing my own kernel I am trying to create my own magics according to > https://ipython.org/ipython-doc/dev/config/custommagics.html > > but into my kernel class the function get_ipython() is returning None. > > My questing is, is possible to get an ipython instance into my kernel > class? > You can instantiate an IPython InteractiveShell object, but perhaps what you really want is to be subclassing and extending the IPython kernel. -MinRK > > Best Regards > Omar. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Wed Oct 7 08:10:08 2015 From: benjaminrk at gmail.com (MinRK) Date: Wed, 7 Oct 2015 14:10:08 +0200 Subject: [IPython-dev] [ANN] ipykernel-4.1 Message-ID: We just released 4.1 of the IPython kernel package ipykernel. This has various bugfixes, but the highlight is the addition of the ipython kernel install entrypoint for installing the IPython kernelspec. This is accessible as python -m ipykernel install as well. docs We happen have several IPython and Jupyter packages close to release, so there will likely be a series of 4.1 and 4.0.x releases over the next few days/weeks. -MinRK ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Wed Oct 7 13:33:19 2015 From: wes.turner at gmail.com (Wes Turner) Date: Wed, 7 Oct 2015 12:33:19 -0500 Subject: [IPython-dev] [ANN] ipykernel-4.1 In-Reply-To: References: Message-ID: thanks! https://github.com/ipython/ipykernel/commits/master/ipykernel On Oct 7, 2015 7:10 AM, "MinRK" wrote: > We just released 4.1 of the IPython kernel package ipykernel. This has > various bugfixes, but the highlight is the addition of the ipython kernel > install entrypoint for installing the IPython kernelspec. This is > accessible as python -m ipykernel install as well. > > docs > > We happen have several IPython and Jupyter packages close to release, so > there will likely be a series of 4.1 and 4.0.x releases over the next few > days/weeks. > > -MinRK > ? > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From prabhu at aero.iitb.ac.in Fri Oct 16 07:46:40 2015 From: prabhu at aero.iitb.ac.in (Prabhu Ramachandran) Date: Fri, 16 Oct 2015 17:16:40 +0530 Subject: [IPython-dev] [ANN] SciPy India 2015: call for papers Message-ID: <5620E3A0.8020605@aero.iitb.ac.in> Hello, [Apologies for the cross-posting] The CFP and registration for SciPy India 2015 (http://scipy.in) is open. SciPy India 2015 will be held at IIT Bombay between December 14th to December 16th, 2015. Please spread the word! SciPy India is an annual conference on using Python for research and education. The conference is currently in its seventh year. Call for Papers ============= We look forward to your submissions on the use of Python for scientific computing and education. This includes pedagogy, exploration, modeling and analysis from both applied and developmental perspectives. We welcome contributions from academia as well as industry. For details on the paper submission please see here: http://scipy.in/2015/cfp/ Important Dates ================ - Call for proposals end: 24th November 2015 - List of accepted proposals will be published: 1st December 2015. We look forward to seeing you at SciPy India. Regards, Prabhu Ramachandran and Jarrod Millman From jakevdp at cs.washington.edu Fri Oct 16 17:49:38 2015 From: jakevdp at cs.washington.edu (Jacob Vanderplas) Date: Fri, 16 Oct 2015 14:49:38 -0700 Subject: [IPython-dev] Using pip within notebooks Message-ID: Hi folks, One quick question ? in previous IPython versions, I had often used ``!pip install`` commands from within the notebook to make sure packages are installed before importing them. I've noticed that in newer versions of the notebook this doesn't work ? the kernel and the shell are not necessarily in sync: it seems that pip is by default tied to the python version which ran ``jupyter notebook``, rather than the Python version running the kernel. Is there anything I can do to make pip work in the notebook again? Thanks! Jake -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Fri Oct 16 18:55:49 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Fri, 16 Oct 2015 15:55:49 -0700 Subject: [IPython-dev] Using pip within notebooks In-Reply-To: References: Message-ID: <1284523F-1BDF-4619-8034-7C1FFB5902D7@gmail.com> Hi Jake, > On Oct 16, 2015, at 14:49, Jacob Vanderplas wrote: > > Hi folks, > One quick question ? in previous IPython versions, I had often used ``!pip install`` commands from within the notebook to make sure packages are installed before importing them. I've noticed that in newer versions of the notebook this doesn't work ? the kernel and the shell are not necessarily in sync: it seems that pip is by default tied to the python version which ran ``jupyter notebook``, rather than the Python version running the kernel. > > Is there anything I can do to make pip work in the notebook again? Thanks! a quick way would be the following: ``` import sys !{sys.executable} -m pip ... ``` or make use of some magics: https://pypi.python.org/pypi/pip_magic (don?t even need the ! anymore, just import it :-) Won't work with conda though, unless you mess with the kernel spec to export PATH correctly to be in your envs, So that any shelling out use conda executables executables instead of systems ones. Kind of a manual ?source activate? step. I know that some people are working on Conda Kernels Launchers to automatize that. Happy Coding. -- M -------------- next part -------------- An HTML attachment was scrubbed... URL: From bn121rajesh at gmail.com Fri Oct 16 19:28:34 2015 From: bn121rajesh at gmail.com (Rajesh Bondugula) Date: Fri, 16 Oct 2015 16:28:34 -0700 Subject: [IPython-dev] linux command on ipython Message-ID: hi team, in unix / mac the following command will give me the files that are more than 100MB and are not accessed in last 2 days. size=100 days=2 for i in $(find . -size +$size"M" -atime +$days); do echo "file: " $i; done But the same command in ipython gives me error. !for i in $(find . -size +$size"M" -atime +$days); do echo "file: " $i; done *find: -size: +M: illegal numeric value.* some how it is unable to expand the $size and $days I want to use for loop and want to do in pure unix command with out python. Please let me know if there is an error in using it. Thanks Rajesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Fri Oct 16 20:09:11 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Fri, 16 Oct 2015 17:09:11 -0700 Subject: [IPython-dev] linux command on ipython In-Reply-To: References: Message-ID: <9C570256-249B-4B2E-8005-0860C623C53C@gmail.com> > On Oct 16, 2015, at 16:28, Rajesh Bondugula wrote: > > some how it is unable to expand the $size and $days yes, because it can?t expand $i it bails out and expand nothing. escape the $i with a second $. In [4]: !for i in $(find . -size +$size"M" -atime +$days); do echo "file: " $$i; done ^C KeyboardInterrupt -- M -------------- next part -------------- An HTML attachment was scrubbed... URL: From asmeurer at gmail.com Fri Oct 16 21:30:47 2015 From: asmeurer at gmail.com (Aaron S. Meurer) Date: Fri, 16 Oct 2015 20:30:47 -0500 Subject: [IPython-dev] Using pip within notebooks In-Reply-To: <1284523F-1BDF-4619-8034-7C1FFB5902D7@gmail.com> References: <1284523F-1BDF-4619-8034-7C1FFB5902D7@gmail.com> Message-ID: For conda you can use conda install -p {sys.prefix}. Aaron Meurer > On Oct 16, 2015, at 5:55 PM, Matthias Bussonnier wrote: > > Hi Jake, > >> On Oct 16, 2015, at 14:49, Jacob Vanderplas wrote: >> >> Hi folks, >> One quick question ? in previous IPython versions, I had often used ``!pip install`` commands from within the notebook to make sure packages are installed before importing them. I've noticed that in newer versions of the notebook this doesn't work ? the kernel and the shell are not necessarily in sync: it seems that pip is by default tied to the python version which ran ``jupyter notebook``, rather than the Python version running the kernel. >> >> Is there anything I can do to make pip work in the notebook again? Thanks! > > a quick way would be the following: > > ``` > import sys > !{sys.executable} -m pip ... > ``` > > or make use of some magics: > > https://pypi.python.org/pypi/pip_magic (don?t even need the ! anymore, just import it :-) > > > Won't work with conda though, unless you mess with the kernel spec to export PATH correctly to be in your envs, > So that any shelling out use conda executables executables instead of systems ones. Kind of a manual ?source activate? step. > I know that some people are working on Conda Kernels Launchers to automatize that. > > Happy Coding. > > -- > M > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From jakevdp at cs.washington.edu Fri Oct 16 22:08:53 2015 From: jakevdp at cs.washington.edu (Jacob Vanderplas) Date: Fri, 16 Oct 2015 19:08:53 -0700 Subject: [IPython-dev] Using pip within notebooks In-Reply-To: References: <1284523F-1BDF-4619-8034-7C1FFB5902D7@gmail.com> Message-ID: Thanks all! Jake Jake VanderPlas Senior Data Science Fellow Director of Research in Physical Sciences University of Washington eScience Institute On Fri, Oct 16, 2015 at 6:30 PM, Aaron S. Meurer wrote: > For conda you can use conda install -p {sys.prefix}. > > Aaron Meurer > > On Oct 16, 2015, at 5:55 PM, Matthias Bussonnier < > bussonniermatthias at gmail.com> wrote: > > Hi Jake, > > On Oct 16, 2015, at 14:49, Jacob Vanderplas > wrote: > > Hi folks, > One quick question ? in previous IPython versions, I had often used ``!pip > install`` commands from within the notebook to make sure packages are > installed before importing them. I've noticed that in newer versions of the > notebook this doesn't work ? the kernel and the shell are not necessarily > in sync: it seems that pip is by default tied to the python version which > ran ``jupyter notebook``, rather than the Python version running the kernel. > > Is there anything I can do to make pip work in the notebook again? Thanks! > > > a quick way would be the following: > > ``` > import sys > !{sys.executable} -m pip ... > ``` > > or make use of some magics: > > https://pypi.python.org/pypi/pip_magic (don?t even need the ! anymore, > just import it :-) > > > Won't work with conda though, unless you mess with the kernel spec to > export PATH correctly to be in your envs, > So that any shelling out use conda executables executables instead of > systems ones. Kind of a manual ?source activate? step. > I know that some people are working on Conda Kernels Launchers to > automatize that. > > Happy Coding. > > -- > M > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan12343 at gmail.com Sat Oct 17 13:52:43 2015 From: nathan12343 at gmail.com (Nathan Goldbaum) Date: Sat, 17 Oct 2015 10:52:43 -0700 Subject: [IPython-dev] Example of custom CSS styling with ipywidgets? Message-ID: Hi all, I'm trying to update a custom widget I made a while back (IPython 2.x days). I used some custom CSS to style the widget. I see nowadays we should be using the `_css` attribute of the widget to set custom CSS, but I don't see any examples of actually using this functionality anywhere. Does anyone have an example they can link me to? Could be a real custom widget or just a precanned example demonstrating this functionality. Thanks very much for your help! -Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan12343 at gmail.com Sat Oct 17 14:34:15 2015 From: nathan12343 at gmail.com (Nathan Goldbaum) Date: Sat, 17 Oct 2015 11:34:15 -0700 Subject: [IPython-dev] Example of custom CSS styling with ipywidgets? In-Reply-To: References: Message-ID: Hmm, so I think my confusion was arising from a bug (?) in ipywidgets. In any case, PR incoming. On Sat, Oct 17, 2015 at 10:52 AM, Nathan Goldbaum wrote: > Hi all, > > I'm trying to update a custom widget I made a while back (IPython 2.x > days). I used some custom CSS to style the widget. > > I see nowadays we should be using the `_css` attribute of the widget to > set custom CSS, but I don't see any examples of actually using this > functionality anywhere. > > Does anyone have an example they can link me to? Could be a real custom > widget or just a precanned example demonstrating this functionality. > > Thanks very much for your help! > > -Nathan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.freder at gmail.com Mon Oct 19 13:09:30 2015 From: jon.freder at gmail.com (Jonathan Frederic) Date: Mon, 19 Oct 2015 10:09:30 -0700 Subject: [IPython-dev] Example of custom CSS styling with ipywidgets? In-Reply-To: References: Message-ID: Hi Nathan, This indeed was caused by a bug which your PR (merged) fixed. This fix will be included in the upcoming 4.1 release of ipywidgets. We've discussed bringing back the css helper functions for ipywidgets 5.0, and I think we will bring back at least some variation of them (see https://github.com/ipython/ipywidgets/issues/121#issuecomment-147765524). Cheers, Jon On Sat, Oct 17, 2015 at 11:34 AM, Nathan Goldbaum wrote: > Hmm, so I think my confusion was arising from a bug (?) in ipywidgets. In > any case, PR incoming. > > On Sat, Oct 17, 2015 at 10:52 AM, Nathan Goldbaum > wrote: > >> Hi all, >> >> I'm trying to update a custom widget I made a while back (IPython 2.x >> days). I used some custom CSS to style the widget. >> >> I see nowadays we should be using the `_css` attribute of the widget to >> set custom CSS, but I don't see any examples of actually using this >> functionality anywhere. >> >> Does anyone have an example they can link me to? Could be a real custom >> widget or just a precanned example demonstrating this functionality. >> >> Thanks very much for your help! >> >> -Nathan >> > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chahe.Adourian at asc-csa.gc.ca Tue Oct 20 10:45:44 2015 From: Chahe.Adourian at asc-csa.gc.ca (Chahe.Adourian at asc-csa.gc.ca) Date: Tue, 20 Oct 2015 14:45:44 +0000 Subject: [IPython-dev] ipython memory usage problem Message-ID: Hi there, I am using ipyparallel to run some tests. Every time I call the function on the remote engines, the memory use of the engine is increasing. I have tried the following to clear the memory on the engines without success. 1) dview.execute('%reset') 2) dview.execute('%reset In') 3) dview.execute('%reset Out') 4) dview.execut('gc.collect') 5) I used a more forceful approach where all the variables are deleted, but that kills my remote link as well to the engine. The only solution so far is to stop the Engines and restart them again, but that's not my first choice. Anybody know what's going on? Why doesn't '%reset' cleanup properly? Thanks _____________________________________________ Chah? Adourian -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Wed Oct 21 09:41:17 2015 From: benjaminrk at gmail.com (MinRK) Date: Wed, 21 Oct 2015 14:41:17 +0100 Subject: [IPython-dev] ipython memory usage problem In-Reply-To: References: Message-ID: Can you provide a complete example and the Python version and OS you are using? On Tue, Oct 20, 2015 at 3:45 PM, wrote: > Hi there, > > > > I am using ipyparallel to run some tests. Every time I call the function > on the remote engines, the memory use of the engine is increasing. > > I have tried the following to clear the memory on the engines without > success. > > > > 1) dview.execute(?%reset?) > > 2) dview.execute(?%reset In?) > > 3) dview.execute(?%reset Out?) > > 4) dview.execut(?gc.collect?) > > 5) I used a more forceful approach where all the variables are > deleted, but that kills my remote link as well to the engine. > > > > The only solution so far is to stop the Engines and restart them again, > but that?s not my first choice. Anybody know what?s going on? Why doesn?t > ?%reset? cleanup properly? > > > > Thanks > > _____________________________________________ > > Chah? Adourian > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.quarendon at teamwpc.co.uk Thu Oct 22 11:50:55 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Thu, 22 Oct 2015 15:50:55 +0000 Subject: [IPython-dev] Multiple front ends connecting to same kernel Message-ID: If I connect multiple front ends to the same jupyter/ipython kernel, then having read the message docs I naively expected that everything I did on one would get mirrored on the other. So if I create a cell and run it on one front end, I naively expected that the other front end would display the executed cell text along with any output. However this doesn?t happen. Is this as expected? I rather assumed that the point of everything being sent out on the iopub socket was to make collaboration between front ends and sharing of kernels possible. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Thu Oct 22 12:53:55 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Thu, 22 Oct 2015 09:53:55 -0700 Subject: [IPython-dev] Multiple front ends connecting to same kernel In-Reply-To: References: Message-ID: <7F5DC3E7-88A9-4294-9B47-A00A981AFE18@gmail.com> Hi Tom, > On Oct 22, 2015, at 08:50, Tom Quarendon wrote: > > If I connect multiple front ends to the same jupyter/ipython kernel, then having read the message docs I naively expected that everything I did on one would get mirrored on the other. So if I create a cell and run it on one front end, I naively expected that the other front end would display the executed cell text along with any output. > However this doesn?t happen. > Is this as expected? I rather assumed that the point of everything being sent out on the iopub socket was to make collaboration between front ends and sharing of kernels possible. All the front-end do receive the broadcasted messages, the front-end can then decide what to do with these input/output. IIRC the ipython console will show other outputs that comes don?t originate from them, but not all client handle that. You might need to set --ZMQTerminalInteractiveShell.include_other_output=True on the command line arguments or configuration: In [7]: [remote] In [7]: "hey I'm remote" [remote] Out[7]: "hey I'm remote" In [7]: In the notebook in particular, what to do with other input/output is not obvious. Do you append it at the end ? Replace current cell ? Append just after current cells ? Just before ? Keep in mind that kernel is not aware it is run from a notebook in the case of a notebook, so there is work in progress to synchronize the state of multiple notebook, but this is independent from what the kernel broadcasts. Does that make sens ? -- M -------------- next part -------------- An HTML attachment was scrubbed... URL: From bn121rajesh at gmail.com Thu Oct 22 16:40:11 2015 From: bn121rajesh at gmail.com (Rajesh Bondugula) Date: Thu, 22 Oct 2015 13:40:11 -0700 Subject: [IPython-dev] sorting rows of data frame using sort_values Message-ID: hi, I have this data frame. 728 562 599 642 592 686 602 744 640 678 309 96 29 99 63 73 48 81 48 13 25 337 40 25 41 47 14 33 54 63 33 45 395 64 95 63 90 52 82 66 26 26 20 264 38 56 73 17 98 56 80 77 44 49 I want to sort it horizontally based on row index 264 I tried: df.sort_values(by=264, axis=1) I gives me: ValueError: When sorting by column, axis must be 0 (rows) What is the usecase with axis=1 Thanks Rajesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From zvoros at gmail.com Fri Oct 23 02:26:52 2015 From: zvoros at gmail.com (=?UTF-8?B?Wm9sdMOhbiBWw7Zyw7Zz?=) Date: Fri, 23 Oct 2015 08:26:52 +0200 Subject: [IPython-dev] sorting rows of data frame using sort_values In-Reply-To: References: Message-ID: <5629D32C.6030606@gmail.com> But this surely is a pandas issue, if anything at all, so why don't you post your question on the relevant mailing list? On 10/22/2015 10:40 PM, Rajesh Bondugula wrote: > hi, > > I have this data frame. > > 728 562 599 642 592 686 602 744 640 678 > 309 96 29 99 63 73 48 81 48 13 25 > 337 40 25 41 47 14 33 54 63 33 45 > 395 64 95 63 90 52 82 66 26 26 20 > 264 38 56 73 17 98 56 80 77 44 49 > > I want to sort it horizontally based on row index 264 > I tried: > df.sort_values(by=264, axis=1) > > I gives me: ValueError: When sorting by column, axis must be 0 (rows) > > What is the usecase with axis=1 > > Thanks > Rajesh > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > https://mail.scipy.org/mailman/listinfo/ipython-dev From tom.quarendon at teamwpc.co.uk Fri Oct 23 03:04:12 2015 From: tom.quarendon at teamwpc.co.uk (Tom Quarendon) Date: Fri, 23 Oct 2015 07:04:12 +0000 Subject: [IPython-dev] Multiple front ends connecting to same kernel In-Reply-To: <7F5DC3E7-88A9-4294-9B47-A00A981AFE18@gmail.com> References: <7F5DC3E7-88A9-4294-9B47-A00A981AFE18@gmail.com> Message-ID: OK, I understand. That option kind of works for the console case (the ANSI formatting characters get all messed up, but the output shows at least). I was assuming that I?d done something wrong in my kernel, not putting the right topic on the pub messages or something, but since I couldn?t get the behaviour to work anywhere I was then confused as to whether it was indeed supposed to work. Thanks for your help anyway. From: IPython-dev [mailto:ipython-dev-bounces at scipy.org] On Behalf Of Matthias Bussonnier Sent: 22 October 2015 17:54 To: IPython developers list Subject: Re: [IPython-dev] Multiple front ends connecting to same kernel Hi Tom, On Oct 22, 2015, at 08:50, Tom Quarendon > wrote: If I connect multiple front ends to the same jupyter/ipython kernel, then having read the message docs I naively expected that everything I did on one would get mirrored on the other. So if I create a cell and run it on one front end, I naively expected that the other front end would display the executed cell text along with any output. However this doesn?t happen. Is this as expected? I rather assumed that the point of everything being sent out on the iopub socket was to make collaboration between front ends and sharing of kernels possible. All the front-end do receive the broadcasted messages, the front-end can then decide what to do with these input/output. IIRC the ipython console will show other outputs that comes don?t originate from them, but not all client handle that. You might need to set --ZMQTerminalInteractiveShell.include_other_output=True on the command line arguments or configuration: In [7]: [remote] In [7]: "hey I'm remote" [remote] Out[7]: "hey I'm remote" In [7]: In the notebook in particular, what to do with other input/output is not obvious. Do you append it at the end ? Replace current cell ? Append just after current cells ? Just before ? Keep in mind that kernel is not aware it is run from a notebook in the case of a notebook, so there is work in progress to synchronize the state of multiple notebook, but this is independent from what the kernel broadcasts. Does that make sens ? -- M -------------- next part -------------- An HTML attachment was scrubbed... URL: From chahe.adourian at asc-csa.gc.ca Fri Oct 23 09:24:48 2015 From: chahe.adourian at asc-csa.gc.ca (cadourian) Date: Fri, 23 Oct 2015 06:24:48 -0700 (PDT) Subject: [IPython-dev] ipython memory usage problem In-Reply-To: References: Message-ID: <1445606688690-5174644.post@n6.nabble.com> Hi, providing a complete example of the exact code I use would not be possible but I will create a simple example and see if the problem still occurs. I will provide that once ready. Cheers -- View this message in context: http://python.6.x6.nabble.com/ipython-memory-usage-problem-tp5174336p5174644.html Sent from the IPython - Development mailing list archive at Nabble.com. From bussonniermatthias at gmail.com Fri Oct 23 12:31:17 2015 From: bussonniermatthias at gmail.com (Matthias Bussonnier) Date: Fri, 23 Oct 2015 09:31:17 -0700 Subject: [IPython-dev] Multiple front ends connecting to same kernel In-Reply-To: References: <7F5DC3E7-88A9-4294-9B47-A00A981AFE18@gmail.com> Message-ID: > On Oct 23, 2015, at 00:04, Tom Quarendon wrote: > > OK, I understand. > That option kind of works for the console case (the ANSI formatting characters get all messed up, but the output shows at least). > I was assuming that I?d done something wrong in my kernel, not putting the right topic on the pub messages or something, but since I couldn?t get the behaviour to work anywhere I was then confused as to whether it was indeed supposed to work. Well if the doc in nuclear on that part and you can propose some improvement we will be happy to do so. Feel free to ask more question on what kind of socket to use and where if you need help. Looking forward to see your kernel if it?s going to be public. You can also ask question on jupyter at googlegroups.com where you might have more kernels authors from other languages. -- M From chahe.adourian at asc-csa.gc.ca Fri Oct 23 14:21:39 2015 From: chahe.adourian at asc-csa.gc.ca (cadourian) Date: Fri, 23 Oct 2015 11:21:39 -0700 (PDT) Subject: [IPython-dev] ipython memory usage problem In-Reply-To: <1445606688690-5174644.post@n6.nabble.com> References: <1445606688690-5174644.post@n6.nabble.com> Message-ID: <1445624499566-5174675.post@n6.nabble.com> I could not provide an example that causes the problem cause the setup to run it would be too complicated however I think we should be able to make progress. I'll explain. I ran two examples. Both examples have the same pseudocode template ------------- Procedure A: ------------- a) Clear the memory on the engines using the following commands securityFile = r'%s\EngineConfig\profile_default\security\ipcontroller-client.json' % projectRoot rc = Client(securityFile) idSubset = rc.ids dview = rc[idSubset] dview.execute('%reset') dview.execute('import gc') dview.execute('gc.collect()') b) Measure memory usage on each cluster engine c) call a function x using dview.map_sync(x, ....) d) Measure memory usage on each cluster engine #1) memory usage on engines does not increase when Procedure A is called multiple times. In this case, the function x used in dview.map_sync(x, ....) allocates an array with numpy and returns it #2) In this case, memory increases when Procedure A is called multiple times. The difference is that function x used in dview.map_sync(x, ....) loads DLLs and executes loaded functions. What I don't understand is that I'm calling a function (x) which is obviously causing the problems. But, I would have expected that when the function call returned, any objects created within would be destroyed. Moreover, I purposefully called garbage collect to eliminate any remaining objects before measuring memory usage. The question is whether IPython handles functions a little differently than Python? Any suggestions appreciated. -- View this message in context: http://python.6.x6.nabble.com/ipython-memory-usage-problem-tp5174336p5174675.html Sent from the IPython - Development mailing list archive at Nabble.com.