From ipython at lonely-star.org Thu Dec 3 04:20:39 2009 From: ipython at lonely-star.org (Nathan Huesken) Date: Thu, 3 Dec 2009 10:20:39 +0100 Subject: [IPython-dev] Getting current list of breakpoints in "sync with editor" Message-ID: <20091203092039.GA10420@SamZwo.iwr.uni-heidelberg.de> Hi, I sent this mail to the ipython user mailing list already, but I figured this might be a better place to post. I want to syncronize breakpoints between my interactive ipdb in ipython and gvim. For this, I do in a file which I import with "import": ------------------------------------------------- def write_breakpoints(ip,filename=""): ... breakpoints=ip.InteractiveTB.pdb.get_all_breaks() ... #syncronize with the gvim editor def sync(ip,filename,linenum,column): ... write_breakpoints(ip) ... import IPython.ipapi ip=IPython.ipapi.get() ip.set_hook('synchronize_with_editor',sync) -------------------------------------------------- This seemed to work before. But now (I have not touched it for some time) it does not work anymore. The list of breakpoints is simply empty. How can I get the current pdb instance? How can I get its breakpoints within the sync-with-editor function? Thanks! Nathan From mattions at gmail.com Mon Dec 7 10:52:24 2009 From: mattions at gmail.com (Michele Mattioni) Date: Mon, 7 Dec 2009 15:52:24 +0000 Subject: [IPython-dev] Ipython 0.10 pygtk main loop Message-ID: <290ea1b00912070752j616ae6a9m2b55d38816556ea3@mail.gmail.com> Hello Ipython developers, I've upgraded from ubuntu jaunty to ubuntu karmic some days ago and now I can't use ipython anymore as I used to do before. The version I was using before was 0.9.1, what is shipped with karmic is 0.10. I wrote a program which use PyGTK[1] and Visual Python[2] and Ipython. Ipython is not Embedded but it's used as console to work with (a la pylab). I need to start the program in an interactive loop, and have the prompt back ready to process user input. With the 0.9.1 version I used to achieve this behaviour starting the console with the -pylab options, and I was using GTKAgg as my backend. With this version I was able to start to start the program, have the visual window displayed and working and the ipython prompt ready for other input. I think the problem is a thread issue. In my program it was possible to start a visual window clicking on a gtk button. Now I can't achieve this anymore. What has changed ? Is Ipython, PyGTK or both? I've attached a code example. [1] http://www.pygtk.org/ [2] http://vpython.org/ Cheers, Michele. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hellovisual.py Type: application/octet-stream Size: 1720 bytes Desc: not available URL: From gael.varoquaux at normalesup.org Mon Dec 7 11:06:23 2009 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Mon, 7 Dec 2009 17:06:23 +0100 Subject: [IPython-dev] Ipython 0.10 pygtk main loop In-Reply-To: <290ea1b00912070752j616ae6a9m2b55d38816556ea3@mail.gmail.com> References: <290ea1b00912070752j616ae6a9m2b55d38816556ea3@mail.gmail.com> Message-ID: <20091207160623.GA6519@phare.normalesup.org> On Mon, Dec 07, 2009 at 03:52:24PM +0000, Michele Mattioni wrote: > What has changed ? I am wondering if Ubuntu did not change the default backend for matplotlib. Try using 'ipython -pylab -gthread' to force GTK threads. HTH, Ga?l From Joseph.Sarbak at rbccm.com Mon Dec 7 11:08:08 2009 From: Joseph.Sarbak at rbccm.com (Sarbak, Joseph) Date: Mon, 7 Dec 2009 11:08:08 -0500 Subject: [IPython-dev] Does Ipython have the equivalent to the 'wait' keyword in bash? In-Reply-To: <2830FB43CE5B4249AE847CD1FE0458EE039C7668@SXGM-001.fg.rbc.com> References: <20091203092039.GA10420@SamZwo.iwr.uni-heidelberg.de> <2830FB43CE5B4249AE847CD1FE0458EE039C7668@SXGM-001.fg.rbc.com> Message-ID: <2830FB43CE5B4249AE847CD1FE0458EE039C766A@SXGM-001.fg.rbc.com> Hello, Firstly, I would like to state that Ipython is a wonderful interpreter, and I would like to use it as my shell. Thanks for your hard work. However, there is one question I have, for which I have tried to find a solution in the documentation. I haven't found any advice in the docs so, here goes... Just as in bash, I would like to launch multiple processes in the background and then at some point in the parent script, wait for the results. It is so easy to do in most shell languages. Example: #!/bin/bash task1& task2& task3& # do some other work wait echo "Done!" Would anyone be able to recommend a simple or even trivial way to perform the same parallelization work in ipython? I would like to be able to do this on the local node. No distributed processing is desired. Thank you. Joe Sarbak ________________________________________ This E-Mail (including any attachments) may contain privileged or confidential information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protections respecting this information. Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses. It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. However, it is the responsibility of the recipient to ensure that it is virus free. The sender accepts no responsibility for any loss or damage arising in any way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. IRS CIRCULAR 230 NOTICE: TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. From mattions at gmail.com Mon Dec 7 11:30:30 2009 From: mattions at gmail.com (Michele Mattioni) Date: Mon, 7 Dec 2009 16:30:30 +0000 Subject: [IPython-dev] Ipython 0.10 pygtk main loop In-Reply-To: <20091207160623.GA6519@phare.normalesup.org> References: <290ea1b00912070752j616ae6a9m2b55d38816556ea3@mail.gmail.com> <20091207160623.GA6519@phare.normalesup.org> Message-ID: <290ea1b00912070830p53f0c068x6cec00450a1cc5a9@mail.gmail.com> Hi Ga?l, I tried that but it seems the backend is correct. There is a strange disclaimer which is printend when ipython is started with the pylab (or gthread) options as shown on this bug: https://bugs.launchpad.net/ipython/+bug/270856 Can be that the case? On Mon, Dec 7, 2009 at 4:06 PM, Gael Varoquaux < gael.varoquaux at normalesup.org> wrote: > On Mon, Dec 07, 2009 at 03:52:24PM +0000, Michele Mattioni wrote: > > What has changed ? > > I am wondering if Ubuntu did not change the default backend for > matplotlib. Try using 'ipython -pylab -gthread' to force GTK threads. > > HTH, > > Ga?l > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Joseph.Sarbak at rbccm.com Thu Dec 10 08:41:34 2009 From: Joseph.Sarbak at rbccm.com (Sarbak, Joseph) Date: Thu, 10 Dec 2009 08:41:34 -0500 Subject: [IPython-dev] Does Ipython have the equivalent to the 'wait' keyword in bash? In-Reply-To: <2830FB43CE5B4249AE847CD1FE0458EE039C766A@SXGM-001.fg.rbc.com> References: <20091203092039.GA10420@SamZwo.iwr.uni-heidelberg.de> <2830FB43CE5B4249AE847CD1FE0458EE039C7668@SXGM-001.fg.rbc.com> <2830FB43CE5B4249AE847CD1FE0458EE039C766A@SXGM-001.fg.rbc.com> Message-ID: <2830FB43CE5B4249AE847CD1FE0458EE039C7678@SXGM-001.fg.rbc.com> Hello, Firstly, I would like to let you know that Ipython is a wonderful interpreter, and I would like to use it as my shell. Thanks for your hard work. However, there is one question I have, for which I have tried to find a solution in the documentation. I haven't found any advice in the docs so, here goes... Just as in bash, I would like to launch multiple processes in the background and then at some point in the parent script, wait for the results. It is so easy to do in most shell languages. Example: #!/bin/bash task1& task2& task3& # do some other work wait echo "Done!" Would anyone be able to recommend a simple or even trivial way to perform the same parallelization work in ipython? I would like to be able to do this on the local node. No distributed processing is desired. Thank you. Joe Sarbak ________________________________________ This E-Mail (including any attachments) may contain privileged or confidential information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protections respecting this information. Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses. It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. However, it is the responsibility of the recipient to ensure that it is virus free. The sender accepts no responsibility for any loss or damage arising in any way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. IRS CIRCULAR 230 NOTICE: TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. From eudoxos at arcig.cz Sun Dec 13 05:42:33 2009 From: eudoxos at arcig.cz (=?utf-8?b?VsOhY2xhdg==?= =?utf-8?b?xaBtaWxhdWVy?=) Date: Sun, 13 Dec 2009 10:42:33 +0000 (UTC) Subject: [IPython-dev] ipython sphinx directive References: <88e473830911061424y35e0d87bxc84eaa0763cd6d8c@mail.gmail.com> <20091107095102.GA2068@phare.normalesup.org> <88e473830911070721i22622c93g62ad2bd9c671eefc@mail.gmail.com> <88e473830911081018t312c61dbt1caac66eee6b5dcd@mail.gmail.com> <88e473830911081022q2e2af3a9i78df1a4213746dcc@mail.gmail.com> Message-ID: > > A demo document is included below, which is rendered at > > http://matplotlib.sourceforge.net/ipymode/_build/html/ipy_demo.html, > > and the ipython_directive is attached. Hi, I found your ipython_directive in your previous posts and use it very successfully for documenting yade (https://www.yade-dem.org/sphinx/). Thanks a lot!! Is the current version somewhere around (it is not in ipython bzr branch)? I would like to send some patches, concerning in particular custom in/out prompts [*] (the out prompt doesn't work, as you see in the output, btw), a way to (dis)allow commands that raise exception (so that sphinx aborts if there is exception from ipython code where it is not expected) and, finally, to have the possiblity of "raw" input (without the input prompt, and just input lines). [*] I change module-variables from the conf.py to achieve that: http://bazaar.launchpad.net/%7Eeudoxos/%2Bjunk/ydoc/annotate/head%3A/conf.py#L69 I also thought there should be some way to switch matplotlib figure format based on output (e.g. png/svg for html, but pdf for latex). Cheers, V?clav From jdh2358 at gmail.com Sun Dec 13 09:36:39 2009 From: jdh2358 at gmail.com (John Hunter) Date: Sun, 13 Dec 2009 08:36:39 -0600 Subject: [IPython-dev] ipython sphinx directive In-Reply-To: References: <88e473830911061424y35e0d87bxc84eaa0763cd6d8c@mail.gmail.com> <20091107095102.GA2068@phare.normalesup.org> <88e473830911070721i22622c93g62ad2bd9c671eefc@mail.gmail.com> <88e473830911081018t312c61dbt1caac66eee6b5dcd@mail.gmail.com> <88e473830911081022q2e2af3a9i78df1a4213746dcc@mail.gmail.com> Message-ID: <88e473830912130636tab7caa9k6daf950c412dba56@mail.gmail.com> On Sun, Dec 13, 2009 at 4:42 AM, V?clav?milauer wrote: >> > A demo document is included below, which is rendered at >> > http://matplotlib.sourceforge.net/ipymode/_build/html/ipy_demo.html, >> > and the ipython_directive is attached. > > Hi, I found your ipython_directive in your previous posts and use it very > successfully for documenting yade (https://www.yade-dem.org/sphinx/). > Thanks a lot!! > > Is the current version somewhere around (it is not in ipython bzr branch)? > I would like to send some patches, concerning in particular custom > in/out prompts [*] (the out prompt doesn't work, as you see in the output, > btw), a way to (dis)allow commands that raise exception (so that sphinx > aborts if there is exception from ipython code where it is not expected) > and, finally, to have the possiblity of "raw" input (without the input > prompt, and just input lines). The directive does not yet live in any public repo, but we can/should correct that fairly easily. I can add it to the mpl sphinxext for the time being, or would you rather it live in ipython bzr Fernando? Like pylab, it is currently a hybrid monster between ipython and pyplot. It does need some cleaning -- primarily we should factor out the pure ipython directive from the part that is mpl/pyplot aware, or at least set it up so it can run w/o mpl for folks who just want to the ipython part. The current version is also just for the 0.10 line and not ipython HEAD, so we need to figure out what branch it should be on, and eventually port it to the HEAD (or whatever it is you bzr types call the current development branch) Fernando and I made a few minor fixes and cleanups to this since I last posted it -- eg magics like 'cd' now work and there are some hacks to make @savefig work even as you change your current directory in ipython (@savefig always saves to _static). If you could incorporate your changes into the latest and then post a patch, that would be most helpful. I'm pretty sure the output prompt is formatted properly in the version I posted and the one attached here, so I'd like to clear up that problem before integrating your work. I knew someone would want a custom prompt -- I just didn't expect it so soon :-) Finally I should update sampledoc to discuss and document this, so it gets wider attention: http://matplotlib.sourceforge.net/sampledoc/ Thanks, JDH -------------- next part -------------- A non-text attachment was scrubbed... Name: ipython_directive.py Type: text/x-python Size: 14586 bytes Desc: not available URL: From eudoxos at arcig.cz Sun Dec 13 10:07:07 2009 From: eudoxos at arcig.cz (=?utf-8?b?VsOhY2xhdg==?= =?utf-8?b?xaBtaWxhdWVy?=) Date: Sun, 13 Dec 2009 15:07:07 +0000 (UTC) Subject: [IPython-dev] ipython sphinx directive References: <88e473830911061424y35e0d87bxc84eaa0763cd6d8c@mail.gmail.com> <20091107095102.GA2068@phare.normalesup.org> <88e473830911070721i22622c93g62ad2bd9c671eefc@mail.gmail.com> <88e473830911081018t312c61dbt1caac66eee6b5dcd@mail.gmail.com> <88e473830911081022q2e2af3a9i78df1a4213746dcc@mail.gmail.com> <88e473830912130636tab7caa9k6daf950c412dba56@mail.gmail.com> Message-ID: > The directive does not yet live in any public repo, but we can/should > correct that fairly easily. I can add it to the mpl sphinxext for the > time being, or would you rather it live in ipython bzr Fernando? Like > pylab, it is currently a hybrid monster between ipython and pyplot. > It does need some cleaning -- primarily we should factor out the pure > ipython directive from the part that is mpl/pyplot aware, or at least > set it up so it can run w/o mpl for folks who just want to the ipython > part. The current version is also just for the 0.10 line and not > ipython HEAD, so we need to figure out what branch it should be on, > and eventually port it to the HEAD (or whatever it is you bzr types > call the current development branch) We call it trunk, also ;-) I don't mind which repo it is in, I have no write access to either. > If you could > incorporate your changes into the latest and then post a patch, that > would be most helpful. For now, I just added rc_override as module variable, which can be overridden (as in the file I referenced in my last post); it is diff'ed against the version you just posted. --- ipython_directive.py.new.orig 2009-12-13 15:45:53.000000000 +0100 +++ ipython_directive.py 2009-12-13 15:59:48.838998325 +0100 @@ -21,6 +21,7 @@ COMMENT, INPUT, OUTPUT = range(3) +rc_override={} rgxin = re.compile('In \[(\d+)\]:\s?(.*)\s*') rgxout = re.compile('Out\[(\d+)\]:\s?(.*)\s*') fmtin = 'In [%d]:' @@ -145,7 +146,7 @@ argv, self.user_ns, self.user_glocal_ns, embedded=True, #shell_class=IPython.Shell.InteractiveShell, shell_class=MatplotlibShell, - rc_override=dict(colors = 'NoColor')) + rc_override=dict(colors = 'NoColor', **rc_override )) self.input = '' self.output = '' > I'm pretty sure the output prompt is formatted properly in the version > I posted and the one attached here, so I'd like to clear up that > problem before integrating your work. I knew someone would want a > custom prompt -- I just didn't expect it so soon It must be some problem on ipython's part... I don't put the Out lines to the block at all. As much as I try to override the output prompt, it doesn't do anything (input is overridden just fine, though); Yade has by default Yade [1]: input promps and ' -> [1]:' output prompts; it is no big deal, but I wanted to keep that in the docs the same. # in sphinx config file: import ipython_directive as id id.rgxin =re.compile(r'(?:In |Yade )\[(\d+)\]:\s?(.*)\s*') id.rgxout=re.compile(r'(?:Out| -> )\[(\d+)\]:\s?(.*)\s*') id.fmtin ='Yade [%d]:' id.fmtout=' -> [%d]:' id.rc_override=dict( prompt_in1="Yade [\#]:", prompt_in2=" .\D..", prompt_out=" -> [\#]:" ) import ipython_console_highlighting as ich ich.IPythonConsoleLexer.input_prompt= re.compile("(Yade \[[0-9]+\]: )|( \.\.\.+:)") ich.IPythonConsoleLexer.output_prompt= re.compile("(( -> )|(Out)\[[0-9]+\]: )|( \.\.\.+:)") ich.IPythonConsoleLexer.continue_prompt=re.compile(" \.\.\.+:") Cheers, Vaclav From gael.varoquaux at normalesup.org Sun Dec 13 18:55:50 2009 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Mon, 14 Dec 2009 00:55:50 +0100 Subject: [IPython-dev] [Ann] EuroScipy 2010 Message-ID: <20091213235550.GB27356@phare.normalesup.org> ========================== Announcing EuroScipy 2010 ========================== --------------------------------------------------- The 3rd European meeting on Python in Science --------------------------------------------------- **Paris, Ecole Normale Sup?rieure, July 8-11 2010** We are happy to announce the 3rd EuroScipy meeting, in Paris, July 2010. The EuroSciPy meeting is a cross-disciplinary gathering focused on the use and development of the Python language in scientific research. This event strives to bring together both users and developers of scientific tools, as well as academic research and state of the art industry. Important dates ================== ====================================== =================================== **Registration opens** Sunday March 29 **Paper submission deadline** Sunday May 9 **Program announced** Sunday May 22 **Tutorials tracks** Thursday July 8 - Friday July 9 **Conference track** Saturday July 10 - Sunday July 11 ====================================== =================================== Tutorial ========= There will be two tutorial tracks at the conference, an introductory one, to bring up to speed with the Python language as a scientific tool, and an advanced track, during which experts of the field will lecture on specific advanced topics such as advanced use of numpy, scientific visualization, software engineering... Main conference topics ======================== We will be soliciting talks on the follow topics: - Presentations of scientific tools and libraries using the Python language, including but not limited to: - Vector and array manipulation - Parallel computing - Scientific visualization - Scientific data flow and persistence - Algorithms implemented or exposed in Python - Web applications and portals for science and engineering - Reports on the use of Python in scientific achievements or ongoing projects. - General-purpose Python tools that can be of special interest to the scientific community. Keynote Speaker: Hans Petter Langtangen ========================================== We are excited to welcome Hans Petter Langtangen as our keynote speaker. - Director of scientific computing and bio-medical research at Simula labs, Oslo - Author of the famous book Python scripting for computational science http://www.springer.com/math/cse/book/978-3-540-73915-9 -- Ga?l Varoquaux, conference co-chair Nicolas Chauvat, conference co-chair Program committee ................. Romain Brette (ENS Paris, DEC) Mike M?ller (Python Academy) Christophe Pradal (CIRAD/INRIA, DigiPlantes team) Pierre Raybault (CEA, DAM) Jarrod Millman (UC Berkeley, Helen Wills NeuroScience institute) From fperez.net at gmail.com Mon Dec 14 16:08:35 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 14 Dec 2009 13:08:35 -0800 Subject: [IPython-dev] ipython sphinx directive In-Reply-To: References: <88e473830911061424y35e0d87bxc84eaa0763cd6d8c@mail.gmail.com> <20091107095102.GA2068@phare.normalesup.org> <88e473830911070721i22622c93g62ad2bd9c671eefc@mail.gmail.com> <88e473830911081018t312c61dbt1caac66eee6b5dcd@mail.gmail.com> <88e473830911081022q2e2af3a9i78df1a4213746dcc@mail.gmail.com> <88e473830912130636tab7caa9k6daf950c412dba56@mail.gmail.com> Message-ID: Hey, On Sun, Dec 13, 2009 at 7:07 AM, V?clav?milauer wrote: > >> The directive does not yet live in any public repo, but we can/should >> correct that fairly easily. ?I can add it to the mpl sphinxext for the >> time being, or would you rather it live in ipython bzr Fernando? ?Like >> pylab, it is currently a hybrid monster between ipython and pyplot. >> It does need some cleaning -- primarily we should factor out the pure >> ipython directive from the part that is mpl/pyplot aware, or at least >> set it up so it can run w/o mpl for folks who just want to the ipython >> part. ? The current version is also just for the 0.10 line and not >> ipython HEAD, so we need to figure out what branch it should be on, >> and eventually port it to the HEAD (or whatever it is you bzr types >> call the current development branch) > We call it trunk, also ;-) I don't mind which repo it is in, I have no > write access to either. > >> If you could >> incorporate your changes into the latest and then post a patch, that >> would be most helpful. > > For now, I just added rc_override as module variable, which can > be overridden (as in the file I referenced in my last post); it > is diff'ed against the version you just posted. Thanks! I've added this to a new branch I just made: https://code.launchpad.net/~ipython-dev/ipython/0.10.1 We'll need to release 0.10.1 at some point, at the very least with the argparse updates that make it fully BSD compatible as well as any other small fixes we may have around, because of the api changes for 0.11. This will serve as development for any such small fixes until we're ready to release 0.10.1 Cheers, f From matthew.brett at gmail.com Tue Dec 15 13:43:10 2009 From: matthew.brett at gmail.com (Matthew Brett) Date: Tue, 15 Dec 2009 13:43:10 -0500 Subject: [IPython-dev] 'time' crash on Mac OSX Message-ID: <1e2af89e0912151043m6de70fdexecb7d537cec4a70a@mail.gmail.com> Hi, I am running the latest bzr on Mac OS X, and I'm getting this: blair:~ mb312$ ipython Python 2.6.4 (r264:75706, Nov 29 2009, 00:03:57) Type "copyright", "credits" or "license" for more information. IPython 0.11.bzr.r1205 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: time print 'hello world' ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 1606, in magic return result File "/Users/mb312/usr/local/lib/python2.6/contextlib.py", line 34, in __exit__ self.gen.throw(type, value, traceback) File "/Users/mb312/usr/local/lib/python2.6/contextlib.py", line 113, in nested yield vars File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 1605, in magic result = fn(magic_args) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/magic.py", line 1928, in magic_time expr = self.shell.prefilter(parameter_s,False) AttributeError: 'InteractiveShell' object has no attribute 'prefilter' I've appended the top of my build output. Have I missed a dependency somewhere? Thanks a lot, Matthew All changes applied successfully. Updated to revision 1217. ============================================================================ BUILDING IPYTHON python: 2.6.4 (r264:75706, Nov 29 2009, 00:03:57) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] platform: darwin OPTIONAL DEPENDENCIES Zope.Interface: yes Twisted: 9.0.0 /Users/mb312/usr/local/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated Foolscap: 0.4.2 OpenSSL: 0.10 sphinx: 0.6.3 pygments: 1.1.1 nose: 0.11.1 pexpect: no (required for running standalone doctests) running clean From ellisonbg.net at gmail.com Tue Dec 15 16:38:43 2009 From: ellisonbg.net at gmail.com (Brian Granger) Date: Tue, 15 Dec 2009 13:38:43 -0800 Subject: [IPython-dev] 'time' crash on Mac OSX In-Reply-To: <1e2af89e0912151043m6de70fdexecb7d537cec4a70a@mail.gmail.com> References: <1e2af89e0912151043m6de70fdexecb7d537cec4a70a@mail.gmail.com> Message-ID: <6ce0ac130912151338l12a0db21r7e1f96b0e4356986@mail.gmail.com> I think this is a bug, can you file a ticket for this so I don't forget it. I think this may already be fixed in a branch though. Thanks, Brian On Tue, Dec 15, 2009 at 10:43 AM, Matthew Brett wrote: > Hi, > > I am running the latest bzr on Mac OS X, and I'm getting this: > > blair:~ mb312$ ipython > Python 2.6.4 (r264:75706, Nov 29 2009, 00:03:57) > Type "copyright", "credits" or "license" for more information. > > IPython 0.11.bzr.r1205 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: time print 'hello world' > ------------------------------------------------------------ > Traceback (most recent call last): > File "", line 1, in > File > "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", > line 1606, in magic > return result > File "/Users/mb312/usr/local/lib/python2.6/contextlib.py", line 34, > in __exit__ > self.gen.throw(type, value, traceback) > File "/Users/mb312/usr/local/lib/python2.6/contextlib.py", line 113, in > nested > yield vars > File > "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", > line 1605, in magic > result = fn(magic_args) > File > "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/magic.py", > line 1928, in magic_time > expr = self.shell.prefilter(parameter_s,False) > AttributeError: 'InteractiveShell' object has no attribute 'prefilter' > > I've appended the top of my build output. > > Have I missed a dependency somewhere? > > Thanks a lot, > > Matthew > > > > All changes applied successfully. > Updated to revision 1217. > > ============================================================================ > BUILDING IPYTHON > python: 2.6.4 (r264:75706, Nov 29 2009, 00:03:57) [GCC > 4.2.1 (Apple Inc. build 5646) (dot 1)] > platform: darwin > > OPTIONAL DEPENDENCIES > Zope.Interface: yes > Twisted: 9.0.0 > > /Users/mb312/usr/local/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: > DeprecationWarning: the sets module is deprecated > Foolscap: 0.4.2 > OpenSSL: 0.10 > sphinx: 0.6.3 > pygments: 1.1.1 > nose: 0.11.1 > pexpect: no (required for running standalone doctests) > running clean > _______________________________________________ > 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 erik.tollerud at gmail.com Wed Dec 16 19:50:08 2009 From: erik.tollerud at gmail.com (Erik Tollerud) Date: Wed, 16 Dec 2009 16:50:08 -0800 Subject: [IPython-dev] Does Ipython have the equivalent to the 'wait' keyword in bash? In-Reply-To: <2830FB43CE5B4249AE847CD1FE0458EE039C7678@SXGM-001.fg.rbc.com> References: <20091203092039.GA10420@SamZwo.iwr.uni-heidelberg.de> <2830FB43CE5B4249AE847CD1FE0458EE039C7668@SXGM-001.fg.rbc.com> <2830FB43CE5B4249AE847CD1FE0458EE039C766A@SXGM-001.fg.rbc.com> <2830FB43CE5B4249AE847CD1FE0458EE039C7678@SXGM-001.fg.rbc.com> Message-ID: I'm not sure if there is any builtin ipython magic that does this, but one potential approach might be: import subprocess p1=subprocess.Popen('cmd1') p2=subprocess.Popen('cmd2') p3=subprocess.Popen('cmd3') #do your other stuff p1.wait() p2.wait() p3.wait() print 'Done!' On Thu, Dec 10, 2009 at 5:41 AM, Sarbak, Joseph wrote: > > > Hello, > > Firstly, I would like to let you know that Ipython is a wonderful > interpreter, and I would like to use it as my shell. Thanks for your > hard work. > > However, there is one question I have, for which I have tried to find a > solution in the documentation. ?I haven't found any advice in the docs > so, here goes... > > Just as in bash, I would like to launch multiple processes in the > background and then at some point in the parent script, wait for the > results. ?It is so easy to do in most shell languages. ?Example: > > ? ? ? ?#!/bin/bash > > ? ? ? ?task1& > ? ? ? ?task2& > ? ? ? ?task3& > > ? ? ? ?# do some other work > > ? ? ? ?wait > > ? ? ? ?echo "Done!" > > Would anyone be able to recommend a simple or even trivial way to > perform the same parallelization work in ipython? ?I would like to be > able to do this on the local node. ?No distributed processing is > desired. > > Thank you. > Joe Sarbak > ________________________________________ > > This E-Mail (including any attachments) may contain privileged or confidential information. ?It is intended only for the addressee(s) indicated above. > > The sender does not waive any of its rights, privileges or other protections respecting this information. > > Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. > > If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. > > This E-Mail (including any attachments) has been scanned for viruses. > > It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. > > However, it is the responsibility of the recipient to ensure that it is virus free. > > The sender accepts no responsibility for any loss or damage arising in any way from its use. > > E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. > > Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. > > IRS CIRCULAR 230 NOTICE: ?TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > From erik.tollerud at gmail.com Wed Dec 16 21:51:59 2009 From: erik.tollerud at gmail.com (Erik Tollerud) Date: Wed, 16 Dec 2009 18:51:59 -0800 Subject: [IPython-dev] Patch for broken debugger Message-ID: I decided to try out the bzr version of ipython again and it looks great except for continued problems using the %debug magic ... this time, instead of getting nothing, I get an exception due to the debug handler trying to make use of the __IPYTHON__ builtin which I understand has been removed in .11 ... This seemed like an easy fix, so I went in and replaced __IPYTHON__ with a reference to the current shell instance (assigned in the Pdb.__init__ from ipapi.get() ). Problem is, apparently the debugger expects the shell to be an InteractiveShellEmbed, which has a set_completer_frame method. So I added a method to the Pdb class that emulates the presence of set_completer_frame, and now all of a sudden the debugger works perfect. But I have no idea what unintended consequences this might have (and am confused why set_completer_frame is not present in the first place, or in InteractiveShell)... At any rate, attached is a patch that seems to work for me (made with bzr send). In general, what's the best way to submit patches/fixes - via this list, the launchpad bug tracker, or a personal launchpad branch? -------------- next part -------------- A non-text attachment was scrubbed... Name: debugger.diff Type: text/x-patch Size: 7552 bytes Desc: not available URL: From fperez.net at gmail.com Thu Dec 17 01:34:15 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 16 Dec 2009 22:34:15 -0800 Subject: [IPython-dev] Patch for broken debugger In-Reply-To: References: Message-ID: Hi Erik, On Wed, Dec 16, 2009 at 6:51 PM, Erik Tollerud wrote: > I decided to try out the bzr version of ipython again and it looks > great except for continued problems using the %debug magic ... this > time, instead of getting nothing, I get an exception due to the debug > handler trying to make use of the __IPYTHON__ builtin which I > understand has been removed in .11 ... This seemed like an easy fix, > so I went in and replaced __IPYTHON__ with a reference to the current > shell instance (assigned in the Pdb.__init__ from ipapi.get() ). > Problem is, apparently the debugger expects the shell to be an > InteractiveShellEmbed, which has a set_completer_frame method. ?So I > added a method to the Pdb class that emulates the presence of > set_completer_frame, and now all of a sudden the debugger works > perfect. But I have no idea what unintended consequences this might > have (and am confused why set_completer_frame is not present in the > first place, or in InteractiveShell)... > > At any rate, attached is a patch that seems to work for me (made with > bzr send). ?In general, what's the best way to submit patches/fixes - > via this list, the launchpad bug tracker, or a personal launchpad > branch? This is fine, thanks! I plan on spending some time this weekend reviewing all the work that's in Brian's latest branch so we can merge it all, to start stabilizing the 0.11 series and fixing all the little things we'll need to clean up. At that point we'll drop your patch in as well. For more long-term development a bzr branch makes pulling/merging easier, but for standalone fixes this is just fine, thanks! Tracked here now: https://bugs.launchpad.net/ipython/+bug/497651 Cheers, f From Joseph.Sarbak at rbccm.com Thu Dec 17 08:53:47 2009 From: Joseph.Sarbak at rbccm.com (Sarbak, Joseph) Date: Thu, 17 Dec 2009 08:53:47 -0500 Subject: [IPython-dev] Does Ipython have the equivalent to the 'wait' keyword in bash? In-Reply-To: References: <20091203092039.GA10420@SamZwo.iwr.uni-heidelberg.de> <2830FB43CE5B4249AE847CD1FE0458EE039C7668@SXGM-001.fg.rbc.com> <2830FB43CE5B4249AE847CD1FE0458EE039C766A@SXGM-001.fg.rbc.com> <2830FB43CE5B4249AE847CD1FE0458EE039C7678@SXGM-001.fg.rbc.com> Message-ID: <2830FB43CE5B4249AE847CD1FE0458EE039C7689@SXGM-001.fg.rbc.com> Thank you for the advice, Erik. Joe -----Original Message----- From: etollerud at gmail.com [mailto:etollerud at gmail.com] On Behalf Of Erik Tollerud Sent: 2009, December, 16 7:50 PM To: Sarbak, Joseph Cc: IPython Devel Mailinglist Subject: Re: [IPython-dev] Does Ipython have the equivalent to the 'wait' keyword in bash? I'm not sure if there is any builtin ipython magic that does this, but one potential approach might be: import subprocess p1=subprocess.Popen('cmd1') p2=subprocess.Popen('cmd2') p3=subprocess.Popen('cmd3') #do your other stuff p1.wait() p2.wait() p3.wait() print 'Done!' On Thu, Dec 10, 2009 at 5:41 AM, Sarbak, Joseph wrote: > > > Hello, > > Firstly, I would like to let you know that Ipython is a wonderful > interpreter, and I would like to use it as my shell. Thanks for your > hard work. > > However, there is one question I have, for which I have tried to find > a solution in the documentation. ?I haven't found any advice in the > docs so, here goes... > > Just as in bash, I would like to launch multiple processes in the > background and then at some point in the parent script, wait for the > results. ?It is so easy to do in most shell languages. ?Example: > > ? ? ? ?#!/bin/bash > > ? ? ? ?task1& > ? ? ? ?task2& > ? ? ? ?task3& > > ? ? ? ?# do some other work > > ? ? ? ?wait > > ? ? ? ?echo "Done!" > > Would anyone be able to recommend a simple or even trivial way to > perform the same parallelization work in ipython? ?I would like to be > able to do this on the local node. ?No distributed processing is > desired. > > Thank you. > Joe Sarbak > ________________________________________ > > This E-Mail (including any attachments) may contain privileged or confidential information. ?It is intended only for the addressee(s) indicated above. > > The sender does not waive any of its rights, privileges or other protections respecting this information. > > Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. > > If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. > > This E-Mail (including any attachments) has been scanned for viruses. > > It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. > > However, it is the responsibility of the recipient to ensure that it is virus free. > > The sender accepts no responsibility for any loss or damage arising in any way from its use. > > E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. > > Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. > > IRS CIRCULAR 230 NOTICE: ?TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > ________________________________________ This E-Mail (including any attachments) may contain privileged or confidential information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protections respecting this information. Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses. It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. However, it is the responsibility of the recipient to ensure that it is virus free. The sender accepts no responsibility for any loss or damage arising in any way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. IRS CIRCULAR 230 NOTICE: TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. From matthew.brett at gmail.com Tue Dec 22 05:35:39 2009 From: matthew.brett at gmail.com (Matthew Brett) Date: Tue, 22 Dec 2009 05:35:39 -0500 Subject: [IPython-dev] pdb errors on latest checkout Message-ID: <1e2af89e0912220235m23a110fdo16d372cdc9bbd954@mail.gmail.com> Hi, As of about 4 days ago, I have been getting errors whenever I try and enter pdb, with the latest bzr checkout: blair:~ mb312$ ipython Python 2.6.4 (r264:75706, Nov 29 2009, 00:03:57) Type "copyright", "credits" or "license" for more information. IPython 0.11.bzr.r1205 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: pdb on Automatic pdb calling has been turned ON In [2]: 1/0 ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ZeroDivisionError: integer division or modulo by zero [IPythonApp] Aborting application: ipython Traceback (most recent call last): File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/application.py", line 292, in attempt func() File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/ipapp.py", line 527, in start_app self.shell.mainloop() File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 1699, in mainloop self.interact(display_banner=display_banner) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 1842, in interact more = self.push_line(line) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 2176, in push_line more = self.runsource('\n'.join(self.buffer), self.filename) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 2102, in runsource if self.runcode(code) == 0: File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 2144, in runcode self.showtraceback() File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/iplib.py", line 1280, in showtraceback self.InteractiveTB(etype,value,tb,tb_offset=tb_offset) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/ultratb.py", line 1005, in __call__ self.debugger() File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/ultratb.py", line 866, in debugger self.pdb.interaction(self.tb.tb_frame, self.tb) File "/Users/mb312/usr/local/lib/python2.6/site-packages/IPython/core/debugger.py", line 282, in interaction __IPYTHON__.set_completer_frame(frame) NameError: global name '__IPYTHON__' is not defined I'm afraid I got a little lost trying to debug this - is there anything obvious I should try? Thanks a lot, Matthew From matthew.brett at gmail.com Wed Dec 23 07:42:09 2009 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 23 Dec 2009 07:42:09 -0500 Subject: [IPython-dev] pdb errors on latest checkout In-Reply-To: <1e2af89e0912220235m23a110fdo16d372cdc9bbd954@mail.gmail.com> References: <1e2af89e0912220235m23a110fdo16d372cdc9bbd954@mail.gmail.com> Message-ID: <1e2af89e0912230442g640fdb5au1630dca84707ac8a@mail.gmail.com> Hi, > As of about 4 days ago, I have been getting errors whenever I try and > enter pdb, with the latest bzr checkout: Sorry - somehow I missed Erik's email and patch on the 16th - the patch works for me too... Best, Matthew From gael.varoquaux at normalesup.org Tue Dec 29 10:55:09 2009 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Tue, 29 Dec 2009 16:55:09 +0100 Subject: [IPython-dev] [matplotlib-devel] [Numpy-discussion] Announcing toydist, improving distribution and packaging situation In-Reply-To: <5b8d13220912290634u5902a6bag33ddb8a15a93406b@mail.gmail.com> References: <5b8d13220912280603p7221a264o875b0d5e74a5404@mail.gmail.com> <64ddb72c0912290527s1143efc7g3efe93936ca5de5@mail.gmail.com> <5b8d13220912290634u5902a6bag33ddb8a15a93406b@mail.gmail.com> Message-ID: <20091229155509.GA15515@phare.normalesup.org> On Tue, Dec 29, 2009 at 11:34:44PM +0900, David Cournapeau wrote: > Buildout, virtualenv all work by sandboxing from the system python: > each of them do not see each other, which may be useful for > development, but as a deployment solution to the casual user who may > not be familiar with python, it is useless. A scientist who installs > numpy, scipy, etc... to try things out want to have everything > available in one python interpreter, and does not want to jump to > different virtualenvs and whatnot to try different packages. I think that you are pointing out a large source of misunderstanding in packaging discussion. People behind setuptools, pip or buildout care to have a working ensemble of packages that deliver an application (often a web application)[1]. You and I, and many scientific developers see libraries as building blocks that need to be assembled by the user, the scientist using them to do new science. Thus the idea of isolation is not something that we can accept, because it means that we are restricting the user to a set of libraries. Our definition of user is not the same as the user targeted by buildout. Our user does not push buttons, but he writes code. However, unlike the developer targeted by buildout and distutils, our user does not want or need to learn about packaging. Trying to make the debate clearer... Ga?l [1] I know your position on why simply focusing on sandboxing working ensemble of libraries is not a replacement for backward compatibility, and will only create impossible problems in the long run. While I agree with you, this is not my point here. From dsdale24 at gmail.com Wed Dec 30 09:26:00 2009 From: dsdale24 at gmail.com (Darren Dale) Date: Wed, 30 Dec 2009 09:26:00 -0500 Subject: [IPython-dev] [Numpy-discussion] Announcing toydist, improving distribution and packaging situation In-Reply-To: <5b8d13220912280603p7221a264o875b0d5e74a5404@mail.gmail.com> References: <5b8d13220912280603p7221a264o875b0d5e74a5404@mail.gmail.com> Message-ID: Hi David, On Mon, Dec 28, 2009 at 9:03 AM, David Cournapeau wrote: > Executable: grin > ? ?module: grin > ? ?function: grin_main > > Executable: grind > ? ?module: grin > ? ?function: grind_main Have you thought at all about operations that are currently performed by post-installation scripts? For example, it might be desirable for the ipython or MayaVi windows installers to create a folder in the Start menu that contains links the the executable and the documentation. This is probably a secondary issue at this point in toydist's development, but I think it is an important feature in the long run. Also, have you considered support for package extras (package variants in Ports, allowing you to specify features that pull in additional dependencies like traits[qt4])? Enthought makes good use of them in ETS, and I think they would be worth keeping. Darren From dsdale24 at gmail.com Wed Dec 30 16:06:56 2009 From: dsdale24 at gmail.com (Darren Dale) Date: Wed, 30 Dec 2009 16:06:56 -0500 Subject: [IPython-dev] [SciPy-dev] [Numpy-discussion] Announcing toydist, improving distribution and packaging situation In-Reply-To: <5b8d13220912300816s12c934adh4abdd6d703f8928f@mail.gmail.com> References: <5b8d13220912280603p7221a264o875b0d5e74a5404@mail.gmail.com> <5b8d13220912300816s12c934adh4abdd6d703f8928f@mail.gmail.com> Message-ID: On Wed, Dec 30, 2009 at 11:16 AM, David Cournapeau wrote: > On Wed, Dec 30, 2009 at 11:26 PM, Darren Dale wrote: >> Hi David, >> >> On Mon, Dec 28, 2009 at 9:03 AM, David Cournapeau wrote: >>> Executable: grin >>> ? ?module: grin >>> ? ?function: grin_main >>> >>> Executable: grind >>> ? ?module: grin >>> ? ?function: grind_main >> >> Have you thought at all about operations that are currently performed >> by post-installation scripts? For example, it might be desirable for >> the ipython or MayaVi windows installers to create a folder in the >> Start menu that contains links the the executable and the >> documentation. This is probably a secondary issue at this point in >> toydist's development, but I think it is an important feature in the >> long run. >> >> Also, have you considered support for package extras (package variants >> in Ports, allowing you to specify features that pull in additional >> dependencies like traits[qt4])? Enthought makes good use of them in >> ETS, and I think they would be worth keeping. > > Does this example covers what you have in mind ? I am not so familiar > with this feature of setuptools: > > Name: hello > Version: 1.0 > > Library: > ? ?BuildRequires: paver, sphinx, numpy > ? ?if os(windows) > ? ? ? ?BuildRequires: pywin32 > ? ?Packages: > ? ? ? ?hello > ? ?Extension: hello._bar > ? ? ? ?sources: > ? ? ? ? ? ?src/hellomodule.c > ? ?if os(linux) > ? ? ? ?Extension: hello._linux_backend > ? ? ? ? ? ?sources: > ? ? ? ? ? ? ? ?src/linbackend.c > > Note that instead of os(os_name), you can use flag(flag_name), where > flag are boolean variables which can be user defined: > > http://github.com/cournape/toydist/blob/master/examples/simples/conditional/toysetup.info > > http://github.com/cournape/toydist/blob/master/examples/var_example/toysetup.info I should defer to the description of extras in the setuptools documentation. It is only a few paragraphs long: http://peak.telecommunity.com/DevCenter/setuptools#declaring-extras-optional-features-with-their-own-dependencies Darren From fperez.net at gmail.com Wed Dec 30 17:00:00 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 30 Dec 2009 14:00:00 -0800 Subject: [IPython-dev] RFC on policy: setting object attributes? Message-ID: Howdy, as I dive into Brian's wonderful refactor now merged in trunk, I realize we have now a fair amount of code with objects that set attributes in methods other than __init__. I'm a big fan of declaring all attributes an object can have either in the class declaration or in __init__, so that one can read the beginning of the class and know exactly what to expect later on from that object. Having attributes appear later from method calls requires either using try/except or lots of getattr() calls to avoid possible AttributeErrors. So my question is: should we in general set these in the class or in __init__? For code where we use traits-like tools (either traitlets or Traits) obviously things must be put in the class, but for other attributes we can choose. I see advantages to putting these in the class: - uniformity (if something becomes traits-like later, no need to change where it's declared) - the cost of that execution is paid only once per class declaration, not every time an instance is created. As a minus, import times are likely to be *slightly* larger, as class declarations have extra code in them. Opinions? For now I'm going to go with putting things in the class as I need them, but I'd like to hear people's thoughts so we have a policy we're happy with and good reasons to choose it. Cheers, f From gael.varoquaux at normalesup.org Wed Dec 30 17:02:23 2009 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Wed, 30 Dec 2009 23:02:23 +0100 Subject: [IPython-dev] RFC on policy: setting object attributes? In-Reply-To: References: Message-ID: <20091230220223.GB14951@phare.normalesup.org> On Wed, Dec 30, 2009 at 02:00:00PM -0800, Fernando Perez wrote: > Opinions? For now I'm going to go with putting things in the class as > I need them, but I'd like to hear people's thoughts so we have a > policy we're happy with and good reasons to choose it. I am fully with you. Ga?l From fperez.net at gmail.com Thu Dec 31 00:06:13 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 30 Dec 2009 21:06:13 -0800 Subject: [IPython-dev] RFC on policy: setting object attributes? In-Reply-To: <20091230220223.GB14951@phare.normalesup.org> References: <20091230220223.GB14951@phare.normalesup.org> Message-ID: Wed, Dec 30, 2009 at 2:02 PM, Gael Varoquaux wrote: > On Wed, Dec 30, 2009 at 02:00:00PM -0800, Fernando Perez wrote: >> Opinions? ?For now I'm going to go with putting things in the class as >> I need them, but I'd like to hear people's thoughts so we have a >> policy we're happy with and good reasons to choose it. > > I am fully with you. Thanks; I've added this to the dev guide (in my branch, coming up for review soon), I'm happy to take further feedback into account if anyone disagrees: Attribute declarations for objects ================================== In general, objects should declare in their *class* all attributes the object is meant to hold throughout its life. While Python allows you to add an attribute to an instance at any point in time, this makes the code harder to read and requires methods to constantly use checks with hasattr() or try/except calls. By declaring all attributes of the object in the class header, there is a single place one can refer to for understanding the object's data interface, where comments can explain the role of each variable and when possible, sensible deafaults can be assigned. .. Warning:: If an attribute is meant to contain a mutable object, it should be set to ``None`` in the class and its mutable value should be set in the object's constructor. Since class attributes are shared by all instances, failure to do this can lead to difficult to track bugs. But you should still set it in the class declaration so the interface specification is complete and documdented in one place. A simple example:: class foo: # X does..., sensible default given: x = 1 # y does..., default will be set by constructor y = None # z starts as an empty list, must be set in constructor z = None def __init__(self, y): self.y = y self.z = [] From gael.varoquaux at normalesup.org Thu Dec 31 02:10:17 2009 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Thu, 31 Dec 2009 08:10:17 +0100 Subject: [IPython-dev] RFC on policy: setting object attributes? In-Reply-To: References: <20091230220223.GB14951@phare.normalesup.org> Message-ID: <20091231071017.GB9317@phare.normalesup.org> On Wed, Dec 30, 2009 at 09:06:13PM -0800, Fernando Perez wrote: > Thanks; I've added this to the dev guide (in my branch, coming up for > review soon), I'm happy to take further feedback into account if > anyone disagrees: The warning is indeed important. Ga?l From fperez.net at gmail.com Thu Dec 31 05:09:37 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 31 Dec 2009 02:09:37 -0800 Subject: [IPython-dev] %pylab working and ready for testing... Message-ID: Hi folks, I've put up my version of trunk for review: https://code.launchpad.net/~fdo.perez/ipython/trunk-dev/+merge/16695 but in addition to review (which I'd appreciate), any early testing is also very welcome. This was a single marathon session today, so there are likely still lots of lingering problems; with all the GUI backend management work, there's no way I know of to automate the testing, so I'm sure I missed something. This starts to get trunk into a more usable form for everyday work that includes heavy matplotlib usage, as the old -pylab and friends work again, and there's also something much nicer: you can now type %pylab at *any* time during your work session, and it will load pylab for you. No more 'oops, I forgot to start in pylab mode and now I need to plot' :) My hat's off to Brian for the refactoring work. The code is now a pleasure to work with, I never imagined someone would have the patience, stamina and clarity of mind to make something so nice out of the cat's hairball we'd originally created. Very, very impressive, and I am now very optimistic that we'll be able to build lots of nice machinery reusing the same internal core. There is still cleanup to be done, but the foundation is there. I'll be offline for a couple of days, camping over new year's, so Happy New Year to everyone! Cheers, f From fperez.net at gmail.com Thu Dec 31 05:10:06 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 31 Dec 2009 02:10:06 -0800 Subject: [IPython-dev] RFC on policy: setting object attributes? In-Reply-To: <20091231071017.GB9317@phare.normalesup.org> References: <20091230220223.GB14951@phare.normalesup.org> <20091231071017.GB9317@phare.normalesup.org> Message-ID: On Wed, Dec 30, 2009 at 11:10 PM, Gael Varoquaux wrote: > > The warning is indeed important. Thanks for the feedback, it's now up on lp. Happy New Year! f From fperez.net at gmail.com Thu Dec 31 05:11:05 2009 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 31 Dec 2009 02:11:05 -0800 Subject: [IPython-dev] pdb errors on latest checkout In-Reply-To: <1e2af89e0912230442g640fdb5au1630dca84707ac8a@mail.gmail.com> References: <1e2af89e0912220235m23a110fdo16d372cdc9bbd954@mail.gmail.com> <1e2af89e0912230442g640fdb5au1630dca84707ac8a@mail.gmail.com> Message-ID: Hey Matthew, On Wed, Dec 23, 2009 at 4:42 AM, Matthew Brett wrote: > > Sorry - somehow I missed Erik's email and patch on the 16th - the > patch works for me too... Sorry I ignored you: all of these fixes went into trunk already, so you should be now good with trunk. Cheers, f