From tomspur at fedoraproject.org Thu Mar 1 09:34:02 2012 From: tomspur at fedoraproject.org (Thomas Spura) Date: Thu, 1 Mar 2012 15:34:02 +0100 Subject: [IPython-dev] Introduction to Contributing workshop (Python Sheffield) In-Reply-To: References: Message-ID: On Wed, Feb 29, 2012 at 1:32 PM, Thomas Kluyver wrote: > * The pair working with the Qt console had some difficulty getting the > dependencies installed. One had an older version of Ubuntu without the > necessary ZMQ, the other had Fedora, where I wasn't sure what the relevant > packages were called. They worked it out themselves after a while. "yum install ipython ipython-gui" should do the major work, only python-tornado should be missing then to be able to run the notebook. When you want to provide basic instructions in the docs somewhere, let me know. I can help with documenting it then. (or maybe that's one of the new contributions anyway? ;)) $ repoquery --requires ipython ipython-gui pexpect pyparsing python-matplotlib python-mglob python-simplegeneric python-tornado python-zmq PyQt4 python-pygments Greetings, Tom From fperez.net at gmail.com Thu Mar 1 10:57:09 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 1 Mar 2012 07:57:09 -0800 Subject: [IPython-dev] Introduction to Contributing workshop (Python Sheffield) In-Reply-To: References: Message-ID: On Thu, Mar 1, 2012 at 6:34 AM, Thomas Spura wrote: > "yum install ipython ipython-gui" should do the major work, only > python-tornado should be missing then to be able to run the notebook. But if python-tornado is listed in the command you put there, wouldn't it be automatically installed? Cheers, f From fperez.net at gmail.com Thu Mar 1 13:50:52 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 1 Mar 2012 10:50:52 -0800 Subject: [IPython-dev] PyData hack night in Santa Clara, CA, tomorrow Friday Message-ID: Brian, Min and I will be attending the pydata hack night in Santa Clara tomorrow night. We'll be hacking on matplotlib, ipython, pandas, numpy and more. If you are interested in stopping by, there is space for 200, many more than the number of attendees at pydata. The event info is here: http://python-data-hack-night.eventbrite.com/ Here is the description from the event: The Python Data Workshop just got bigger! We are thrilled to announce that Ground Floor Silicon Valley is generously opening up their coworking space and hosting a Friday night Python Data Hack Night for all attendees of the Workshop and any others who want to geek out on Python, data analysis, and scientific computing! Spend a fun evening eating, drinking, coding, and talking shop with the instructors and participants of the Workshop. This includes the authors of Numpy, Scipy, IPython, Matplotlib, PyTables, Pandas, and many other great Python packages. Ground Floor has room for up to 200 folks, so if you are on the wait list for the full Workshop, this is your chance to participate in the workshop! We are making tickets available to all those who registered for the Python Data Workshop (attendees and wait list), before publicizing the event more widely, so sign up now! The event runs from 6pm until Midnight. We are looking for sponsors to cover food and drinks, but we do expect to have those there. For sponsorship details, contact lynnbender at geekaustin.org Ground Floor SV 2030 Duane Avenue Santa Clara, CA 95054 Friday, March 2, 2012 from 6:00 PM to 11:55 PM (PT) Cheers, f From yogeshiiith at gmail.com Fri Mar 2 02:13:23 2012 From: yogeshiiith at gmail.com (Yogesh Agrawal) Date: Fri, 2 Mar 2012 12:43:23 +0530 Subject: [IPython-dev] GSOC 2012 Message-ID: Respected Sir, I am very much interested in doing project in the development of emerging IPython. I also participated in the FOSSEE workshop held at ISB Hyderabad, INDIA in December 2010. In the workshop I tried to solve issues related to IPython command line, but i could not make up due to lack of time. I use IPython to solve my problem regularly, and I am familiar with it. Sir, please provide me some opportunity to work upon some project involving IPython through GSOC 2012 I am interested in doing project from the one mentioned in Potential Project Page "Writing a history browser". Please tell me how to proceed further. Regards, Yogesh Agrawal Computer Science Department, 3rd year International Institute Of Information Technology - Hyderabad INDIA -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomspur at fedoraproject.org Fri Mar 2 11:25:13 2012 From: tomspur at fedoraproject.org (Thomas Spura) Date: Fri, 2 Mar 2012 17:25:13 +0100 Subject: [IPython-dev] Introduction to Contributing workshop (Python Sheffield) In-Reply-To: References: Message-ID: On Thu, Mar 1, 2012 at 4:57 PM, Fernando Perez wrote: > On Thu, Mar 1, 2012 at 6:34 AM, Thomas Spura wrote: >> "yum install ipython ipython-gui" should do the major work, only >> python-tornado should be missing then to be able to run the notebook. > > But if python-tornado is listed in the command you put there, wouldn't > it be automatically installed? Yes. On a new Fedora python-tornado is listed as dependency of ipython anyway, so it's installed automatically even when not mentioned explicitly in the command above :) When you want to be sure, that it works on any version it would probably be: "yum install ipython ipython-gui python-tornado" and you can right start to work with the ./ipython.py in the git repository. Greetings, Tom From takowl at gmail.com Mon Mar 5 06:17:06 2012 From: takowl at gmail.com (Thomas Kluyver) Date: Mon, 5 Mar 2012 11:17:06 +0000 Subject: [IPython-dev] GSOC 2012 In-Reply-To: References: Message-ID: Hi Yogesh, Thanks for your interest. Unfortunately, the core developers have decided that we can't commit the time required to mentor someone through a GSOC project this year. Of course, you're very welcome to contribute to IPython informally. I'm sure other scientific Python projects will be taking part in GSOC, so do see if there's a project you're interested in. Best wishes, Thomas On 2 March 2012 07:13, Yogesh Agrawal wrote: > Respected Sir, > > I am very much interested in doing project in the development of emerging > IPython. > I also participated in the FOSSEE workshop held at ISB Hyderabad, INDIA in > December 2010. In the workshop I tried to solve issues related to IPython > command line, but i could not make up due to lack of time. > I use IPython to solve my problem regularly, and I am familiar with it. > Sir, please provide me some opportunity to work upon some project > involving IPython through GSOC 2012 > > I am interested in doing project from the one mentioned in Potential > Project Page "Writing a history browser". > Please tell me how to proceed further. > > > Regards, > Yogesh Agrawal > Computer Science Department, 3rd year > International Institute Of Information Technology - Hyderabad > INDIA > > _______________________________________________ > 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 habretschneider at gmail.com Tue Mar 6 12:08:29 2012 From: habretschneider at gmail.com (Hannes Bretschneider) Date: Tue, 6 Mar 2012 12:08:29 -0500 Subject: [IPython-dev] Failing to start qtconsole Message-ID: Hi everybody, I'm getting the following exception when I try to start the qtconsole: > Traceback (most recent call last): > File "/home/hannes/usr/python2.7/bin/ipython", line 7, in > launch_new_instance() > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 405, in launch_new_instance > app.initialize() > File "", line 2, in initialize > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error > return method(app, *args, **kwargs) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 305, in initialize > super(TerminalIPythonApp, self).initialize(argv) > File "", line 2, in initialize > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error > return method(app, *args, **kwargs) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/core/application.py", line 325, in initialize > self.parse_command_line(argv) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 300, in parse_command_line > return super(TerminalIPythonApp, self).parse_command_line(argv) > File "", line 2, in parse_command_line > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error > return method(app, *args, **kwargs) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 413, in parse_command_line > return self.initialize_subcommand(subc, subargv) > File "", line 2, in initialize_subcommand > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error > return method(app, *args, **kwargs) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 356, in initialize_subcommand > self.subapp.initialize(argv) > File "", line 2, in initialize > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error > return method(app, *args, **kwargs) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/qt/console/qtconsoleapp.py", line 332, in initialize > IPythonConsoleApp.initialize(self,argv) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/consoleapp.py", line 351, in initialize > self.init_kernel_manager() > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/consoleapp.py", line 340, in init_kernel_manager > self.kernel_manager.start_channels() > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py", line 215, in start_channels > super(QtKernelManager, self).start_channels(*args, **kw) > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py", line 667, in start_channels > self.shell_channel.start() > File "/home/hannes/usr/python2.7/lib/python2.7/site-packages/IPython/frontend/qt/kernelmanager.py", line 230, in shell_channel > self._shell_channel.first_reply.connect(self._first_reply) > TypeError: pyqtSignal must be bound to a QObject, not 'QtShellSocketChannel' > > If you suspect this is an IPython bug, please report it at: > https://github.com/ipython/ipython/issues > or send an email to the mailing list at ipython-dev at scipy.org (mailto:ipython-dev at scipy.org) > > You can print a more detailed traceback right now with "%tb", or use "%debug" > to interactively debug it. > > Extra-detailed tracebacks for bug-reporting purposes can be enabled via: > c.Application.verbose_crash=True > > hannes@~: [IPKernelApp] To connect another client to this kernel, use: > [IPKernelApp] --existing kernel-25372.json I use PyQt 4.9.1 (installed from source), with the Qt4 headers available through apt-get in Ubuntu 11.10. I'd appreciate some guidance what went wrong. Thanks, Hannes -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Wed Mar 7 03:55:20 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 7 Mar 2012 00:55:20 -0800 Subject: [IPython-dev] We got a last-minute slot for a talk at PyCon Message-ID: Hi all, I was contacted today by the PyCon organizers, and after a last minute cancellation, we were offered a slot to present a talk at PyCon: https://us.pycon.org/2012/schedule/presentation/339/ So if you are registered to attend PyCon but not our full-length tutorial on Wednesday, come over to the talk on Friday at 2pm (Track I - D5)! Cheers, f From mark.voorhies at ucsf.edu Wed Mar 7 14:15:20 2012 From: mark.voorhies at ucsf.edu (Mark Voorhies) Date: Wed, 7 Mar 2012 11:15:20 -0800 Subject: [IPython-dev] Fingerprint for OpenSSH public key In-Reply-To: References: Message-ID: <201203071115.20804.mark.voorhies@ucsf.edu> In case anyone else is approving their public keys on github, here's how to get the hex fingerprint from a keyfile: ssh-keygen -f keyfile.pub -l --Mark From warren.weckesser at enthought.com Wed Mar 7 15:23:04 2012 From: warren.weckesser at enthought.com (Warren Weckesser) Date: Wed, 7 Mar 2012 14:23:04 -0600 Subject: [IPython-dev] Fingerprint for OpenSSH public key In-Reply-To: <201203071115.20804.mark.voorhies@ucsf.edu> References: <201203071115.20804.mark.voorhies@ucsf.edu> Message-ID: On Wed, Mar 7, 2012 at 1:15 PM, Mark Voorhies wrote: > In case anyone else is approving their public keys on github, > here's how to get the hex fingerprint from a keyfile: > > ssh-keygen -f keyfile.pub -l > --Mark > > Thanks! Warren -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Thu Mar 8 17:06:35 2012 From: takowl at gmail.com (Thomas Kluyver) Date: Thu, 8 Mar 2012 22:06:35 +0000 Subject: [IPython-dev] Windows test failures Message-ID: For any Windows users looking to contribute to IPython, the latest test results have just arrived, and there's half a dozen tests failing: https://jenkins.shiningpanda.com/ipython/job/ipython-windows-py27/3/ We know what's causing at least a couple of them - have a look at these issues: https://github.com/ipython/ipython/issues/1479 https://github.com/ipython/ipython/issues/1428 Get stuck in, and feel free to ask on the ipython-dev list or on IRC if you have any questions. Hopefully we can turn that light blue quickly. Thanks, Thomas ---------- Forwarded message ---------- From: Date: 8 March 2012 20:26 Subject: Jenkins build is still unstable: ipython-windows-py27 #3 To: takowl at gmail.com See -------------- next part -------------- An HTML attachment was scrubbed... URL: From cekees at gmail.com Thu Mar 8 22:11:21 2012 From: cekees at gmail.com (Chris Kees) Date: Thu, 8 Mar 2012 21:11:21 -0600 Subject: [IPython-dev] mathjax warning about default configuration Message-ID: Hi, I'm running a notebook configuration with c.NotebookApp.mathjax_url = u' https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=default ' Apparently that's what I need that to make sure the site is fully secure. I'm getting the "popup" warning below now. That math looks fine, but I can't seem to get the warning to go away by switching the ?config=default part to try various configurations from mathjax site. Anybody know what's going on? Thanks, Chris MathJax no longer loads a default configuration file; you must specify such files explicitly. This page seems to use the older default config/MathJax.js file, and so needs to be updated. This is explained further at http://www.mathjax.org/help/configuration -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Fri Mar 9 00:13:05 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 8 Mar 2012 21:13:05 -0800 Subject: [IPython-dev] mathjax warning about default configuration In-Reply-To: References: Message-ID: Chris, If you are running the notebook in secure mode, I highly recommend installing MathJax locally by doing: from IPython.external.mathjax import install_mathjax install_mathjax() I don't know if MathJax latest (2.0) works with the notebook yet, so maybe using the CDN latest version needs a bit more testing. But the config option we are using is this one: config=TeX-AMS_HTML Cheers, Brian On Thu, Mar 8, 2012 at 7:11 PM, Chris Kees wrote: > Hi, > > I'm running a notebook configuration with > > c.NotebookApp.mathjax_url = > u'https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=default' > > Apparently that's what I need that to make sure the site is fully secure. > I'm getting the "popup" warning below now. That math looks fine, but I can't > seem to get the warning to go away by switching the??config=default part to > try various configurations from mathjax site. Anybody know what's going on? > > Thanks, > Chris > > MathJax no longer loads a default configuration file; you must specify such > files explicitly. This page seems to use the older > default?config/MathJax.js?file, and so needs to be updated. This is > explained further at > > http://www.mathjax.org/help/configuration > > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From cekees at gmail.com Sat Mar 10 01:56:07 2012 From: cekees at gmail.com (Chris Kees) Date: Sat, 10 Mar 2012 00:56:07 -0600 Subject: [IPython-dev] mathjax warning about default configuration In-Reply-To: References: Message-ID: Brian, The problem turned out to be fairly simple. I had stored the url and config setting in c.NotebookApp.mathjax_url instead of just the url. The notebook template appends ?config=TeX-AMS_HTML to the base URL. Anyway, the CDN latest version looks like its working fine for me. I will try the local install of MathJax on the server though. Chris On Thu, Mar 8, 2012 at 11:13 PM, Brian Granger wrote: > Chris, > > If you are running the notebook in secure mode, I highly recommend > installing MathJax locally by doing: > > from IPython.external.mathjax import install_mathjax > install_mathjax() > > I don't know if MathJax latest (2.0) works with the notebook yet, so > maybe using the CDN latest version needs a bit more testing. But the > config option we are using is this one: > > config=TeX-AMS_HTML > > Cheers, > > Brian > > On Thu, Mar 8, 2012 at 7:11 PM, Chris Kees wrote: > > Hi, > > > > I'm running a notebook configuration with > > > > c.NotebookApp.mathjax_url = > > u' > https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=default > ' > > > > Apparently that's what I need that to make sure the site is fully secure. > > I'm getting the "popup" warning below now. That math looks fine, but I > can't > > seem to get the warning to go away by switching the ?config=default part > to > > try various configurations from mathjax site. Anybody know what's going > on? > > > > Thanks, > > Chris > > > > MathJax no longer loads a default configuration file; you must specify > such > > files explicitly. This page seems to use the older > > default config/MathJax.js file, and so needs to be updated. This is > > explained further at > > > > http://www.mathjax.org/help/configuration > > > > > > _______________________________________________ > > 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 > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From satra at mit.edu Sat Mar 10 12:54:56 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 10 Mar 2012 12:54:56 -0500 Subject: [IPython-dev] load_balanced_view Message-ID: hi all, i'm calling load_balanced_view as: result_object = self.taskclient.load_balanced_view().apply(execute_task, node, updatehash) i need to execute a piece of code on the remote engine before the 'node' get's unpickled. is there a way to do that? (i basically need to set the output log directory and unpickling the node initializes the logger) cheers, satra -------------- next part -------------- An HTML attachment was scrubbed... URL: From satra at mit.edu Sat Mar 10 19:52:48 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 10 Mar 2012 19:52:48 -0500 Subject: [IPython-dev] load_balanced_view In-Reply-To: References: Message-ID: here is one solution i'm using. let me know if there is a more elegant way the culprit was node, so instead of sending it directly, i pickled it and sent it. and unpickled it inside the function after i had done any of the configuring that i needed to do. cheers, satra On Sat, Mar 10, 2012 at 12:54 PM, Satrajit Ghosh wrote: > hi all, > > i'm calling load_balanced_view as: > > result_object = self.taskclient.load_balanced_view().apply(execute_task, > node, updatehash) > > i need to execute a piece of code on the remote engine before the 'node' > get's unpickled. is there a way to do that? (i basically need to set the > output log directory and unpickling the node initializes the logger) > > cheers, > > satra > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Sun Mar 11 11:43:42 2012 From: takowl at gmail.com (Thomas Kluyver) Date: Sun, 11 Mar 2012 15:43:42 +0000 Subject: [IPython-dev] IdleX adds IPython support Message-ID: It appears we have another frontend for the IPython kernel: http://idlex.sourceforge.net/ipython.html I think that makes five frontends now, two of them developed outside the IPython project (this one and Microsoft's Python Tools for Visual Studio). I've added it to the list of projects using IPython on the wiki. Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Sun Mar 11 13:52:17 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 11 Mar 2012 10:52:17 -0700 Subject: [IPython-dev] IdleX adds IPython support In-Reply-To: References: Message-ID: On Sun, Mar 11, 2012 at 8:43 AM, Thomas Kluyver wrote: > It appears we have another frontend for the IPython kernel: > http://idlex.sourceforge.net/ipython.html Great! > I think that makes five frontends now, two of them developed outside the > IPython project (this one and Microsoft's Python Tools for Visual Studio). Well, there's also Paul's vim plugin, which is rather specialized but also a kind of frontend. I regret failing to mention it during my talk at pycon. All went well on that front, report coming soon. > I've added it to the list of projects using IPython on the wiki. Thanks! f From satra at mit.edu Sun Mar 11 13:56:39 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sun, 11 Mar 2012 13:56:39 -0400 Subject: [IPython-dev] IdleX adds IPython support In-Reply-To: References: Message-ID: i would also add pycharm having support for 0.12. again i don't know the full extent of support, but i can pull up an ipython 0.12 console from within pycharm. cheers, satra On Sun, Mar 11, 2012 at 1:52 PM, Fernando Perez wrote: > On Sun, Mar 11, 2012 at 8:43 AM, Thomas Kluyver wrote: > > It appears we have another frontend for the IPython kernel: > > http://idlex.sourceforge.net/ipython.html > > Great! > > > I think that makes five frontends now, two of them developed outside the > > IPython project (this one and Microsoft's Python Tools for Visual > Studio). > > Well, there's also Paul's vim plugin, which is rather specialized but > also a kind of frontend. I regret failing to mention it during my > talk at pycon. > > All went well on that front, report coming soon. > > > I've added it to the list of projects using IPython on the wiki. > > Thanks! > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsdale24 at gmail.com Mon Mar 12 11:15:35 2012 From: dsdale24 at gmail.com (Darren Dale) Date: Mon, 12 Mar 2012 11:15:35 -0400 Subject: [IPython-dev] Question about custom completer behavior: terminal vs qt app Message-ID: Hi All, I maintain a custom completer for the h5py project. The h5py objects have a dict-like interface, and the completer supports the following: In [1]: import h5py In [2]: f=h5py.File('foo.h5') In [3]: f[' 1 In [3]: f['1']. f['1'].attrs f['1'].items f['1'].ref f['1'].copy f['1'].iteritems f['1'].require_dataset f['1'].create_dataset f['1'].iterkeys f['1'].require_group f['1'].create_group f['1'].itervalues f['1'].values f['1'].file f['1'].keys f['1'].visit f['1'].get f['1'].name f['1'].visititems f['1'].id f['1'].parent If I try to do the same with ipython-qtconsole, tab completion works for the keys, but the attribute completer does not yield a list of attributes. The attribute completer acts like there are no possible matches, even the h5py_attr_completer is returning the following list: [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset", u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id", u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys", u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name", u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset", u"f['1'].require_group", u"f['1'].values", u"f['1'].visit", u"f['1'].visititems"] [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset", u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id", u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys", u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name", u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset", u"f['1'].require_group", u"f['1'].values", u"f['1'].visit", u"f['1'].visititems"] I guess my question is, is this a bug, or do I need to take a different approach? Thanks, Darren From dsdale24 at gmail.com Mon Mar 12 11:19:49 2012 From: dsdale24 at gmail.com (Darren Dale) Date: Mon, 12 Mar 2012 11:19:49 -0400 Subject: [IPython-dev] Question about custom completer behavior: terminal vs qt app In-Reply-To: References: Message-ID: Sorry, here is the attachment. On Mon, Mar 12, 2012 at 11:15 AM, Darren Dale wrote: > Hi All, > > I maintain a custom completer for the h5py project. The h5py objects > have a dict-like interface, and the completer supports the following: > > In ?[1]: import h5py > In ?[2]: f=h5py.File('foo.h5') > In ?[3]: f[' > 1 > In ?[3]: f['1']. > f['1'].attrs ? ? ? ? ? ?f['1'].items ? ? ? ? ? ?f['1'].ref > f['1'].copy ? ? ? ? ? ? f['1'].iteritems ? ? ? ?f['1'].require_dataset > f['1'].create_dataset ? f['1'].iterkeys ? ? ? ? f['1'].require_group > f['1'].create_group ? ? f['1'].itervalues ? ? ? f['1'].values > f['1'].file ? ? ? ? ? ? f['1'].keys ? ? ? ? ? ? f['1'].visit > f['1'].get ? ? ? ? ? ? ?f['1'].name ? ? ? ? ? ? f['1'].visititems > f['1'].id ? ? ? ? ? ? ? f['1'].parent > > > If I try to do the same with ipython-qtconsole, tab completion works > for the keys, but the attribute completer does not yield a list of > attributes. The attribute completer acts like there are no possible > matches, even the h5py_attr_completer is returning the following list: > > [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset", > u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id", > u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys", > u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name", > u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset", > u"f['1'].require_group", u"f['1'].values", u"f['1'].visit", > u"f['1'].visititems"] > [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset", > u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id", > u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys", > u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name", > u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset", > u"f['1'].require_group", u"f['1'].values", u"f['1'].visit", > u"f['1'].visititems"] > > I guess my question is, is this a bug, or do I need to take a > different approach? > > Thanks, > Darren -------------- next part -------------- A non-text attachment was scrubbed... Name: ipy_completer.py Type: application/octet-stream Size: 4059 bytes Desc: not available URL: From fawce at quantopian.com Thu Mar 15 12:41:00 2012 From: fawce at quantopian.com (fawce) Date: Thu, 15 Mar 2012 12:41:00 -0400 Subject: [IPython-dev] feature request Message-ID: Hi, In v 0.13.dev (as installed about two weeks ago), I've been making heavy use of the method signature help. There are these three controls (tack to bottom, expand, close). I find myself using the first two a ton, and I was wondering if there could be keyboard shortcuts for those. Since the controls look like characters, maybe ctrl-m ^ to tack, and ctrl-m + to expand? Should requests such as these be logged via github instead? Sorry if this is inadvertent spam. thanks, fawce From ellisonbg at gmail.com Thu Mar 15 12:45:26 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 15 Mar 2012 09:45:26 -0700 Subject: [IPython-dev] feature request In-Reply-To: References: Message-ID: John, On Thu, Mar 15, 2012 at 9:41 AM, fawce wrote: > Hi, > > In v 0.13.dev (as installed about two weeks ago), I've been making heavy use of the method signature help. There are these three controls ?(tack to bottom, expand, close). I find myself using the first two a ton, and I was wondering if there could be keyboard shortcuts for those. Since the controls look like characters, maybe ctrl-m ^ to tack, and ctrl-m + to expand? You mean the tooltip window that pops up in the Notebook? Can you file a github issue for this? > Should requests such as these be logged via github instead? Sorry if this is inadvertent spam. No problem, we often bring things up on list first. Thanks, Brian > thanks, > fawce > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From fawce at quantopian.com Thu Mar 15 12:50:27 2012 From: fawce at quantopian.com (fawce) Date: Thu, 15 Mar 2012 12:50:27 -0400 Subject: [IPython-dev] feature request In-Reply-To: References: Message-ID: <61A23AFD-15F7-44FF-B1D7-E4EDD9472158@quantopian.com> On Mar 15, 2012, at 12:45 PM, Brian Granger wrote: > John, > > On Thu, Mar 15, 2012 at 9:41 AM, fawce wrote: >> Hi, >> >> In v 0.13.dev (as installed about two weeks ago), I've been making heavy use of the method signature help. There are these three controls (tack to bottom, expand, close). I find myself using the first two a ton, and I was wondering if there could be keyboard shortcuts for those. Since the controls look like characters, maybe ctrl-m ^ to tack, and ctrl-m + to expand? > > You mean the tooltip window that pops up in the Notebook? Can you > file a github issue for this? Yes, that's what I mean. I just put the ticket in github. From ellisonbg at gmail.com Thu Mar 15 12:56:03 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Thu, 15 Mar 2012 09:56:03 -0700 Subject: [IPython-dev] feature request In-Reply-To: <61A23AFD-15F7-44FF-B1D7-E4EDD9472158@quantopian.com> References: <61A23AFD-15F7-44FF-B1D7-E4EDD9472158@quantopian.com> Message-ID: Thanks! On Thu, Mar 15, 2012 at 9:50 AM, fawce wrote: > > On Mar 15, 2012, at 12:45 PM, Brian Granger wrote: > >> John, >> >> On Thu, Mar 15, 2012 at 9:41 AM, fawce wrote: >>> Hi, >>> >>> In v 0.13.dev (as installed about two weeks ago), I've been making heavy use of the method signature help. There are these three controls ?(tack to bottom, expand, close). I find myself using the first two a ton, and I was wondering if there could be keyboard shortcuts for those. Since the controls look like characters, maybe ctrl-m ^ to tack, and ctrl-m + to expand? >> >> You mean the tooltip window that pops up in the Notebook? ?Can you >> file a github issue for this? > > Yes, that's what I mean. I just put the ticket in github. > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From hugo at continuum.io Mon Mar 19 08:13:23 2012 From: hugo at continuum.io (hugo) Date: Mon, 19 Mar 2012 08:13:23 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F6722B5.8040909@continuum.io> References: <4F6722B5.8040909@continuum.io> Message-ID: <4F6722E3.8020109@continuum.io> Thought you might be interested in something I've experimented with over the past few days. https://github.com/hhuuggoo/pushd3/blob/master/demopush.ogv I wanted to see how well this concept would work, I set up remote execution of code in the browser by creating an RPC interface around zeromq messages which get forwarded into websockets, and then I forwarded d3 and jquery operations to the browser. It works fine if your arguments are all json serializable, however d3 is heavily reliant on passing callbacks, and I don't have a good way to do that. Anyways, here it is. This is separate from the ipython notebook, I have a separate gevent based zeromq web socket forwarder that I've also been playing around with which I am using here. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fawce at quantopian.com Mon Mar 19 09:22:42 2012 From: fawce at quantopian.com (fawce) Date: Mon, 19 Mar 2012 09:22:42 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F6722E3.8020109@continuum.io> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> Message-ID: holy mackerel that's awesome! Can you elaborate on the callback issue? Wondering why you can't pass in a callback that just makes a ws call internally. On Mar 19, 2012, at 8:13 AM, hugo wrote: > > Thought you might be interested in something I've experimented with over the past few days. > > https://github.com/hhuuggoo/pushd3/blob/master/demopush.ogv > > I wanted to see how well this concept would work, I set up remote execution of code in the browser by creating an RPC interface around zeromq messages which get forwarded into websockets, and then I forwarded d3 and jquery operations to the browser. It works fine if your arguments are all json serializable, however d3 is heavily reliant on passing callbacks, and I don't have a good way to do that. > > Anyways, here it is. This is separate from the ipython notebook, I have a separate gevent based zeromq web socket forwarder that I've also been playing around with which I am using here. > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > 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 hugo at continuum.io Mon Mar 19 09:32:44 2012 From: hugo at continuum.io (hugo) Date: Mon, 19 Mar 2012 09:32:44 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> Message-ID: <4F67357C.8030501@continuum.io> On 03/19/2012 09:22 AM, fawce wrote: > holy mackerel that's awesome! > > Can you elaborate on the callback issue? Wondering why you can't pass > in a callback that just makes a ws call internally. just that I serialize function names and the args they are called with via JSON so for d3, the normal way you would position points in a scatter plot is something like this d3.selectAll('circle').attr('cx', function(d){return axis(d['x'])}); I have no good way to pass function(d){return xaxis(d['x'])} I could pass it as a string, but then I would need some way to determine whether strings I pass should be eval-ed to retrieve callbacks or not also - you would have to write javascript callbacks in string form, which is ugly anyways. furthermore, in d3, it is common to define scaling axes objects, and use those in your callbacks - I don't have a good place to do that either. > On Mar 19, 2012, at 8:13 AM, hugo wrote: > >> >> Thought you might be interested in something I've experimented with >> over the past few days. >> >> https://github.com/hhuuggoo/pushd3/blob/master/demopush.ogv >> >> I wanted to see how well this concept would work, I set up remote >> execution of code in the browser by creating an RPC interface around >> zeromq messages which get forwarded into websockets, and then I >> forwarded d3 and jquery operations to the browser. It works fine if >> your arguments are all json serializable, however d3 is heavily >> reliant on passing callbacks, and I don't have a good way to do that. >> >> Anyways, here it is. This is separate from the ipython notebook, I >> have a separate gevent based zeromq web socket forwarder that I've >> also been playing around with which I am using here. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> 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 jason-sage at creativetrax.com Mon Mar 19 10:51:00 2012 From: jason-sage at creativetrax.com (Jason Grout) Date: Mon, 19 Mar 2012 10:51:00 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F67357C.8030501@continuum.io> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> Message-ID: <4F6747D4.3040206@creativetrax.com> On 3/19/12 9:32 AM, hugo wrote: > > > On 03/19/2012 09:22 AM, fawce wrote: >> holy mackerel that's awesome! >> >> Can you elaborate on the callback issue? Wondering why you can't pass >> in a callback that just makes a ws call internally. > > just that I serialize function names and the args they are called with > via JSON > > so for d3, the normal way you would position points in a scatter plot is > something like this > > d3.selectAll('circle').attr('cx', function(d){return axis(d['x'])}); > > I have no good way to pass function(d){return xaxis(d['x'])} > > I could pass it as a string, but then I would need some way to determine > whether strings I pass should be eval-ed to retrieve callbacks or not > also - you would have to write javascript callbacks in string form, > which is ugly anyways. furthermore, in d3, it is common to define > scaling axes objects, and use those in your callbacks - I don't have a > good place to do that either. fawce's suggestion sounds very intriguing--make the websockets message passing two-way between python and javascript. The way I understand the suggestion, what about (in python): def mycallback(d): return d3.axis(d['x']) d3.selectAll('circle').attr('cx', callback(mycallback)); This gets translated to the javascript code: d3.selectAll('circle'.attr('cx', function(){ var results= send_message('mycallback', arguments); return interpret_results(results);}) send_message sends a message back through websockets to call the mycallback python function with some sort of proxy object d that knows how to generate json messages describing the attribute accesses, etc. In the python side, inside mycallback, d['x'] generates the javascript code to access arguments[0]['x'], so what is passed back is some sort of javascript code like 'd3.axis(arguments[0]['x'])'. interpret_results then runs this code and returns the result. Thanks, Jason From massimodisasha at gmail.com Mon Mar 19 20:16:15 2012 From: massimodisasha at gmail.com (Massimo Di Stefano) Date: Mon, 19 Mar 2012 20:16:15 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F6747D4.3040206@creativetrax.com> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> Message-ID: <272FA126-2FCB-42B7-BE2D-38888FC8164D@gmail.com> Hi All, i found this new capabilities really really interesting! it is awesome!!! i've few questions .. i was tring to run the examples i found here : https://github.com/cschin/IPython-Notebook---d3.js-mashup i applied the changes in the ipython core files (adding the 2 methods) then i was able to run the first example (congrats! it's really cool) now going ahead i was really attracted by the other examples 2/3 in order to add a frame inside the notebook itself instead of a new page. in example 2 i changed the path to de.js to be : ./d3.js like in the first example then i add the import for the module 'math'. trying ti run example 2, i see a square empty box is loaded in the notebook (a string : 404: Not Found - inside it) then running the first lines of code a frame is added to the python notebook! :) in it i can still see the string : 404: Not Found the rest of the code seems to don't have effects on the frame. have you any clue on what i need to change in order to have it running ?\ thanks a lot for this, it is so cool! --Massimo. Il giorno Mar 19, 2012, alle ore 10:51 AM, Jason Grout ha scritto: > On 3/19/12 9:32 AM, hugo wrote: >> >> >> On 03/19/2012 09:22 AM, fawce wrote: >>> holy mackerel that's awesome! >>> >>> Can you elaborate on the callback issue? Wondering why you can't pass >>> in a callback that just makes a ws call internally. >> >> just that I serialize function names and the args they are called with >> via JSON >> >> so for d3, the normal way you would position points in a scatter plot is >> something like this >> >> d3.selectAll('circle').attr('cx', function(d){return axis(d['x'])}); >> >> I have no good way to pass function(d){return xaxis(d['x'])} >> >> I could pass it as a string, but then I would need some way to determine >> whether strings I pass should be eval-ed to retrieve callbacks or not >> also - you would have to write javascript callbacks in string form, >> which is ugly anyways. furthermore, in d3, it is common to define >> scaling axes objects, and use those in your callbacks - I don't have a >> good place to do that either. > > > fawce's suggestion sounds very intriguing--make the websockets message > passing two-way between python and javascript. The way I understand the > suggestion, what about (in python): > > def mycallback(d): > return d3.axis(d['x']) > > d3.selectAll('circle').attr('cx', callback(mycallback)); > > This gets translated to the javascript code: > > d3.selectAll('circle'.attr('cx', function(){ > var results= send_message('mycallback', arguments); > return interpret_results(results);}) > > send_message sends a message back through websockets to call the > mycallback python function with some sort of proxy object d that knows > how to generate json messages describing the attribute accesses, etc. > In the python side, inside mycallback, d['x'] generates the javascript > code to access arguments[0]['x'], so what is passed back is some sort of > javascript code like 'd3.axis(arguments[0]['x'])'. interpret_results > then runs this code and returns the result. > > Thanks, > > Jason > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From hugo at continuum.io Mon Mar 19 20:27:05 2012 From: hugo at continuum.io (hugo) Date: Mon, 19 Mar 2012 20:27:05 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F6747D4.3040206@creativetrax.com> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> Message-ID: <4F67CED9.7080700@continuum.io> ah - interesting, I didn't quite understand it at first. I think that would work, however in the d3 case, I think performance would be an issue, d3 uses callbacks for everything. for a scatter plot, each circle needs at least 2 callbacks, one for x coordinate, one for y coordinate, that would be one round trip communication per point! for local work, this might be ok, but it probably won't work in a traditional client server setup, especially if you get many points. I think for me - the complexity involved in this is enough to convince me that this is the wrong approach. It was an interesting experiment but I'm going to give up on this path, I think a preferable route is to implement higher level plots (scatter, lines, image plots, etc..) which only take json serialiseable data as args, and then just call those from ipython. > > fawce's suggestion sounds very intriguing--make the websockets message > passing two-way between python and javascript. The way I understand the > suggestion, what about (in python): > > def mycallback(d): > return d3.axis(d['x']) > > d3.selectAll('circle').attr('cx', callback(mycallback)); > > This gets translated to the javascript code: > > d3.selectAll('circle'.attr('cx', function(){ > var results= send_message('mycallback', arguments); > return interpret_results(results);}) > > send_message sends a message back through websockets to call the > mycallback python function with some sort of proxy object d that knows > how to generate json messages describing the attribute accesses, etc. > In the python side, inside mycallback, d['x'] generates the javascript > code to access arguments[0]['x'], so what is passed back is some sort of > javascript code like 'd3.axis(arguments[0]['x'])'. interpret_results > then runs this code and returns the result. > > Thanks, > > Jason > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From ellisonbg at gmail.com Mon Mar 19 20:51:13 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 19 Mar 2012 17:51:13 -0700 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <4F67CED9.7080700@continuum.io> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> Message-ID: On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: > ah - interesting, I didn't quite understand it at first. > > I think that would work, however in the d3 case, I think performance > would be an issue, d3 uses callbacks for everything. ?for a scatter > plot, each circle needs at least 2 callbacks, one for x coordinate, one > for y coordinate, that would be one round trip communication per point! > for local work, this might be ok, but it probably won't work in a > traditional client server setup, especially if you get many points. > > I think for me - the complexity involved in this is enough to convince > me that this is the wrong approach. ?It was an interesting experiment > but I'm going to give up on this path, I think a preferable route is to > implement higher level plots (scatter, lines, image plots, etc..) which > only take json serialiseable data as args, and then just call those from > ipython. I strongly agree with this assessment. In general we are -1 on adding new web socket connections and trying to manage Javascript/Python communications at a fine grained level. Things like interactive plots should simply take JSON data at the beginning and they work with it on the client side. >> >> fawce's suggestion sounds very intriguing--make the websockets message >> passing two-way between python and javascript. ?The way I understand the >> suggestion, what about (in python): >> >> def mycallback(d): >> ? ? ? return d3.axis(d['x']) >> >> d3.selectAll('circle').attr('cx', callback(mycallback)); >> >> This gets translated to the javascript code: >> >> d3.selectAll('circle'.attr('cx', function(){ >> var results= send_message('mycallback', arguments); >> return interpret_results(results);}) >> >> send_message sends a message back through websockets to call the >> mycallback python function with some sort of proxy object d that knows >> how to generate json messages describing the attribute accesses, etc. >> In the python side, inside mycallback, d['x'] generates the javascript >> code to access arguments[0]['x'], so what is passed back is some sort of >> javascript code like 'd3.axis(arguments[0]['x'])'. ?interpret_results >> then runs this code and returns the result. >> >> Thanks, >> >> Jason >> _______________________________________________ >> 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 -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From fawce at quantopian.com Mon Mar 19 21:23:08 2012 From: fawce at quantopian.com (fawce) Date: Mon, 19 Mar 2012 21:23:08 -0400 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> Message-ID: <797EE85B-A051-48A7-9108-846F6E5E630C@quantopian.com> On Mar 19, 2012, at 8:51 PM, Brian Granger wrote: > On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: >> ah - interesting, I didn't quite understand it at first. >> >> I think that would work, however in the d3 case, I think performance >> would be an issue, d3 uses callbacks for everything. for a scatter >> plot, each circle needs at least 2 callbacks, one for x coordinate, one >> for y coordinate, that would be one round trip communication per point! >> for local work, this might be ok, but it probably won't work in a >> traditional client server setup, especially if you get many points. >> >> I think for me - the complexity involved in this is enough to convince >> me that this is the wrong approach. It was an interesting experiment >> but I'm going to give up on this path, I think a preferable route is to >> implement higher level plots (scatter, lines, image plots, etc..) which >> only take json serialiseable data as args, and then just call those from >> ipython. > > I strongly agree with this assessment. In general we are -1 on adding > new web socket connections and trying to manage Javascript/Python > communications at a fine grained level. Things like interactive plots > should simply take JSON data at the beginning and they work with it on > the client side. Sorry for the poor suggestion, I just didn't know d3 was so chatty. Highcharts works the way you're suggesting, and also has good support for incrementally adding data. It is a very nice library, and we're pushing a lot of updates to it via websockets. The tradeoff, which I think comes with the high-level chart design, is that you sacrifice flexibility in the rendering -- you can only use the chart types that exist in the library. > > >>> >>> fawce's suggestion sounds very intriguing--make the websockets message >>> passing two-way between python and javascript. The way I understand the >>> suggestion, what about (in python): >>> >>> def mycallback(d): >>> return d3.axis(d['x']) >>> >>> d3.selectAll('circle').attr('cx', callback(mycallback)); >>> >>> This gets translated to the javascript code: >>> >>> d3.selectAll('circle'.attr('cx', function(){ >>> var results= send_message('mycallback', arguments); >>> return interpret_results(results);}) >>> >>> send_message sends a message back through websockets to call the >>> mycallback python function with some sort of proxy object d that knows >>> how to generate json messages describing the attribute accesses, etc. >>> In the python side, inside mycallback, d['x'] generates the javascript >>> code to access arguments[0]['x'], so what is passed back is some sort of >>> javascript code like 'd3.axis(arguments[0]['x'])'. interpret_results >>> then runs this code and returns the result. >>> >>> Thanks, >>> >>> Jason >>> _______________________________________________ >>> 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 > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > 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 From ellisonbg at gmail.com Mon Mar 19 21:29:37 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 19 Mar 2012 18:29:37 -0700 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: <797EE85B-A051-48A7-9108-846F6E5E630C@quantopian.com> References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> <797EE85B-A051-48A7-9108-846F6E5E630C@quantopian.com> Message-ID: On Mon, Mar 19, 2012 at 6:23 PM, fawce wrote: > > On Mar 19, 2012, at 8:51 PM, Brian Granger wrote: > >> On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: >>> ah - interesting, I didn't quite understand it at first. >>> >>> I think that would work, however in the d3 case, I think performance >>> would be an issue, d3 uses callbacks for everything. ?for a scatter >>> plot, each circle needs at least 2 callbacks, one for x coordinate, one >>> for y coordinate, that would be one round trip communication per point! >>> for local work, this might be ok, but it probably won't work in a >>> traditional client server setup, especially if you get many points. >>> >>> I think for me - the complexity involved in this is enough to convince >>> me that this is the wrong approach. ?It was an interesting experiment >>> but I'm going to give up on this path, I think a preferable route is to >>> implement higher level plots (scatter, lines, image plots, etc..) which >>> only take json serialiseable data as args, and then just call those from >>> ipython. >> >> I strongly agree with this assessment. ?In general we are -1 on adding >> new web socket connections and trying to manage Javascript/Python >> communications at a fine grained level. ?Things like interactive plots >> should simply take JSON data at the beginning and they work with it on >> the client side. > > Sorry for the poor suggestion, I just didn't know d3 was so chatty. > Highcharts works the way you're suggesting, and also has good support for incrementally adding data. It is a very nice library, and we're pushing a lot of updates to it via websockets. ?The tradeoff, which I think comes with the high-level chart design, is that you sacrifice flexibility in the rendering -- you can only use the chart types that exist in the library. I think we will (in the long run) be able to push/pull data to Javascript code like you are mentioning. But it will require some very careful design to do properly. We have started to think about these abstractions but have lots of work to go still. >> >> >>>> >>>> fawce's suggestion sounds very intriguing--make the websockets message >>>> passing two-way between python and javascript. ?The way I understand the >>>> suggestion, what about (in python): >>>> >>>> def mycallback(d): >>>> ? ? ? return d3.axis(d['x']) >>>> >>>> d3.selectAll('circle').attr('cx', callback(mycallback)); >>>> >>>> This gets translated to the javascript code: >>>> >>>> d3.selectAll('circle'.attr('cx', function(){ >>>> var results= send_message('mycallback', arguments); >>>> return interpret_results(results);}) >>>> >>>> send_message sends a message back through websockets to call the >>>> mycallback python function with some sort of proxy object d that knows >>>> how to generate json messages describing the attribute accesses, etc. >>>> In the python side, inside mycallback, d['x'] generates the javascript >>>> code to access arguments[0]['x'], so what is passed back is some sort of >>>> javascript code like 'd3.axis(arguments[0]['x'])'. ?interpret_results >>>> then runs this code and returns the result. >>>> >>>> Thanks, >>>> >>>> Jason >>>> _______________________________________________ >>>> 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 >> >> >> >> -- >> Brian E. Granger >> Cal Poly State University, San Luis Obispo >> 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 > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From dale at dalejung.com Tue Mar 20 20:21:59 2012 From: dale at dalejung.com (Dale Jung) Date: Tue, 20 Mar 2012 20:21:59 -0400 Subject: [IPython-dev] Client configuration and vim integration for notebook Message-ID: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> Were the client side configuration changes from: http://mail.scipy.org/pipermail/ipython-dev/2012-January/008665.html merged into master? I took a pass at adding the vim bindings into the notebook and right now it's only configurable in code. The code is here: https://github.com/dalejung/ipython The way I approached is to create a set of Notebook level bindings that sync with the cell's bindings. I wanted to do away with the control-m shortcuts since vim has a non-edit normal mode. NormalMode Bindings: shift + j: move to next cell shift + k: move to prev cell shift + y: copy cell shift + d: cut cell shift + p: paste cell shift + a: open cell above shift + b: open cell below shift + e: execute cell shift + f: toggle output on cell shift + c: change cell to CodeCell shift + m: change cell to MarkdownCell TextCell: i: edit text cell (Note: this toggles the edit window that is in normal mode. you must press i again to edit) ESC: get out of insert and render textcell This isn't the full set of shortcuts, but it allows me to work in the notebook without touching the mouse or using control-m. If any vim users could see how the workflow feels to them. Technically some Notebook shortcuts clobber the vim bindings, but I didn't want to create an additional Notebook Normal mode. I don't personally use the bindings I clashed on but that's only me. I haven't used notebook before today so I don't know all the features. I had assumed it was only for presentations, but that cell based editing sure is nice for exploring :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Wed Mar 21 01:08:30 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 20 Mar 2012 22:08:30 -0700 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> Message-ID: On Mon, Mar 19, 2012 at 5:51 PM, Brian Granger wrote: > On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: >> ah - interesting, I didn't quite understand it at first. >> >> I think that would work, however in the d3 case, I think performance >> would be an issue, d3 uses callbacks for everything. ?for a scatter >> plot, each circle needs at least 2 callbacks, one for x coordinate, one >> for y coordinate, that would be one round trip communication per point! >> for local work, this might be ok, but it probably won't work in a >> traditional client server setup, especially if you get many points. >> >> I think for me - the complexity involved in this is enough to convince >> me that this is the wrong approach. ?It was an interesting experiment >> but I'm going to give up on this path, I think a preferable route is to >> implement higher level plots (scatter, lines, image plots, etc..) which >> only take json serialiseable data as args, and then just call those from >> ipython. > > I strongly agree with this assessment. ?In general we are -1 on adding > new web socket connections and trying to manage Javascript/Python > communications at a fine grained level. ?Things like interactive plots > should simply take JSON data at the beginning and they work with it on > the client side. That's my take on it too, esp. given how intensely callback-based d3 seems to be. Even for localhost work, the fact that we'd be creating thousands of callbacks that become js-websockets-python-stringifiedjs-websocket-js monsters would probably make anything non-trivial unusably slow. But thanks Hugo for this experiment! It's great to start seeing with practical tests the boundaries of the problem, so that we can plan out what will be the most fruitful approaches to enable. We really want to simply refactor things in ipython so that *users* can start creating any kind of js-based interactive display they want, instead of us welding any specific approach to ipython itself. I think for now we've settled on the approach Brian outlines above as the most sensible path forward, eventually adding capabilities for incremental update of the data on the client. Clients would provide most interactivity with locally cached data, only requesting new information from the python process on an infrequent basis as thresholds of resolution or viewport are crossed. The one thing that will *not* be good for is real-time display of data, where you are actually pulling data as fast as it can be captured. Something like Peter Wang's Chaco demo with real time audio capture and spectrogram would require a ton of communication across the process boundary that I'm a bit doubtful will work well enough with that many layers in between... Cheers, f From cschin at infoecho.net Wed Mar 21 15:04:26 2012 From: cschin at infoecho.net (Chen-Shan Chin) Date: Wed, 21 Mar 2012 12:04:26 -0700 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> Message-ID: On Mar 20, 2012, at 10:08 PM, Fernando Perez wrote: > On Mon, Mar 19, 2012 at 5:51 PM, Brian Granger wrote: >> On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: >>> ah - interesting, I didn't quite understand it at first. >>> >>> I think that would work, however in the d3 case, I think performance >>> would be an issue, d3 uses callbacks for everything. for a scatter >>> plot, each circle needs at least 2 callbacks, one for x coordinate, one >>> for y coordinate, that would be one round trip communication per point! >>> for local work, this might be ok, but it probably won't work in a >>> traditional client server setup, especially if you get many points. >>> >>> I think for me - the complexity involved in this is enough to convince >>> me that this is the wrong approach. It was an interesting experiment >>> but I'm going to give up on this path, I think a preferable route is to >>> implement higher level plots (scatter, lines, image plots, etc..) which >>> only take json serialiseable data as args, and then just call those from >>> ipython. >> >> I strongly agree with this assessment. In general we are -1 on adding >> new web socket connections and trying to manage Javascript/Python >> communications at a fine grained level. Things like interactive plots >> should simply take JSON data at the beginning and they work with it on >> the client side. > > That's my take on it too, esp. given how intensely callback-based d3 > seems to be. Even for localhost work, the fact that we'd be creating > thousands of callbacks that become > js-websockets-python-stringifiedjs-websocket-js monsters would > probably make anything non-trivial unusably slow. > > But thanks Hugo for this experiment! It's great to start seeing with > practical tests the boundaries of the problem, so that we can plan out > what will be the most fruitful approaches to enable. We really want > to simply refactor things in ipython so that *users* can start > creating any kind of js-based interactive display they want, instead > of us welding any specific approach to ipython itself. > > I think for now we've settled on the approach Brian outlines above as > the most sensible path forward, eventually adding capabilities for > incremental update of the data on the client. Clients would provide > most interactivity with locally cached data, only requesting new > information from the python process on an infrequent basis as > thresholds of resolution or viewport are crossed. > > The one thing that will *not* be good for is real-time display of > data, where you are actually pulling data as fast as it can be > captured. Something like Peter Wang's Chaco demo with real time audio > capture and spectrogram would require a ton of communication across > the process boundary that I'm a bit doubtful will work well enough > with that many layers in between... > I think the html notebook can not currently support high through network traffic for large amount data transfer. And it is probably true for most web based visualization. What I think a general approach is to enable good API for two way communication to enable exchange information in the browser (javascript objects) and the ipython kernel (python objects), such a more convient way to develop interaction-rich visualization all within ipython notebook environment. For example, if I need a input-text box, I like to response the "on_change" javascript event with a python code. I will like to able to do something like this ## create a test input text box input_style = {"width":"240px"} i1 = vis.InputWidget(name = "input_1", parent = "plot_area", style = input_style, value = "try this out", vis = vis_display) def onchange(self, *argv, **kwargv): self.update_value() vis.set_action(i1, "onchange", onchange) And when the event "onchange" of the input-text html element is trigger, the "sefl.update_value()" python code is executed. It is totally possible to do such thing in the current 0.13-dev using the current ipython websocket/zmq channel. I have to monkey patched a numbers of thing on intercepting io_pub message that is not originally from a code_cell. With those patches, one can create any html based visualization with one's favorite javascript library. (A notebook that I am working on can be download from https://github.com/cschin/IPython-Notebook---d3.js-mashup/blob/master/inb_vis_widget_exp.ipynb , It has the instruction on how to monkey patch the 0.13-dev to make it work. I will write more about this later too.) From walter at livinglogic.de Fri Mar 23 13:07:53 2012 From: walter at livinglogic.de (=?UTF-8?B?V2FsdGVyIETDtnJ3YWxk?=) Date: Fri, 23 Mar 2012 18:07:53 +0100 Subject: [IPython-dev] _repr_pretty_() for dict subclasses Message-ID: <4F6CADE9.9030001@livinglogic.de> Hello all! I'm currently experimenting with the new pretty printing framework. It seems there's a problem with the _repr_pretty_ method in dict subclasses: Python 3.2.2 (default, Oct 31 2011, 16:56:14) Type "copyright", "credits" or "license" for more information. IPython 0.12 -- An enhanced Interactive Python. ? -> 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]: class Element(object): ...: def _repr_pretty_(self, p, cycle): ...: p.text("Element()") ...: In [2]: class Attrs(dict): ...: def _repr_pretty_(self, p, cycle): ...: p.text("Attrs()") ...: In [3]: Element() Out[3]: Element() In [4]: Attrs() Out[4]: {} In [5]: I would have expected the second output to be: Out[4]: Attrs() The problem is in IPython.lib.pretty.RepresentationPrinter.pretty() The code first tries to find a registered printers for any of the base classes in type_pprinters. This ignores any _repr_pretty_ method defined earlier in the mro. The current order is: # First try to find registered singleton printers for the type. # Next look for type_printers. # Finally look for special method names. Changing this to: # First try to find registered singleton printers for the type. # Next look for special method names. # Finally look for type_printers. would solve this particular problem, however this leads to the inverse problem: Looking up the method (which might be implemented in a base class) first would ignore any registered printers for the class itself. The proper solution would probably be to walk the mro and see if there's either a registered printer or a _repr_pretty_ method for the class. However I'm not sure if there's a reliable way to check whether a method is implemented in the class itself or inherited from any of the base classes. What's the proper fix for this? Should I submit a bug report? Work on a patch? Servus, Walter From robert.kern at gmail.com Fri Mar 23 13:24:18 2012 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 23 Mar 2012 17:24:18 +0000 Subject: [IPython-dev] _repr_pretty_() for dict subclasses In-Reply-To: <4F6CADE9.9030001@livinglogic.de> References: <4F6CADE9.9030001@livinglogic.de> Message-ID: On 3/23/12 5:07 PM, Walter D?rwald wrote: > Hello all! > > I'm currently experimenting with the new pretty printing framework. It > seems there's a problem with the _repr_pretty_ method in dict subclasses: > > Python 3.2.2 (default, Oct 31 2011, 16:56:14) > Type "copyright", "credits" or "license" for more information. > > IPython 0.12 -- An enhanced Interactive Python. > ? -> 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]: class Element(object): > ...: def _repr_pretty_(self, p, cycle): > ...: p.text("Element()") > ...: > In [2]: class Attrs(dict): > ...: def _repr_pretty_(self, p, cycle): > ...: p.text("Attrs()") > ...: > In [3]: Element() > Out[3]: Element() > In [4]: Attrs() > Out[4]: {} > In [5]: > > I would have expected the second output to be: > > Out[4]: Attrs() > > The problem is in > > IPython.lib.pretty.RepresentationPrinter.pretty() > > The code first tries to find a registered printers for any of the base > classes in type_pprinters. This ignores any _repr_pretty_ method defined > earlier in the mro. The current order is: > > # First try to find registered singleton printers for the type. > # Next look for type_printers. > # Finally look for special method names. > > Changing this to: > > # First try to find registered singleton printers for the type. > # Next look for special method names. > # Finally look for type_printers. > > would solve this particular problem, however this leads to the inverse > problem: Looking up the method (which might be implemented in a base > class) first would ignore any registered printers for the class itself. > > The proper solution would probably be to walk the mro and see if there's > either a registered printer or a _repr_pretty_ method for the class. > However I'm not sure if there's a reliable way to check whether a method > is implemented in the class itself or inherited from any of the base > classes. It will be in the __dict__ of the class that defines it. The algorithm should probably be: 1. Try to find registered singleton printers for the type. 2. Walk up the MRO: a. Look in type_printers for the current class. b. Then look for _repr_pretty_ in the current class's __dict__. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fperez.net at gmail.com Mon Mar 26 01:56:47 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 25 Mar 2012 22:56:47 -0700 Subject: [IPython-dev] IPython@PyCon 2012 - link summary Message-ID: Hi all, I've just finished uploading all of our tutorial materials, so here's a quick roundup of the relevant links from our PyCon 2012 blitz: - Downloadable materials for the tutorial (slides, notebooks, etc): http://archive.ipython.org/media/PyCon2012. - The full video of the tutorial: http://pyvideo.org/video/605/ipython-in-depth-high-productivity-interactive-a - Video of the talk I presented during the main conference (we got a last-minute slot): http://pyvideo.org/video/640/ipython-python-at-your-fingertips - Slides of the talk: http://fperez.org/talks/1203_ipython_pycon.pdf - A few pictures we took of the booth and the sprints: https://plus.google.com/photos/105051551851350439748/albums/5724077281908618417?banner=pwa Bringing a booth turned out to be a fantastic idea (kudos to Brian for thinking of it and making it happen). We were basically mobbed for two days, with a *ton* of interest and non-stop visitors asking questions. It meant we didn't get to go to any of the talks :) But I think it was a good bargain, b/c that kind of direct interaction with the wider Python community is very useful for us, and we'd typically had fairly little of it (Brian had only been once to Pycon, and for Min and I this was our first). It was a mad few weeks (esp. give that this was right after Strata and PyData), but I think all worth it... Cheers, f From ellisonbg at gmail.com Mon Mar 26 18:59:21 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 26 Mar 2012 15:59:21 -0700 Subject: [IPython-dev] Client configuration and vim integration for notebook In-Reply-To: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> References: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> Message-ID: Dale, On Tue, Mar 20, 2012 at 5:21 PM, Dale Jung wrote: > Were the client side configuration changes from: > > http://mail.scipy.org/pipermail/ipython-dev/2012-January/008665.html > > merged into master? No we haven't moved forward yet with the configuration UI. > I took a pass at adding the vim bindings into the > notebook and right now it's only configurable in code. > > The code is here:?https://github.com/dalejung/ipython > > The way I approached is to create a set of Notebook level bindings that sync > with the cell's bindings. I wanted to do away with the control-m shortcuts > since vim has a non-edit normal mode. > > NormalMode Bindings: > shift + j: move to next cell > shift + k: move to prev cell > shift + y: copy cell > shift + d: cut cell > shift + p: paste cell > shift + a: open cell above > shift + b: open cell below > shift + e: execute cell > shift + f: toggle output on cell > > shift + c: change cell to CodeCell > shift + m: change cell to MarkdownCell > > TextCell: > i: edit text cell (Note: this toggles the edit window that is in normal > mode. you must press i again to edit) > ESC: get out of insert and render textcell When I think about vim keybindings, I am thinking about how the code/text editor areas behave when you are editing them. But it sounds like you are using vim like bindings on the notebook itself - to manage cells, etc. Is this an accurate description of what you are doing? Here is a bit more background on the issue of keybindings: * There are two sets of keybindings in the notebook. The first is notebook level ones, that manage cell level actions. Most of these show up when you view the keyboard shortcuts in the help. The second set of keybindings are active when a cell is being edited. Things like tab completion are handled by these. * There can be very subtle interactions between these two sets of key bindings. The current bindings are finely tuned to deal with these issues. * All keybindings we use must be free of conflicts on all browsers (Chrome, FF, Safari) on all operating systems. This means that many shortcuts you would like to use cannot be used because they are taken. This is why we went with the ctrl-m prefix for all notebook level shortcuts as it doesn't conflict. * The notebook level keyboard shortcuts should not know anything about vim. * vim/emacs bindings should only take over when a single code/text cell is being edited. * Because of a) the subtle interactions between cell and notebook level bindings and b) the lack of available keyboard shortcuts in modern browsers, the notebook will not ever have ultra-configurable keyboard shortcuts. Cheers, Brian > > This isn't the full set of shortcuts, but it allows me to work in the > notebook without touching the mouse or using control-m. If any vim users > could see how the workflow feels to them. Technically some Notebook > shortcuts clobber the vim bindings, but I didn't want to create an > additional Notebook Normal mode. I don't personally use the bindings I > clashed on but that's only me. > I haven't used notebook before today so I don't know all the features. I had > assumed it was only for presentations, but that cell based editing sure is > nice for exploring :) > > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From dale at dalejung.com Mon Mar 26 20:56:14 2012 From: dale at dalejung.com (Dale Jung) Date: Mon, 26 Mar 2012 20:56:14 -0400 Subject: [IPython-dev] Client configuration and vim integration for notebook In-Reply-To: References: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> Message-ID: <712CB595-AC78-4AC9-8B8E-F0D947D8DBD9@dalejung.com> Replying from iPhone. Will reply more in detail. On Mar 26, 2012, at 6:59 PM, Brian Granger wrote: > Dale, > > On Tue, Mar 20, 2012 at 5:21 PM, Dale Jung wrote: >> Were the client side configuration changes from: >> >> http://mail.scipy.org/pipermail/ipython-dev/2012-January/008665.html >> >> merged into master? > > No we haven't moved forward yet with the configuration UI. > >> I took a pass at adding the vim bindings into the >> notebook and right now it's only configurable in code. >> >> The code is here: https://github.com/dalejung/ipython >> >> The way I approached is to create a set of Notebook level bindings that sync >> with the cell's bindings. I wanted to do away with the control-m shortcuts >> since vim has a non-edit normal mode. >> >> NormalMode Bindings: >> shift + j: move to next cell >> shift + k: move to prev cell >> shift + y: copy cell >> shift + d: cut cell >> shift + p: paste cell >> shift + a: open cell above >> shift + b: open cell below >> shift + e: execute cell >> shift + f: toggle output on cell >> >> shift + c: change cell to CodeCell >> shift + m: change cell to MarkdownCell >> >> TextCell: >> i: edit text cell (Note: this toggles the edit window that is in normal >> mode. you must press i again to edit) >> ESC: get out of insert and render textcell > > When I think about vim keybindings, I am thinking about how the > code/text editor areas behave when you are editing them. But it > sounds like you are using vim like bindings on the notebook itself - > to manage cells, etc. Is this an accurate description of what you are > doing? > Kind of. I'm syncing the vim cell binding with the notebook. When the cell is in normal mode, I am making use of additional notebook level bindings. So once you exit out of editing a cell (esc) you can use vim commands to move around the text area and do notebook level commands. > Here is a bit more background on the issue of keybindings: > > * There are two sets of keybindings in the notebook. The first is > notebook level ones, that manage cell level actions. Most of these > show up when you view the keyboard shortcuts in the help. The second > set of keybindings are active when a cell is being edited. Things > like tab completion are handled by these. > * There can be very subtle interactions between these two sets of key > bindings. The current bindings are finely tuned to deal with these > issues. > * All keybindings we use must be free of conflicts on all browsers > (Chrome, FF, Safari) on all operating systems. This means that many > shortcuts you would like to use cannot be used because they are taken. > This is why we went with the ctrl-m prefix for all notebook level > shortcuts as it doesn't conflict. Since text isn't editable in normal mode, this allows us to make use of bindings that won't conflict. For example shift a makes a cell above. > * The notebook level keyboard shortcuts should not know anything about vim. > * vim/emacs bindings should only take over when a single code/text > cell is being edited. > * Because of a) the subtle interactions between cell and notebook > level bindings and b) the lack of available keyboard shortcuts in > modern browsers, the notebook will not ever have ultra-configurable > keyboard shortcuts. I've been working purely with the vim branch and making edits as things come up. I have to say the biggest hurdle is the fact that the code mirror vim bindings are currently lackluster. No visual mode or block selecting. :(. > > Cheers, > > Brian > >> >> This isn't the full set of shortcuts, but it allows me to work in the >> notebook without touching the mouse or using control-m. If any vim users >> could see how the workflow feels to them. Technically some Notebook >> shortcuts clobber the vim bindings, but I didn't want to create an >> additional Notebook Normal mode. I don't personally use the bindings I >> clashed on but that's only me. > > > >> I haven't used notebook before today so I don't know all the features. I had >> assumed it was only for presentations, but that cell based editing sure is >> nice for exploring :) >> >> >> _______________________________________________ >> 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 > 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 From ellisonbg at gmail.com Mon Mar 26 22:22:24 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 26 Mar 2012 19:22:24 -0700 Subject: [IPython-dev] Client configuration and vim integration for notebook In-Reply-To: <712CB595-AC78-4AC9-8B8E-F0D947D8DBD9@dalejung.com> References: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> <712CB595-AC78-4AC9-8B8E-F0D947D8DBD9@dalejung.com> Message-ID: Dale, On Mon, Mar 26, 2012 at 5:56 PM, Dale Jung wrote: > Replying from iPhone. Will reply more in detail. You did pretty good in replying on your iPhone :) > On Mar 26, 2012, at 6:59 PM, Brian Granger wrote: > >> Dale, >> >> On Tue, Mar 20, 2012 at 5:21 PM, Dale Jung wrote: >>> Were the client side configuration changes from: >>> >>> http://mail.scipy.org/pipermail/ipython-dev/2012-January/008665.html >>> >>> merged into master? >> >> No we haven't moved forward yet with the configuration UI. >> >>> I took a pass at adding the vim bindings into the >>> notebook and right now it's only configurable in code. >>> >>> The code is here: https://github.com/dalejung/ipython >>> >>> The way I approached is to create a set of Notebook level bindings that sync >>> with the cell's bindings. I wanted to do away with the control-m shortcuts >>> since vim has a non-edit normal mode. >>> >>> NormalMode Bindings: >>> shift + j: move to next cell >>> shift + k: move to prev cell >>> shift + y: copy cell >>> shift + d: cut cell >>> shift + p: paste cell >>> shift + a: open cell above >>> shift + b: open cell below >>> shift + e: execute cell >>> shift + f: toggle output on cell >>> >>> shift + c: change cell to CodeCell >>> shift + m: change cell to MarkdownCell >>> >>> TextCell: >>> i: edit text cell (Note: this toggles the edit window that is in normal >>> mode. you must press i again to edit) >>> ESC: get out of insert and render textcell >> >> When I think about vim keybindings, I am thinking about how the >> code/text editor areas behave when you are editing them. ?But it >> sounds like you are using vim like bindings on the notebook itself - >> to manage cells, etc. ?Is this an accurate description of what you are >> doing? >> > > Kind of. I'm syncing the vim cell binding with the notebook. When the cell is in normal mode, I am making use of additional notebook level bindings. So this actually does bring to mind some plans that we have for the notebook. Currently, when a cell is selected, the text area is active and typing will affect the text area. IOW, a cell can't be selected without being in "edit" mode. We plan on relaxing that so when a cell is initially selected, it is not in edit mode. In that mode, we will have new keyboard bindings that are notebook level and will probably be similar to the type of thing you are doing. As you point out, the nice thing about this approach is that you can use very simple keyboard shortcuts (like j,k,i, etc.). When a cell is selected, you can enter edit mode and then the text area of that cell will behave in the usual manner with emacs or vim bindings. But in my mind, the vim/emacs stuff should not bleed out into the non-edit notebook mode. > So once you exit out of editing a cell (esc) you can use vim commands to move around the text area and do notebook level commands. I don't think these two things should be done in the same mode. The reason is that it means the notebook level command have to be built around the existing vim infrastructure. Using vim command for moving around the text area should be a completely separate mode from notebook level commands. Here is a sketch of what I am thinking: For emacs bindings there would be two modes: * Notebook level command mode that allows you to perform cell/notebook level actions. * Text edit mode for an editing a single cell's text using emacs style bindings. For vim bindings there would be three modes: * Notebook level command mode that allows you to perform cell/notebook level actions. The keyboard shortcuts in this mode would match those in the emacs scenario exactly. That is the keybindings have nothing to do with emacs or vim. * vim normal mode for a single selected cell. * vim insert mode for a sigle selected cell. This probably looks confusing, but vim is confusing ;-) My goal in all of this is to have uniform notebook level keyboard shortcuts that apply regardless of which keybindings are used to edit single text areas. > >> Here is a bit more background on the issue of keybindings: >> >> * There are two sets of keybindings in the notebook. ?The first is >> notebook level ones, that manage cell level actions. ?Most of these >> show up when you view the keyboard shortcuts in the help. ?The second >> set of keybindings are active when a cell is being edited. ?Things >> like tab completion are handled by these. >> * There can be very subtle interactions between these two sets of key >> bindings. ?The current bindings are finely tuned to deal with these >> issues. >> * All keybindings we use must be free of conflicts on all browsers >> (Chrome, FF, Safari) on all operating systems. ?This means that many >> shortcuts you would like to use cannot be used because they are taken. >> This is why we went with the ctrl-m prefix for all notebook level >> shortcuts as it doesn't conflict. > > Since text isn't editable in normal mode, this allows us to make use of bindings that won't conflict. For example shift a makes a cell above. > >> * The notebook level keyboard shortcuts should not know anything about vim. >> * vim/emacs bindings should only take over when a single code/text >> cell is being edited. >> * Because of a) the subtle interactions between cell and notebook >> level bindings and b) the lack of available keyboard shortcuts in >> modern browsers, the notebook will not ever have ultra-configurable >> keyboard shortcuts. > > I've been working purely with the vim branch and making edits as things come up. I have to say the biggest hurdle is the fact that the code mirror vim bindings are currently lackluster. No visual mode or block selecting. :(. With the approach I outline above, we should improve the code mirror vim bindings themselves. Cheers, Brian >> >> Cheers, >> >> Brian >> >>> >>> This isn't the full set of shortcuts, but it allows me to work in the >>> notebook without touching the mouse or using control-m. If any vim users >>> could see how the workflow feels to them. Technically some Notebook >>> shortcuts clobber the vim bindings, but I didn't want to create an >>> additional Notebook Normal mode. I don't personally use the bindings I >>> clashed on but that's only me. >> >> >> >>> I haven't used notebook before today so I don't know all the features. I had >>> assumed it was only for presentations, but that cell based editing sure is >>> nice for exploring :) >>> >>> >>> _______________________________________________ >>> 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 >> 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 > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From satra at mit.edu Mon Mar 26 23:15:22 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Mon, 26 Mar 2012 22:15:22 -0500 Subject: [IPython-dev] anyway to undelete a cell Message-ID: hi all, if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s trigger happy), is there any way to undelete it? (or in general is there undo-redo?) cheers, satra -------------- next part -------------- An HTML attachment was scrubbed... URL: From dale at dalejung.com Mon Mar 26 23:18:00 2012 From: dale at dalejung.com (Dale Jung) Date: Mon, 26 Mar 2012 23:18:00 -0400 Subject: [IPython-dev] Client configuration and vim integration for notebook In-Reply-To: References: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> <712CB595-AC78-4AC9-8B8E-F0D947D8DBD9@dalejung.com> Message-ID: <403C037A-5073-4D9D-A4D8-C0ED973484B1@dalejung.com> >> Kind of. I'm syncing the vim cell binding with the notebook. When the cell is in normal mode, I am making use of additional notebook level bindings. > > So this actually does bring to mind some plans that we have for the > notebook. Currently, when a cell is selected, the text area is active > and typing will affect the text area. IOW, a cell can't be selected > without being in "edit" mode. We plan on relaxing that so when a cell > is initially selected, it is not in edit mode. In that mode, we will > have new keyboard bindings that are notebook level and will probably > be similar to the type of thing you are doing. As you point out, the > nice thing about this approach is that you can use very simple > keyboard shortcuts (like j,k,i, etc.). When a cell is selected, you > can enter edit mode and then the text area of that cell will behave in > the usual manner with emacs or vim bindings. > > But in my mind, the vim/emacs stuff should not bleed out into the > non-edit notebook mode. > >> So once you exit out of editing a cell (esc) you can use vim commands to move around the text area and do notebook level commands. > > I don't think these two things should be done in the same mode. The > reason is that it means the notebook level command have to be built > around the existing vim infrastructure. Using vim command for moving > around the text area should be a completely separate mode from > notebook level commands. Here is a sketch of what I am thinking: > > For emacs bindings there would be two modes: > > * Notebook level command mode that allows you to perform cell/notebook > level actions. > * Text edit mode for an editing a single cell's text using emacs style bindings. > > For vim bindings there would be three modes: > > * Notebook level command mode that allows you to perform cell/notebook > level actions. The keyboard shortcuts in this mode would match those > in the emacs scenario exactly. That is the keybindings have nothing > to do with emacs or vim. > * vim normal mode for a single selected cell. > * vim insert mode for a sigle selected cell. > > This probably looks confusing, but vim is confusing ;-) > > My goal in all of this is to have uniform notebook level keyboard > shortcuts that apply regardless of which keybindings are used to edit > single text areas. That's how I originally approached it. I think having a notebook-level normal mode is good for emacs/default since going into cell mode drops you directly into edit. I found the 3 levels of vim confusing. To be honest, I don't know if that's because of the three levels specifically or my first pass at it. The main issue was that going from notebook-normal mode to cell-edit mode took two shortcuts. You'd have to press 'i' twice to get into cell-edit, and esc twice to get back into notebook-normal. Potentially, this could be fixed by going directly into cell-edit form notebook-normal. Or maybe two types of cell-mode entry shortcuts. I don't know. I abandoned it fairly quickly. God, I just realized how confusing it is trying to articulate vim modes. We vimmers must be crazy. > >> >>> Here is a bit more background on the issue of keybindings: >>> >>> * There are two sets of keybindings in the notebook. The first is >>> notebook level ones, that manage cell level actions. Most of these >>> show up when you view the keyboard shortcuts in the help. The second >>> set of keybindings are active when a cell is being edited. Things >>> like tab completion are handled by these. >>> * There can be very subtle interactions between these two sets of key >>> bindings. The current bindings are finely tuned to deal with these >>> issues. >>> * All keybindings we use must be free of conflicts on all browsers >>> (Chrome, FF, Safari) on all operating systems. This means that many >>> shortcuts you would like to use cannot be used because they are taken. >>> This is why we went with the ctrl-m prefix for all notebook level >>> shortcuts as it doesn't conflict. >> I think this is going to have to be easily configurable. Since the shortcut logic is really just a giant switch/ifelse statement, people will end up editing the source if it's not configurable. Especially as people start consistently using notebook in their workflow. Personally, I use a kinesis keyboard and don't have control key mapped to a convenient button since I'm on a mac. It just doesn't feel naturally to use it. So I've mapped commands to meta+key. I know I know. A mac kinesis-using vimmer, it's pretty obviously I'm particular about keystrokes. >>> * Because of a) the subtle interactions between cell and notebook >>> level bindings and b) the lack of available keyboard shortcuts in >>> modern browsers, the notebook will not ever have ultra-configurable >>> keyboard shortcuts. That's where I disagree. If I'm using the notebook then I'm using the notebook and not the browser. In fact, I run the notebook in safari where my primary browser is chrome. I have keybindings that conflict with browser bindings. I understand that ipython can't assume it's okay to take over a shortcut, but I should be able to make that choice. I wonder if making a webkit embedded console app is feasible. That's pretty much how I run my safari notebook, no location/toolbars. btw, I love ipthon notebook but it's weird that I do so much dev work from within a web browser. Especially since I've always prided myself on using terminal/vim and eschewing those fancy GUI text editors. Craziness. From jason-sage at creativetrax.com Mon Mar 26 23:27:47 2012 From: jason-sage at creativetrax.com (Jason Grout) Date: Mon, 26 Mar 2012 22:27:47 -0500 Subject: [IPython-dev] zmq fork Message-ID: <4F7133B3.2000702@creativetrax.com> I just noticed that some of the main developers of zeromq forked zeromq to create the "Crossroads" project [1]. Does anyone have any idea how this affects IPython (or are people just waiting and seeing what happens at this point)? Thanks, Jason [1] http://thread.gmane.org/gmane.network.zeromq.devel/14040 From ellisonbg at gmail.com Mon Mar 26 23:53:04 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 26 Mar 2012 20:53:04 -0700 Subject: [IPython-dev] zmq fork In-Reply-To: <4F7133B3.2000702@creativetrax.com> References: <4F7133B3.2000702@creativetrax.com> Message-ID: On Mon, Mar 26, 2012 at 8:27 PM, Jason Grout wrote: > I just noticed that some of the main developers of zeromq forked zeromq > to create the "Crossroads" project [1]. ?Does anyone have any idea how > this affects IPython (or are people just waiting and seeing what happens > at this point)? Yep, this is going to take a while to bake out and we just need to wait it out. In open source competition is good at the end of the day. May be some pain in the middle though. PyZMQ (the Python bindings for zeromq) are popular enough that I am confident that the Crossroads developers will work hard to make sure that Crossroads works with PyZMQ. They currently have a zeromq compatability mode the makes this possible. My personal hope is that PyZMQ can work with both zeromq and Crossroads, even if they diverge somewhat. From IPython's perspective, as long as PyZMQ works with either zeromq or Crossroads, we are set. If Crossroads and zeromq diverge in more significant ways, we will have to decide how to handle that. But I think all of those decisions will be made within PyZMQ, so users of PyZMQ won't really have to worry much. Cheers, Brian Cheers, Brian > Thanks, > > Jason > > [1] http://thread.gmane.org/gmane.network.zeromq.devel/14040 > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From ellisonbg at gmail.com Mon Mar 26 23:54:44 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 26 Mar 2012 20:54:44 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: Not quite yet. We almost have the infrastructure to implement that though. One thing you can do in the meantime is to use Cut Cell rather than delete cell. Cut cell puts the deletes the cell and puts it on the clipboard. Then you can paste it somewhere else. On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: > hi all, > > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s trigger > happy), is there any way to undelete it? (or in general is there undo-redo?) > > cheers, > > satra > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From satra at mit.edu Mon Mar 26 23:58:29 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Mon, 26 Mar 2012 22:58:29 -0500 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: thanks brian! could Ctrl+m,d be mapped to cut then? cheers, satra On Mon, Mar 26, 2012 at 10:54 PM, Brian Granger wrote: > Not quite yet. We almost have the infrastructure to implement that > though. One thing you can do in the meantime is to use Cut Cell > rather than delete cell. Cut cell puts the deletes the cell and puts > it on the clipboard. Then you can paste it somewhere else. > > On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: > > hi all, > > > > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s trigger > > happy), is there any way to undelete it? (or in general is there > undo-redo?) > > > > cheers, > > > > satra > > > > _______________________________________________ > > 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 > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Tue Mar 27 00:08:39 2012 From: benjaminrk at gmail.com (MinRK) Date: Mon, 26 Mar 2012 21:08:39 -0700 Subject: [IPython-dev] zmq fork In-Reply-To: References: <4F7133B3.2000702@creativetrax.com> Message-ID: On Mon, Mar 26, 2012 at 20:53, Brian Granger wrote: > On Mon, Mar 26, 2012 at 8:27 PM, Jason Grout > wrote: > > I just noticed that some of the main developers of zeromq forked zeromq > > to create the "Crossroads" project [1]. Does anyone have any idea how > > this affects IPython (or are people just waiting and seeing what happens > > at this point)? > > Yep, this is going to take a while to bake out and we just need to > wait it out. In open source competition is good at the end of the > day. May be some pain in the middle though. PyZMQ (the Python > bindings for zeromq) are popular enough that I am confident that the > Crossroads developers will work hard to make sure that Crossroads > works with PyZMQ. They currently have a zeromq compatability mode the > makes this possible. My personal hope is that PyZMQ can work with > both zeromq and Crossroads, even if they diverge somewhat. From > IPython's perspective, as long as PyZMQ works with either zeromq or > Crossroads, we are set. If Crossroads and zeromq diverge in more > significant ways, we will have to decide how to handle that. But I > think all of those decisions will be made within PyZMQ, so users of > PyZMQ won't really have to worry much. > PyZMQ already hides the difference between libzmq-2.1 and libzmq-3.1, so IPython does not have to worry about that difference at all. At this point, libxs *is* libzmq-3.1, and pyzmq should work perfectly well with libxs as long as it is built with its libzmq-compatibility flag (which simply restores original names of things). For the near future, pyzmq will rely on the Crossroads libzmq-compatibility. We will see how libxs develops and diverges from libzmq, and how that affects what is needed to support both (and how the zmq community moves with respect to the fork as well). Essentially, all of this compatibility will happen in pyzmq itself, and IPython should never need to be aware of any of it. -MinRK > > Cheers, > > Brian > > Cheers, > > Brian > > > Thanks, > > > > Jason > > > > [1] http://thread.gmane.org/gmane.network.zeromq.devel/14040 > > _______________________________________________ > > 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 > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Tue Mar 27 00:17:23 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 26 Mar 2012 21:17:23 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: On Mon, Mar 26, 2012 at 8:58 PM, Satrajit Ghosh wrote: > thanks brian! could Ctrl+m,d be mapped to cut then? It already exists: C-m- do the cell-level counterparts of C- for text: cut, copy, paste. See the keybindings :) Cheers, f From satra at mit.edu Tue Mar 27 00:28:54 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Mon, 26 Mar 2012 23:28:54 -0500 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: awesome. i haven't checked those in a while. since i haven't been following the changes closely (although we do have the latest master installed), is there an ability to view the variables (i.e. dir) but on a separate window with autoupdate :) ? cheers, satra On Mon, Mar 26, 2012 at 11:17 PM, Fernando Perez wrote: > On Mon, Mar 26, 2012 at 8:58 PM, Satrajit Ghosh wrote: > > thanks brian! could Ctrl+m,d be mapped to cut then? > > It already exists: C-m- do the cell-level counterparts of > C- for text: cut, copy, paste. > > See the keybindings :) > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Tue Mar 27 00:36:53 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 26 Mar 2012 21:36:53 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: On Mon, Mar 26, 2012 at 9:28 PM, Satrajit Ghosh wrote: > is there an ability to view the variables (i.e. dir) but on a separate > window with autoupdate :) ? Nope, not yet :) f From ellisonbg at gmail.com Tue Mar 27 00:56:36 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Mon, 26 Mar 2012 21:56:36 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: On Mon, Mar 26, 2012 at 8:58 PM, Satrajit Ghosh wrote: > thanks brian! could Ctrl+m,d be mapped to cut then? We probably should do that. cheers, > > satra > > On Mon, Mar 26, 2012 at 10:54 PM, Brian Granger wrote: >> >> Not quite yet. ?We almost have the infrastructure to implement that >> though. ?One thing you can do in the meantime is to use Cut Cell >> rather than delete cell. ?Cut cell puts the deletes the cell and puts >> it on the clipboard. ?Then you can paste it somewhere else. >> >> On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: >> > hi all, >> > >> > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s trigger >> > happy), is there any way to undelete it? (or in general is there >> > undo-redo?) >> > >> > cheers, >> > >> > satra >> > >> > _______________________________________________ >> > 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 >> 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 > > > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From benjaminrk at gmail.com Tue Mar 27 01:00:49 2012 From: benjaminrk at gmail.com (MinRK) Date: Mon, 26 Mar 2012 22:00:49 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: On Mon, Mar 26, 2012 at 21:56, Brian Granger wrote: > On Mon, Mar 26, 2012 at 8:58 PM, Satrajit Ghosh wrote: > > thanks brian! could Ctrl+m,d be mapped to cut then? > > We probably should do that. > I don't think so - delete and cut are separate everywhere else for a reason. If you cut one cell then delete another, it would be pretty distressing to find that what you deleted actually clobbered your clipboard. -MinRK > > cheers, > > > > satra > > > > On Mon, Mar 26, 2012 at 10:54 PM, Brian Granger > wrote: > >> > >> Not quite yet. We almost have the infrastructure to implement that > >> though. One thing you can do in the meantime is to use Cut Cell > >> rather than delete cell. Cut cell puts the deletes the cell and puts > >> it on the clipboard. Then you can paste it somewhere else. > >> > >> On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: > >> > hi all, > >> > > >> > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s > trigger > >> > happy), is there any way to undelete it? (or in general is there > >> > undo-redo?) > >> > > >> > cheers, > >> > > >> > satra > >> > > >> > _______________________________________________ > >> > 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 > >> 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 > > > > > > > > _______________________________________________ > > 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 > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cschin at infoecho.net Tue Mar 27 02:06:21 2012 From: cschin at infoecho.net (Chen-Shan Chin) Date: Mon, 26 Mar 2012 23:06:21 -0700 Subject: [IPython-dev] experiment - remote execution of jquery and d3 code into the browser via ipython In-Reply-To: References: <4F6722B5.8040909@continuum.io> <4F6722E3.8020109@continuum.io> <4F67357C.8030501@continuum.io> <4F6747D4.3040206@creativetrax.com> <4F67CED9.7080700@continuum.io> Message-ID: <996EF879-CFEE-4083-886F-89FB72EA3E54@infoecho.net> Yet another demo, http://dl.dropbox.com/u/69208751/ipython_d3_word_ladder.mov I think it will be cool to be able to use ipython notebook to build such level of interactivity for some exploratory data analysis. (not data intensive, but interactive rich or 3D stuff) While most things that has been shown by some of us are currently d3.js centric, I think what we will like to see is to embrace as much as possible other cool javascript libs (e.g. http://mrdoob.github.com/three.js/ for 3D visualizations) . --Jason On Mar 21, 2012, at 12:04 PM, Chen-Shan Chin wrote: > > On Mar 20, 2012, at 10:08 PM, Fernando Perez wrote: > >> On Mon, Mar 19, 2012 at 5:51 PM, Brian Granger wrote: >>> On Mon, Mar 19, 2012 at 5:27 PM, hugo wrote: >>>> ah - interesting, I didn't quite understand it at first. >>>> >>>> I think that would work, however in the d3 case, I think performance >>>> would be an issue, d3 uses callbacks for everything. for a scatter >>>> plot, each circle needs at least 2 callbacks, one for x coordinate, one >>>> for y coordinate, that would be one round trip communication per point! >>>> for local work, this might be ok, but it probably won't work in a >>>> traditional client server setup, especially if you get many points. >>>> >>>> I think for me - the complexity involved in this is enough to convince >>>> me that this is the wrong approach. It was an interesting experiment >>>> but I'm going to give up on this path, I think a preferable route is to >>>> implement higher level plots (scatter, lines, image plots, etc..) which >>>> only take json serialiseable data as args, and then just call those from >>>> ipython. >>> >>> I strongly agree with this assessment. In general we are -1 on adding >>> new web socket connections and trying to manage Javascript/Python >>> communications at a fine grained level. Things like interactive plots >>> should simply take JSON data at the beginning and they work with it on >>> the client side. >> >> That's my take on it too, esp. given how intensely callback-based d3 >> seems to be. Even for localhost work, the fact that we'd be creating >> thousands of callbacks that become >> js-websockets-python-stringifiedjs-websocket-js monsters would >> probably make anything non-trivial unusably slow. >> >> But thanks Hugo for this experiment! It's great to start seeing with >> practical tests the boundaries of the problem, so that we can plan out >> what will be the most fruitful approaches to enable. We really want >> to simply refactor things in ipython so that *users* can start >> creating any kind of js-based interactive display they want, instead >> of us welding any specific approach to ipython itself. >> >> I think for now we've settled on the approach Brian outlines above as >> the most sensible path forward, eventually adding capabilities for >> incremental update of the data on the client. Clients would provide >> most interactivity with locally cached data, only requesting new >> information from the python process on an infrequent basis as >> thresholds of resolution or viewport are crossed. >> >> The one thing that will *not* be good for is real-time display of >> data, where you are actually pulling data as fast as it can be >> captured. Something like Peter Wang's Chaco demo with real time audio >> capture and spectrogram would require a ton of communication across >> the process boundary that I'm a bit doubtful will work well enough >> with that many layers in between... >> > > > I think the html notebook can not currently support high through network traffic for large > amount data transfer. And it is probably true for most web based visualization. What I > think a general approach is to enable good API for two way communication to enable exchange > information in the browser (javascript objects) and the ipython kernel (python objects), such > a more convient way to develop interaction-rich visualization all within ipython notebook > environment. > > For example, if I need a input-text box, I like to response the "on_change" javascript event > with a python code. I will like to able to do something like this > > > ## create a test input text box > input_style = {"width":"240px"} > i1 = vis.InputWidget(name = "input_1", > parent = "plot_area", > style = input_style, > value = "try this out", > vis = vis_display) > > def onchange(self, *argv, **kwargv): > self.update_value() > > vis.set_action(i1, "onchange", onchange) > > And when the event "onchange" of the input-text html element is trigger, the "sefl.update_value()" python code is executed. > > > It is totally possible to do such thing in the current 0.13-dev using the current ipython websocket/zmq channel. > I have to monkey patched a numbers of thing on intercepting io_pub message that is not originally from > a code_cell. With those patches, one can create any html based visualization with one's favorite > javascript library. > > (A notebook that I am working on can be download from https://github.com/cschin/IPython-Notebook---d3.js-mashup/blob/master/inb_vis_widget_exp.ipynb , It has the instruction on how to monkey patch the 0.13-dev to > make it work. I will write more about this later too.) > > > > > > > > > > > > > > > From satra at mit.edu Tue Mar 27 07:49:46 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Tue, 27 Mar 2012 06:49:46 -0500 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: hi brian, I don't think so - delete and cut are separate everywhere else for a > reason. If you cut one cell then delete another, it would be pretty > distressing to find that what you deleted actually clobbered your clipboard. > now that i know that x,c,v exist, i completely agree with min that delete should be left alone. cheers, satra > > -MinRK > > >> >> cheers, >> > >> > satra >> > >> > On Mon, Mar 26, 2012 at 10:54 PM, Brian Granger >> wrote: >> >> >> >> Not quite yet. We almost have the infrastructure to implement that >> >> though. One thing you can do in the meantime is to use Cut Cell >> >> rather than delete cell. Cut cell puts the deletes the cell and puts >> >> it on the clipboard. Then you can paste it somewhere else. >> >> >> >> On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: >> >> > hi all, >> >> > >> >> > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s >> trigger >> >> > happy), is there any way to undelete it? (or in general is there >> >> > undo-redo?) >> >> > >> >> > cheers, >> >> > >> >> > satra >> >> > >> >> > _______________________________________________ >> >> > 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 >> >> 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 >> > >> > >> > >> > _______________________________________________ >> > 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 >> 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 >> > > > _______________________________________________ > 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 ellisonbg at gmail.com Tue Mar 27 12:33:10 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 27 Mar 2012 09:33:10 -0700 Subject: [IPython-dev] anyway to undelete a cell In-Reply-To: References: Message-ID: OK sounds good. On Tue, Mar 27, 2012 at 4:49 AM, Satrajit Ghosh wrote: > hi brian, > >> I don't think so - delete and cut are separate everywhere else for a >> reason. ?If you cut one cell then delete another, it would be pretty >> distressing to find that what you deleted actually clobbered your clipboard. > > > now that i know that x,c,v exist, i completely agree with min that delete > should be left alone. > > cheers, > > satra > > >> >> >> -MinRK >> >>> >>> >>> ?cheers, >>> > >>> > satra >>> > >>> > On Mon, Mar 26, 2012 at 10:54 PM, Brian Granger >>> > wrote: >>> >> >>> >> Not quite yet. ?We almost have the infrastructure to implement that >>> >> though. ?One thing you can do in the meantime is to use Cut Cell >>> >> rather than delete cell. ?Cut cell puts the deletes the cell and puts >>> >> it on the clipboard. ?Then you can paste it somewhere else. >>> >> >>> >> On Mon, Mar 26, 2012 at 8:15 PM, Satrajit Ghosh wrote: >>> >> > hi all, >>> >> > >>> >> > if i delete a cell by mistake and hit ctrl+s (because i'm ctrl+s >>> >> > trigger >>> >> > happy), is there any way to undelete it? (or in general is there >>> >> > undo-redo?) >>> >> > >>> >> > cheers, >>> >> > >>> >> > satra >>> >> > >>> >> > _______________________________________________ >>> >> > 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 >>> >> 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 >>> > >>> > >>> > >>> > _______________________________________________ >>> > 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 >>> 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 >> >> >> >> _______________________________________________ >> 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 > -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From ellisonbg at gmail.com Tue Mar 27 15:33:53 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 27 Mar 2012 12:33:53 -0700 Subject: [IPython-dev] Client configuration and vim integration for notebook In-Reply-To: <403C037A-5073-4D9D-A4D8-C0ED973484B1@dalejung.com> References: <19984378-9655-45C7-A602-C75C5755F7E3@dalejung.com> <712CB595-AC78-4AC9-8B8E-F0D947D8DBD9@dalejung.com> <403C037A-5073-4D9D-A4D8-C0ED973484B1@dalejung.com> Message-ID: On Mon, Mar 26, 2012 at 8:18 PM, Dale Jung wrote: > >>> Kind of. I'm syncing the vim cell binding with the notebook. When the cell is in normal mode, I am making use of additional notebook level bindings. >> >> So this actually does bring to mind some plans that we have for the >> notebook. ?Currently, when a cell is selected, the text area is active >> and typing will affect the text area. ?IOW, a cell can't be selected >> without being in "edit" mode. ?We plan on relaxing that so when a cell >> is initially selected, it is not in edit mode. ?In that mode, we will >> have new keyboard bindings that are notebook level and will probably >> be similar to the type of thing you are doing. ?As you point out, the >> nice thing about this approach is that you can use very simple >> keyboard shortcuts (like j,k,i, etc.). ?When a cell is selected, you >> can enter edit mode and then the text area of that cell will behave in >> the usual manner with emacs or vim bindings. >> >> But in my mind, the vim/emacs stuff should not bleed out into the >> non-edit notebook mode. >> >>> So once you exit out of editing a cell (esc) you can use vim commands to move around the text area and do notebook level commands. >> >> I don't think these two things should be done in the same mode. ?The >> reason is that it means the notebook level command have to be built >> around the existing vim infrastructure. ?Using vim command for moving >> around the text area should be a completely separate mode from >> notebook level commands. ?Here is a sketch of what I am thinking: >> >> For emacs bindings there would be two modes: >> >> * Notebook level command mode that allows you to perform cell/notebook >> level actions. >> * Text edit mode for an editing a single cell's text using emacs style bindings. >> >> For vim bindings there would be three modes: >> >> * Notebook level command mode that allows you to perform cell/notebook >> level actions. ?The keyboard shortcuts in this mode would match those >> in the emacs scenario exactly. ?That is the keybindings have nothing >> to do with emacs or vim. >> * vim normal mode for a single selected cell. >> * vim insert mode for a sigle selected cell. >> >> This probably looks confusing, but vim is confusing ;-) >> >> My goal in all of this is to have uniform notebook level keyboard >> shortcuts that apply regardless of which keybindings are used to edit >> single text areas. > > That's how I originally approached it. I think having a notebook-level normal mode is good for emacs/default since going into cell mode drops you directly into edit. OK. > I found the 3 levels of vim confusing. To be honest, I don't know if that's because of the three levels specifically or my first pass at it. The main issue was that going from notebook-normal mode to cell-edit mode took two shortcuts. You'd have to press 'i' twice to get into cell-edit, and esc twice to get back into notebook-normal. Potentially, this could be fixed by going directly into cell-edit form notebook-normal. Or maybe two types of cell-mode entry shortcuts. I don't know. I abandoned it fairly quickly. I can imagine it would be confusing, I can't handle the two modes of vim. > God, I just realized how confusing it is trying to articulate vim modes. We vimmers must be crazy. No comment ;-) > >> >>> >>>> Here is a bit more background on the issue of keybindings: >>>> >>>> * There are two sets of keybindings in the notebook. ?The first is >>>> notebook level ones, that manage cell level actions. ?Most of these >>>> show up when you view the keyboard shortcuts in the help. ?The second >>>> set of keybindings are active when a cell is being edited. ?Things >>>> like tab completion are handled by these. >>>> * There can be very subtle interactions between these two sets of key >>>> bindings. ?The current bindings are finely tuned to deal with these >>>> issues. >>>> * All keybindings we use must be free of conflicts on all browsers >>>> (Chrome, FF, Safari) on all operating systems. ?This means that many >>>> shortcuts you would like to use cannot be used because they are taken. >>>> This is why we went with the ctrl-m prefix for all notebook level >>>> shortcuts as it doesn't conflict. >>> > > I think this is going to have to be easily configurable. Since the shortcut logic is really just a giant switch/ifelse statement, people will end up editing the source if it's not configurable. Especially as people start consistently using notebook in their workflow. Personally, I use a kinesis keyboard and don't have control key mapped to a convenient button since I'm on a mac. It just doesn't feel naturally to use it. So I've mapped commands to meta+key. It is not just a giant switch statement though. Because of the way events propagate in the browser, multiple DOM elements can end up handling a single event. When a cell div is in focus, we have to do additional logic to deal with the fact that both the notebook and cell are handling the same events. It took us a very long time of chasing down extremely subtle bugs to nail this logic. If we allow people to configure their keyboard shortcuts in arbitrary ways, that logic won't be right and the notebook will break. Personally, I think it is more important that the notebook has a single, extremely good set of keyboard shortcuts than it is to have configurable keyboard shortcuts. We do need to improve what we have and I think the improvements I describe above would get us closer. I will admit that this discussion is getting into a philosophical design issue that I feel strong about. I don't think good design requires a high degree of configurability. In fact I would say that much of the time, configurability is used to cover up poor design and an inability of developers to get it really right. In that light I don't think our current keyboard bindings are that great. They definitely need improvement and we are committed to doing that. > I know I know. A mac kinesis-using vimmer, it's pretty obviously I'm particular about keystrokes. >>>> * Because of a) the subtle interactions between cell and notebook >>>> level bindings and b) the lack of available keyboard shortcuts in >>>> modern browsers, the notebook will not ever have ultra-configurable >>>> keyboard shortcuts. > > That's where I disagree. If I'm using the notebook then I'm using the notebook and not the browser. In fact, I run the notebook in safari where my primary browser is chrome. I have keybindings that conflict with browser bindings. I understand that ipython can't assume it's okay to take over a shortcut, but I should be able to make that choice. > > I wonder if making a webkit embedded console app is feasible. That's pretty much how I run my safari notebook, no location/toolbars. I would imagine it would be, but we haven't thought about that yet. > btw, I love ipthon notebook but it's weird that I do so much dev work from within a web browser. Especially since I've always prided myself on using terminal/vim and eschewing those fancy GUI text editors. Craziness. Glad you like it. I consider it a huge milestone for us that we can get hardcore vim/emacs users to use the notebook. It is a tough crowd to please and I know we have a ways to go... Cheers, Brian > > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From matthew.brett at gmail.com Tue Mar 27 20:30:06 2012 From: matthew.brett at gmail.com (Matthew Brett) Date: Tue, 27 Mar 2012 17:30:06 -0700 Subject: [IPython-dev] zmq fork In-Reply-To: <4F7133B3.2000702@creativetrax.com> References: <4F7133B3.2000702@creativetrax.com> Message-ID: Hi, On Mon, Mar 26, 2012 at 8:27 PM, Jason Grout wrote: > I just noticed that some of the main developers of zeromq forked zeromq > to create the "Crossroads" project [1]. ?Does anyone have any idea how > this affects IPython (or are people just waiting and seeing what happens > at this point)? I wrote a little history of the fork for my own interest; I'd be grateful to hear whether I have summarized events correctly: http://nipyworld.blogspot.com/2012/03/fresh-fork.html See you, Matthew From ellisonbg at gmail.com Tue Mar 27 20:42:37 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 27 Mar 2012 17:42:37 -0700 Subject: [IPython-dev] zmq fork In-Reply-To: References: <4F7133B3.2000702@creativetrax.com> Message-ID: Very nice summary! On Tue, Mar 27, 2012 at 5:30 PM, Matthew Brett wrote: > Hi, > > On Mon, Mar 26, 2012 at 8:27 PM, Jason Grout > wrote: >> I just noticed that some of the main developers of zeromq forked zeromq >> to create the "Crossroads" project [1]. ?Does anyone have any idea how >> this affects IPython (or are people just waiting and seeing what happens >> at this point)? > > I wrote a little history of the fork for my own interest; I'd be > grateful to hear whether I have summarized events correctly: > > http://nipyworld.blogspot.com/2012/03/fresh-fork.html > > See you, > > Matthew > _______________________________________________ > 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 bgranger at calpoly.edu and ellisonbg at gmail.com From jrocher at enthought.com Thu Mar 29 14:08:55 2012 From: jrocher at enthought.com (Jonathan Rocher) Date: Thu, 29 Mar 2012 13:08:55 -0500 Subject: [IPython-dev] [BUG] stdout issue in qtconsole Message-ID: Dear all, I am observing an issue on the qtconsole. I am happy to file a bug if it is indeed a new one. I couldn't find a filed bug that describe the same thing though I may have missed it. I am running ipython from a version of the trunk that is 2 days old. When I run the simple code below (needs traits), and modify in the UI the filename field, I do NOT get the output to the console from the print statement due to the fact that the filename has changed at the first key stroke. And I get TWO at the second key stroke. This may sound like a minor issue but in a more realistic situation (module available upon request), the same issue evolves into a delay on every key stroke, the last one being always held by ipython. This can be disturbing when developing, if people use print statements to debug. When exiting the qtconsole after running the larger version of the module triggering the issue I also got the following error message (nothing more oddly enough): Exception in thread Thread-2 (most likely raised during interpreter shutdown):Exception in thread Thread-3 (most likely raised during interpreter shutdown): Traceback (most recent call last):Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/threading.py", line 552, in __bootstrap_inner File "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", line 441, in run File "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", line 121, in _run_loop File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 300, in start Let me know if you have questions or if I can go ahead and file this bug. Best, Jonathan ########################## IOLOOP_ISSUE MODULE ############################## """ Displays a stdout issue in ipython qtconsole trunk. Modifying the filename doesn't trigger a print statement. The second key stroke triggers 2. """ from traits.api import HasTraits, Str class ExerciseShell(HasTraits): """ Build a new ipython notebook with extended metadata to contain a CanopyExercise. """ filename = Str() def _filename_changed(self): print "filename changed!" if __name__ == "__main__": e = ExerciseShell() e.configure_traits() ################################### EOF ######################################## -- Jonathan Rocher, PhD Scientific software developer Enthought, Inc. jrocher at enthought.com 1-512-536-1057 http://www.enthought.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Thu Mar 29 14:31:05 2012 From: benjaminrk at gmail.com (MinRK) Date: Thu, 29 Mar 2012 11:31:05 -0700 Subject: [IPython-dev] [BUG] stdout issue in qtconsole In-Reply-To: References: Message-ID: On Thu, Mar 29, 2012 at 11:08, Jonathan Rocher wrote: > Dear all, > > I am observing an issue on the qtconsole. I am happy to file a bug if it > is indeed a new one. I couldn't find a filed bug that describe the same > thing though I may have missed it. > > I am running ipython from a version of the trunk that is 2 days old. > > When I run the simple code below (needs traits), and modify in the UI the > filename field, I do NOT get the output to the console from the print > statement due to the fact that the filename has changed at the first key > stroke. And I get TWO at the second key stroke. This may sound like a minor > issue but in a more realistic situation (module available upon request), > the same issue evolves into a delay on every key stroke, the last one being > always held by ipython. This can be disturbing when developing, if people > use print statements to debug. > This is a matter of sys.stdout.flush(). Just like `print` in regular Python/IPython does not write to the terminal until sys.stdout.flush() is called, stdout messages are not published to frontends until then as well. I can't tell you *why* the internals of Python are not calling flush on the first print but are on the rest, but the answer if you want to ensure that print statements happen immediately is always: call sys.stdout.flush() yourself. This is true in all Python programs, but seems to come up more often in the IPython kernel. > > When exiting the qtconsole after running the larger version of the module > triggering the issue I also got the following error message (nothing more > oddly enough): > Exception in thread Thread-2 (most likely raised during interpreter > shutdown):Exception in thread Thread-3 (most likely raised during > interpreter shutdown): > Traceback (most recent call last):Traceback (most recent call last): > File > "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/threading.py", > line 552, in __bootstrap_inner > File > "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", > line 441, in run > File > "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", > line 121, in _run_loop > File > "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", > line 300, in start This is probably not a real issue, just a result of Python shutdown cleaning up namespaces too aggressively so that the code that silences clean-exit exceptions has been removed before the background threads can use it. I don't know how to clean this up, but it's not anything other than a cosmetic issue at shutdown. -MinRK > > > Let me know if you have questions or if I can go ahead and file this bug. > > Best, > Jonathan > > > ########################## IOLOOP_ISSUE MODULE > ############################## > > """ Displays a stdout issue in ipython qtconsole trunk. Modifying the > filename > > doesn't trigger a print statement. The second key stroke triggers 2. > > """ > > from traits.api import HasTraits, Str > > class ExerciseShell(HasTraits): > > """ Build a new ipython notebook with extended metadata to contain a > > CanopyExercise. > > """ > > filename = Str() > > def _filename_changed(self): > > print "filename changed!" > > if __name__ == "__main__": > > e = ExerciseShell() > > e.configure_traits() > > ################################### EOF > ######################################## > > > -- > Jonathan Rocher, PhD > Scientific software developer > Enthought, Inc. > jrocher at enthought.com > 1-512-536-1057 > http://www.enthought.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 jrocher at enthought.com Thu Mar 29 21:33:42 2012 From: jrocher at enthought.com (Jonathan Rocher) Date: Thu, 29 Mar 2012 20:33:42 -0500 Subject: [IPython-dev] [BUG] stdout issue in qtconsole In-Reply-To: References: Message-ID: Dear Benjamin, Thanks for your answer. My point is that this behavior of delaying or holding the output doesn't happen in python or regular ipython only in qtconsole. Requesting that people call sys.stdout.flush is fine for people who's job it is to build code, though still annoying IMHO. But it is too much to ask many python users. My understanding is that ipython's goal is to lower the barrier of entry, and allow python to compete with matlab and mathematica on the simplicity and interactivity. In that respect, I feel like if there is something to be found about what is holding the output from being flushed, it would be great to find it. Best, Jonathan On Thu, Mar 29, 2012 at 1:31 PM, MinRK wrote: > > > On Thu, Mar 29, 2012 at 11:08, Jonathan Rocher wrote: > >> Dear all, >> >> I am observing an issue on the qtconsole. I am happy to file a bug if it >> is indeed a new one. I couldn't find a filed bug that describe the same >> thing though I may have missed it. >> >> I am running ipython from a version of the trunk that is 2 days old. >> >> When I run the simple code below (needs traits), and modify in the UI the >> filename field, I do NOT get the output to the console from the print >> statement due to the fact that the filename has changed at the first key >> stroke. And I get TWO at the second key stroke. This may sound like a minor >> issue but in a more realistic situation (module available upon request), >> the same issue evolves into a delay on every key stroke, the last one being >> always held by ipython. This can be disturbing when developing, if people >> use print statements to debug. >> > > This is a matter of sys.stdout.flush(). Just like `print` in regular > Python/IPython does not write to the terminal until sys.stdout.flush() is > called, stdout messages are not published to frontends until then as well. > I can't tell you *why* the internals of Python are not calling flush on > the first print but are on the rest, but the answer if you want to ensure > that print statements happen immediately is always: call sys.stdout.flush() > yourself. This is true in all Python programs, but seems to come up more > often in the IPython kernel. > > >> >> When exiting the qtconsole after running the larger version of the module >> triggering the issue I also got the following error message (nothing more >> oddly enough): >> Exception in thread Thread-2 (most likely raised during interpreter >> shutdown):Exception in thread Thread-3 (most likely raised during >> interpreter shutdown): >> Traceback (most recent call last):Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/threading.py", >> line 552, in __bootstrap_inner >> File >> "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", >> line 441, in run >> File >> "/Users/jrocher/Projects/Ipython_trunk/ipython/IPython/zmq/kernelmanager.py", >> line 121, in _run_loop >> File >> "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", >> line 300, in start > > > This is probably not a real issue, just a result of Python shutdown > cleaning up namespaces too aggressively so that the code that silences > clean-exit exceptions has been removed before the background threads can > use it. I don't know how to clean this up, but it's not anything other > than a cosmetic issue at shutdown. > > -MinRK > > >> >> >> Let me know if you have questions or if I can go ahead and file this bug. >> >> Best, >> Jonathan >> >> >> ########################## IOLOOP_ISSUE MODULE >> ############################## >> >> """ Displays a stdout issue in ipython qtconsole trunk. Modifying the >> filename >> >> doesn't trigger a print statement. The second key stroke triggers 2. >> >> """ >> >> from traits.api import HasTraits, Str >> >> class ExerciseShell(HasTraits): >> >> """ Build a new ipython notebook with extended metadata to contain a >> >> CanopyExercise. >> >> """ >> >> filename = Str() >> >> def _filename_changed(self): >> >> print "filename changed!" >> >> if __name__ == "__main__": >> >> e = ExerciseShell() >> >> e.configure_traits() >> >> ################################### EOF >> ######################################## >> >> >> -- >> Jonathan Rocher, PhD >> Scientific software developer >> Enthought, Inc. >> jrocher at enthought.com >> 1-512-536-1057 >> http://www.enthought.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 > > -- Jonathan Rocher, PhD Scientific software developer Enthought, Inc. jrocher at enthought.com 1-512-536-1057 http://www.enthought.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvierine at gmail.com Thu Mar 29 21:57:34 2012 From: jvierine at gmail.com (Juha Vierinen) Date: Fri, 30 Mar 2012 01:57:34 +0000 Subject: [IPython-dev] "master listing" feature request for ipython notebook Message-ID: Hi, Here is an idea: create one master server that sits on a standardized port number and contains a list of all notebooks on the filesystem (e.g., by scanning using the find command, or some other more cross-platform alternative). By clicking a link, ipython notebook will launch in this directory and allow you to start working on your notebook. I'm new to ipython notebook, but I like it a lot. I am planning to move from R to ipython because I like the notebook feature so much. I've been using ipython for the last week, only going back to R just a few times to run some old code. juha From walter at livinglogic.de Fri Mar 30 07:14:52 2012 From: walter at livinglogic.de (=?UTF-8?B?V2FsdGVyIETDtnJ3YWxk?=) Date: Fri, 30 Mar 2012 13:14:52 +0200 Subject: [IPython-dev] _repr_pretty_() for dict subclasses In-Reply-To: References: <4F6CADE9.9030001@livinglogic.de> Message-ID: <4F7595AC.3070607@livinglogic.de> On 23.03.12 18:24, Robert Kern wrote: > On 3/23/12 5:07 PM, Walter D?rwald wrote: >> Hello all! >> >> I'm currently experimenting with the new pretty printing framework. It >> seems there's a problem with the _repr_pretty_ method in dict subclasses: >> >> [...] >> >> The proper solution would probably be to walk the mro and see if there's >> either a registered printer or a _repr_pretty_ method for the class. >> However I'm not sure if there's a reliable way to check whether a method >> is implemented in the class itself or inherited from any of the base >> classes. > > It will be in the __dict__ of the class that defines it. The algorithm should > probably be: > > 1. Try to find registered singleton printers for the type. > 2. Walk up the MRO: > a. Look in type_printers for the current class. > b. Then look for _repr_pretty_ in the current class's __dict__. OK, I have a patch ready for this: https://github.com/ipython/ipython/pull/1535 Servus, Walter From ellisonbg at gmail.com Fri Mar 30 12:29:51 2012 From: ellisonbg at gmail.com (Brian Granger) Date: Fri, 30 Mar 2012 09:29:51 -0700 Subject: [IPython-dev] "master listing" feature request for ipython notebook In-Reply-To: References: Message-ID: <3A319E6E-CF9E-4489-84E7-0DD4F952EFEF@gmail.com> Sent from my iPad On Mar 29, 2012, at 6:57 PM, Juha Vierinen wrote: > Hi, > > Here is an idea: create one master server that sits on a standardized > port number and contains a list of all notebooks on the filesystem > (e.g., by scanning using the find command, or some other more > cross-platform alternative). By clicking a link, ipython notebook will > launch in this directory and allow you to start working on your > notebook. > We are working on making the notebook server aware of multiple directories. You will be able to browse through the file system and open notebooks in different locations. > I'm new to ipython notebook, but I like it a lot. I am planning to > move from R to ipython because I like the notebook feature so much. > I've been using ipython for the last week, only going back to R just a > few times to run some old code. > Great! Cheers, Brian > juha > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From edreamleo at gmail.com Fri Mar 30 12:57:00 2012 From: edreamleo at gmail.com (Edward K. Ream) Date: Fri, 30 Mar 2012 11:57:00 -0500 Subject: [IPython-dev] Help converting IPython.ipapi calls Message-ID: Hello all, Several years ago Ville Vainio wrote some great glue code that allowed IPython and Leo to work together. This was a spectacular success: http://webpages.charter.net/edreamleo/IPythonBridge.html I'd like to update this code to run with the new IPython code base. Please help convert IPython.ipapi calls into equivalent code. Let's start with something basic. What is the equivalent to:: session = IPython.ipapi.make_session() Thanks. Edward ------------------------------------------------------------------------------ Edward K. Ream email: edreamleo at gmail.com Leo: http://webpages.charter.net/edreamleo/front.html ------------------------------------------------------------------------------ From fperez.net at gmail.com Sat Mar 31 17:59:22 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 31 Mar 2012 14:59:22 -0700 Subject: [IPython-dev] "master listing" feature request for ipython notebook In-Reply-To: References: Message-ID: On Thu, Mar 29, 2012 at 6:57 PM, Juha Vierinen wrote: > > I'm new to ipython notebook, but I like it a lot. I am planning to > move from R to ipython because I like the notebook feature so much. > I've been using ipython for the last week, only going back to R just a > few times to run some old code. Music to our ears :) If you have R experience, you should definitely look at Pandas http://code.google.com/p/pandas/. Wes, the Pandas lead author, is doing an outstanding job with bringing R-like data analysis capabilities to Python and can use all the help others can provide in further developing Pandas. Cheers, f From fperez.net at gmail.com Sat Mar 31 18:04:04 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 31 Mar 2012 15:04:04 -0700 Subject: [IPython-dev] [BUG] stdout issue in qtconsole In-Reply-To: References: Message-ID: On Thu, Mar 29, 2012 at 6:33 PM, Jonathan Rocher wrote: > In that respect, I feel like if there is something to be found about what is > holding the output from being flushed, it would be great to find it. We have noticed indeed that manual stdout flushing seems to be more of an issue when kernels are connected over zmq than when they are directly attached to a terminal (the 'classic' ipython). But unfortunately I don't know the low-level stdout buffering code in Python well enough to say why this is the case, nor has any of us figured it out yet. If anyone has any clues as to why this issue is present, and whether there's anything we can do from the python side (that is not putting something awful like a sys.stdout.flush();time.sleep(0.1) call in a background thread :), we'd certainly love to know. Cheers, f From satra at mit.edu Sat Mar 31 18:21:35 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 31 Mar 2012 18:21:35 -0400 Subject: [IPython-dev] saving/loading py files Message-ID: hi, i'm giving a tutorial on monday and realized that at a certain stage of my tutorial i will have to jump out of the notebook to create a file and define a function and then continue in the notebook running the file with 'run'. (the reason is that the inspect module needs to find the function, so i can't simply define it in a separate cell). for now i can do something like the following to save the contents of a cell: --- with open('test.py', 'wt') as fp: fp.writelines(_i1) new cell: run test.py --- some questions regarding this approach: - is there already some quicker way to achieve this? - instead of _iX, could i use some variable to indicate the previous spatial located cell? - is there a way i can load a py file into a cell? this allows me to essentially use the notebook from an remote browser (kind of like an ide). especially give codemirror's capabilities, i can do a lot! cheers, satra -------------- next part -------------- An HTML attachment was scrubbed... URL: From takowl at gmail.com Sat Mar 31 18:29:05 2012 From: takowl at gmail.com (Thomas Kluyver) Date: Sat, 31 Mar 2012 23:29:05 +0100 Subject: [IPython-dev] saving/loading py files In-Reply-To: References: Message-ID: On 31 March 2012 23:21, Satrajit Ghosh wrote: > (the reason is that the inspect module needs to find the function, so i > can't simply define it in a separate cell). The inspect module should be able to find code in cells, so let us know if that doesn't work. > - is there already some quicker way to achieve this? The %save magic should do it: %save test.py 1 Thomas From fperez.net at gmail.com Sat Mar 31 18:30:55 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 31 Mar 2012 15:30:55 -0700 Subject: [IPython-dev] saving/loading py files In-Reply-To: References: Message-ID: On Sat, Mar 31, 2012 at 3:21 PM, Satrajit Ghosh wrote: > - is there a way i can load a py file into a cell? %loadpy does that. BTW, we have talked about adding an option to open a sinngle-file CodeMirror tab, to make the process you're talking about easier and more natural. We just haven't had the time to get to it... Cheers, f From satra at mit.edu Sat Mar 31 18:50:02 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 31 Mar 2012 18:50:02 -0400 Subject: [IPython-dev] saving/loading py files In-Reply-To: References: Message-ID: hi thomas and fernando, inspect works fine with functions defined in a cell! %save works fine if the file doesn't already exist %loadpy works! thanks very much. cheers, satra On Sat, Mar 31, 2012 at 6:29 PM, Thomas Kluyver wrote: > On 31 March 2012 23:21, Satrajit Ghosh wrote: > > (the reason is that the inspect module needs to find the function, so i > > can't simply define it in a separate cell). > > The inspect module should be able to find code in cells, so let us > know if that doesn't work. > > > - is there already some quicker way to achieve this? > > The %save magic should do it: %save test.py 1 > > 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 fperez.net at gmail.com Sat Mar 31 19:03:39 2012 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 31 Mar 2012 16:03:39 -0700 Subject: [IPython-dev] saving/loading py files In-Reply-To: References: Message-ID: On Sat, Mar 31, 2012 at 3:50 PM, Satrajit Ghosh wrote: > %save works fine if the file doesn't already exist Unfortunately it asks for confirmation to overwrite but doesn't have a -f switch. We wrote it when the nb didn't exist and we could assume that stdin was always available, but that's not true anymore. Now, we should instead add a -f switch, and detect the absence of raw_input and instead give a nice error message that suggests -f when used from the nb: https://github.com/ipython/ipython/issues/1542 Cheers, f From satra at mit.edu Sat Mar 31 19:07:36 2012 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 31 Mar 2012 19:07:36 -0400 Subject: [IPython-dev] saving/loading py files In-Reply-To: References: Message-ID: you bots are way too quick! cheers, satra On Sat, Mar 31, 2012 at 7:03 PM, Fernando Perez wrote: > On Sat, Mar 31, 2012 at 3:50 PM, Satrajit Ghosh wrote: > > %save works fine if the file doesn't already exist > > Unfortunately it asks for confirmation to overwrite but doesn't have a > -f switch. We wrote it when the nb didn't exist and we could assume > that stdin was always available, but that's not true anymore. Now, we > should instead add a -f switch, and detect the absence of raw_input > and instead give a nice error message that suggests -f when used from > the nb: > > https://github.com/ipython/ipython/issues/1542 > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: