From mantegazza at ill.fr Tue Sep 6 05:57:50 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Tue, 6 Sep 2005 11:57:50 +0200 Subject: [IPython-dev] Re: [IPython SVN] New commit performed by fperez In-Reply-To: <4302520B.4050103@colorado.edu> References: <4302520B.4050103@colorado.edu> Message-ID: <200509061157.50896.mantegazza@ill.fr> Le Mardi 16 Ao?t 2005 22:52, Fernando Perez a ?crit : > I normally don't mention all SVN commits here, but in this case there is > an API change which may impact some users. Please see the commit log > below. It will only affect those who use custom exception handlers, and > they can still have the same functionality as before. It's just that > instead of using the > > self.code_to_run_src > > attribute, if they want to print/use source information they can either > use the self.buffer object, which is a list of lines, or assemble a > string via > > '\n'.join(self.buffer) > > I hadn't realized I was duplicating this attribute, and duplication like > this is bugs waiting to happen. Even if I'm still using the stable version, I made the modification, and it works fine. Thank's, Fernando. During the operation, I found a little bug. When ipython completes the code with (), in case of callable, function or methode call, it adds a trailing \n character to the code, but not when user writes the () himself. Could it be possible to have the same behaviour in both cases (with or without the trailing \n, it doesn't matter) ? Thank's, -- Fr?d?ric From Fernando.Perez at colorado.edu Tue Sep 6 21:55:47 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 06 Sep 2005 19:55:47 -0600 Subject: [IPython-dev] Re: [IPython SVN] New commit performed by fperez In-Reply-To: <200509061157.50896.mantegazza@ill.fr> References: <4302520B.4050103@colorado.edu> <200509061157.50896.mantegazza@ill.fr> Message-ID: <431E48A3.603@colorado.edu> Fr?d?ric Mantegazza wrote: > During the operation, I found a little bug. When ipython completes the code > with (), in case of callable, function or methode call, it adds a trailing > \n character to the code, but not when user writes the () himself. > > Could it be possible to have the same behaviour in both cases (with or > without the trailing \n, it doesn't matter) ? Fixed (in SVN). Thanks for the report, Cheers, f From mantegazza at ill.fr Wed Sep 7 02:06:33 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Wed, 7 Sep 2005 08:06:33 +0200 Subject: [IPython-dev] New commit performed by fperez In-Reply-To: <431E48A3.603@colorado.edu> References: <4302520B.4050103@colorado.edu> <200509061157.50896.mantegazza@ill.fr> <431E48A3.603@colorado.edu> Message-ID: <200509070806.34025.mantegazza@ill.fr> Le Mercredi 7 Septembre 2005 03:55, Fernando Perez a ?crit : > Fixed (in SVN). Thanks for the report, With, or without the trailing '\n' ? -- Fr?d?ric From Fernando.Perez at colorado.edu Wed Sep 7 02:21:26 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Wed, 07 Sep 2005 00:21:26 -0600 Subject: [IPython-dev] New commit performed by fperez In-Reply-To: <200509070806.34025.mantegazza@ill.fr> References: <4302520B.4050103@colorado.edu> <200509061157.50896.mantegazza@ill.fr> <431E48A3.603@colorado.edu> <200509070806.34025.mantegazza@ill.fr> Message-ID: <431E86E6.2060505@colorado.edu> Fr?d?ric Mantegazza wrote: > Le Mercredi 7 Septembre 2005 03:55, Fernando Perez a ?crit : > > >>Fixed (in SVN). Thanks for the report, > > > With, or without the trailing '\n' ? The automatic rewriter does NOT append the \n anymore. This makes it behave more like what a user would explicitly write, which I think is the right behavior. I can't quite see why I added those \n, it may be just historical baggage because they seem totally unnecessary (at least I didn't see any valid reason for having them, and my tests didn't show any problems without them). Here's the changeset in full: http://projects.scipy.org/ipython/ipython/changeset/807 Cheers, f From jorgen.stenarson at bostream.nu Fri Sep 9 16:47:42 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Fri, 09 Sep 2005 22:47:42 +0200 Subject: [IPython-dev] Mathematica wildcards in ? Message-ID: <4321F4EE.8020404@bostream.nu> Hi all, I'm a happy user of IPython but I often wish I had a feature found in Mathematica. Where the ? command can take wildcards and then produce a list of all names matching the wildcard. There is also support for matching down in packages. example when using pylab: ?pl* ['plot', 'plot_date', 'plotting'] ?matplotlib.a* ['matplotlib.afm', 'matplotlib.agg', 'matplotlib.artist', 'matplotlib.axes', 'matplotlib.axis'] It would also be nice to be able to filer on types of objects like: ?matplotlib.* class ['matplotlib.MPLError', 'matplotlib.ValidateInStrings', 'matplotlib.ValidateInterval', 'matplotlib.Verbose', 'matplotlib.validate_nseq_float'] I have appended a first shot at an implementation of this feature. It should work by starting ipython and then importing wildcard. The functionality is installed as a magic function named %listdef. This seemed like the easiest way to test it. Is this something more people would find useful added to the ? function? Best regards, J?rgen Stenarson -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wildcard.py URL: From Fernando.Perez at colorado.edu Fri Sep 9 18:49:54 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Fri, 09 Sep 2005 16:49:54 -0600 Subject: [IPython-dev] Mathematica wildcards in ? In-Reply-To: <4321F4EE.8020404@bostream.nu> References: <4321F4EE.8020404@bostream.nu> Message-ID: <43221192.9060206@colorado.edu> Hi J?rgen, J?rgen Stenarson wrote: > Hi all, > > I'm a happy user of IPython but I often wish I had a feature found in > Mathematica. Where the ? command can take wildcards and then produce a > list of all names matching the wildcard. There is also support for > matching down in packages. > > example when using pylab: > ?pl* > ['plot', 'plot_date', 'plotting'] [...] > I have appended a first shot at an implementation of this feature. It > should work by starting ipython and then importing wildcard. > > The functionality is installed as a magic function named %listdef. This > seemed like the easiest way to test it. > > Is this something more people would find useful added to the ? function? I think this is _excellent_ functionality, and I'd be happy to include it in a future release. A few comments about your implementation, so we can fine-tune it (though it's already useful as is) for inclusion: - please refrain from using python 2.4-specific features. For example, instead of sorted(foo), use the slower foo1=list(foo);foo1.sort(). I try hard to maintain with the current release series compatibility with python 2.2, since there is still a sizeable userbase on that platform. The new ipython development branch: http://projects.scipy.org/ipython/ipython/browser/ipython/branches/chainsaw is 2.4-only, but for the release branch I'm sticking to 2.2. While more verbose and less convenient, it's still possible to implement this functionality in a 2.2-valid way (note that genutils provides some compatibility symbols from 2.3, so you can mostly code to 2.3, and stick a 2.2 version of the feature in the compatibility section there). - It would be excellent if you could also scan the builtin namespace, so that this could be used by new users to learn about builtins. Currently you only scan the user namespace. - The OInspect module has already a fair amount of functionality that you can perhaps rely on, if you need it. Also have a look at _ofind in Magic.py. I'm not 100% sure, but I just suggest them as potentially useful in terms of reducing code duplication. - Code formatting: it would be best if you could please conform to left-indented docstrings like the rest of ipython does (this follows Python style PEP directives). For reference, I've put up some basic guidelines for ipython contributors here: http://projects.scipy.org/ipython/ipython/wiki/DeveloperGuidelines But I'm _very_ interested in this! I am planning on cutting an ipython release in the next couple of weeks with some bugfixes which have accumulated, so if you get a chance to work on this, I'll be happy to include it. This kind of functionality has been asked for _many_ times in the past. Best regards, f. From jorgen.stenarson at bostream.nu Sun Sep 11 14:38:22 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Sun, 11 Sep 2005 20:38:22 +0200 Subject: [IPython-dev] wildcard feature Message-ID: <4324799E.1000205@bostream.nu> Hi, I have now worked on Fernando's suggestions and I have a working (with my limited testing) implementation. I have made a quick hack to insert the functionality to work with ?. This should probably be modified to conform to the IPython general design philosophy. My code is in two parts: 1. wildcard.py: Place in IPython/wildcard.py 2. patch_20050911: A small patch to IPython/Magic.py that does a little hack in the magic_pinfo and adds the magic_listdef command. patch_20050911 was generated by svn diff Magic.py I have made some quick tests on python2.2 and it worked. Best regards, J?rgen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wildcard.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch_20050911 URL: From vivainio at gmail.com Mon Sep 12 02:30:55 2005 From: vivainio at gmail.com (Ville Vainio) Date: Mon, 12 Sep 2005 09:30:55 +0300 Subject: [IPython-dev] wildcard feature In-Reply-To: <4324799E.1000205@bostream.nu> References: <4324799E.1000205@bostream.nu> Message-ID: <46cb515a0509112330132ca6a5@mail.gmail.com> On 9/11/05, J?rgen Stenarson wrote: > I have now worked on Fernando's suggestions and I have a working (with > my limited testing) implementation. I have made a quick hack to insert > the functionality to work with ?. This should probably be modified to > conform to the IPython general design philosophy. Is it really necessary to use the "?" character, instead of a magic function? "?" is a bit too "special" IMO, when a more generic solution would suffice. I recognize the value of the similarity with matlab, but perhaps we shouldn't add too many special prefixes... -- Ville Vainio http://tinyurl.com/2prnb From Fernando.Perez at colorado.edu Mon Sep 12 03:01:29 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 12 Sep 2005 01:01:29 -0600 Subject: [IPython-dev] wildcard feature In-Reply-To: <46cb515a0509112330132ca6a5@mail.gmail.com> References: <4324799E.1000205@bostream.nu> <46cb515a0509112330132ca6a5@mail.gmail.com> Message-ID: <432527C9.4000102@colorado.edu> Ville Vainio wrote: > On 9/11/05, J?rgen Stenarson wrote: > > >>I have now worked on Fernando's suggestions and I have a working (with >>my limited testing) implementation. I have made a quick hack to insert >>the functionality to work with ?. This should probably be modified to >>conform to the IPython general design philosophy. > > > Is it really necessary to use the "?" character, instead of a magic > function? "?" is a bit too "special" IMO, when a more generic solution > would suffice. I recognize the value of the similarity with matlab, > but perhaps we shouldn't add too many special prefixes... Well, the way I see it, ? is already there for finding information about objects. This seems like a quite natural extension: when you don't know the actual name of an object, this can help you find it. For example, this (mockup) use looks very natural to me: > plot*? ['plot','plotfoo','plotbar'] > plotfoo? ... plotfoo plots foos very nicely... While the above case is probably best handled with plain TAB completion, for cases where the unknown part is at the beginning of a name, TAB won't help you. So it doesn't feel to me like introducing anything new (? is already a special prefix, it has been since ipython was born). Rather, it's an extension to the functionality of '?' which seems fairly natural to me. Cheers, f ps - Ville, what came out of your win32 experiments? I'd forgotten to ping you again on that, sorry... From vivainio at gmail.com Mon Sep 12 04:39:18 2005 From: vivainio at gmail.com (Ville Vainio) Date: Mon, 12 Sep 2005 11:39:18 +0300 Subject: [IPython-dev] wildcard feature In-Reply-To: <432527C9.4000102@colorado.edu> References: <4324799E.1000205@bostream.nu> <46cb515a0509112330132ca6a5@mail.gmail.com> <432527C9.4000102@colorado.edu> Message-ID: <46cb515a050912013948724d53@mail.gmail.com> > Well, the way I see it, ? is already there for finding information about > objects. This seems like a quite natural extension: when you don't know the > actual name of an object, this can help you find it. For example, this Ah, of course, didn't think of that. I use "foo??" all the time and forgot about the prefix syntax. > ps - Ville, what came out of your win32 experiments? I'd forgotten to ping > you again on that, sorry... Working as it should be. Didn't you apply the patch to your working copy as well? I'm still +1 on implementing the feature for both ! (the variant I tried, and also a safe bet) and also system command aliases. -- Ville Vainio http://tinyurl.com/2prnb From mantegazza at ill.fr Mon Sep 12 05:27:22 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Mon, 12 Sep 2005 11:27:22 +0200 Subject: [IPython-dev] svn co failed Message-ID: <200509121127.23284.mantegazza@ill.fr> Hello, I tried to get ipython from svn trunk, and I get the following error : $ svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython svn: REPORT request failed on '/svn/ipython/!svn/vcc/default' svn: REPORT of '/svn/ipython/!svn/vcc/default': 400 Bad Request (http://ipython.scipy.org) Is it a problem on svn server side, or oclient side ? -- Fr?d?ric From Fernando.Perez at colorado.edu Mon Sep 12 13:21:12 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 12 Sep 2005 11:21:12 -0600 Subject: [IPython-dev] svn co failed In-Reply-To: <200509121127.23284.mantegazza@ill.fr> References: <200509121127.23284.mantegazza@ill.fr> Message-ID: <4325B908.70701@colorado.edu> Fr?d?ric Mantegazza wrote: > Hello, > > I tried to get ipython from svn trunk, and I get the following error : > > $ svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython > svn: REPORT request failed on '/svn/ipython/!svn/vcc/default' > svn: REPORT of '/svn/ipython/!svn/vcc/default': 400 Bad Request > (http://ipython.scipy.org) > > Is it a problem on svn server side, or oclient side ? Mmh, works for me right now. Can you check again? It could have been just a temporary failure. If it continues to give you trouble, we'll track it down further. f From mantegazza at ill.fr Tue Sep 13 02:26:16 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Tue, 13 Sep 2005 08:26:16 +0200 Subject: [IPython-dev] svn co failed In-Reply-To: <4325B908.70701@colorado.edu> References: <200509121127.23284.mantegazza@ill.fr> <4325B908.70701@colorado.edu> Message-ID: <200509130826.16342.mantegazza@ill.fr> Le Lundi 12 Septembre 2005 19:21, Fernando Perez a ?crit : > > $ svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython > > svn: REPORT request failed on '/svn/ipython/!svn/vcc/default' > > svn: REPORT of '/svn/ipython/!svn/vcc/default': 400 Bad Request > > (http://ipython.scipy.org) > > > > Is it a problem on svn server side, or oclient side ? > > Mmh, works for me right now. Can you check again? It could have been > just a temporary failure. If it continues to give you trouble, we'll > track it down further. I still have the problem... -- Fr?d?ric From rkern at ucsd.edu Tue Sep 13 02:36:26 2005 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 12 Sep 2005 23:36:26 -0700 Subject: [IPython-dev] Re: svn co failed In-Reply-To: <200509130826.16342.mantegazza@ill.fr> References: <200509121127.23284.mantegazza@ill.fr> <4325B908.70701@colorado.edu> <200509130826.16342.mantegazza@ill.fr> Message-ID: Fr?d?ric Mantegazza wrote: > Le Lundi 12 Septembre 2005 19:21, Fernando Perez a ?crit : > > >>>$ svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython >>>svn: REPORT request failed on '/svn/ipython/!svn/vcc/default' >>>svn: REPORT of '/svn/ipython/!svn/vcc/default': 400 Bad Request >>> (http://ipython.scipy.org) >>> >>>Is it a problem on svn server side, or oclient side ? >> >>Mmh, works for me right now. Can you check again? It could have been >>just a temporary failure. If it continues to give you trouble, we'll >>track it down further. > > I still have the problem... It works fine for me, too. What version ofthe svn client are you using? I'm using 1.2.1 . -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From mantegazza at ill.fr Tue Sep 13 03:47:31 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Tue, 13 Sep 2005 09:47:31 +0200 Subject: [IPython-dev] Re: svn co failed In-Reply-To: References: <200509121127.23284.mantegazza@ill.fr> <200509130826.16342.mantegazza@ill.fr> Message-ID: <200509130947.32175.mantegazza@ill.fr> Le Mardi 13 Septembre 2005 08:36, Robert Kern a ?crit : > It works fine for me, too. What version ofthe svn client are you using? > I'm using 1.2.1 . 1.1.4 (debian testing) -- Fr?d?ric From Fernando.Perez at colorado.edu Tue Sep 13 13:29:34 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 13 Sep 2005 11:29:34 -0600 Subject: [IPython-dev] Re: svn co failed In-Reply-To: References: <200509121127.23284.mantegazza@ill.fr> <4325B908.70701@colorado.edu> <200509130826.16342.mantegazza@ill.fr> Message-ID: <43270C7E.7040801@colorado.edu> Robert Kern wrote: > Fr?d?ric Mantegazza wrote: > >>Le Lundi 12 Septembre 2005 19:21, Fernando Perez a ?crit : >> >> >> >>>>$ svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython >>>>svn: REPORT request failed on '/svn/ipython/!svn/vcc/default' >>>>svn: REPORT of '/svn/ipython/!svn/vcc/default': 400 Bad Request >>>> (http://ipython.scipy.org) >>>> >>>>Is it a problem on svn server side, or oclient side ? >>> >>>Mmh, works for me right now. Can you check again? It could have been >>>just a temporary failure. If it continues to give you trouble, we'll >>>track it down further. >> >>I still have the problem... > > > It works fine for me, too. What version ofthe svn client are you using? > I'm using 1.2.1 . Mmh, it seems like the problem is with Frederic's setup, if I understand this correctly: http://www.sipfoundry.org/tools/svn-tips.html which says: What does 'REPORT request failed' mean? When I try to check out a subversion repository > svn co http://scm.sipfoundry.org/rep/project/main project I get an error like: svn: REPORT request failed on '/rep/project/!svn/vcc/default' svn: REPORT of '/rep/project/!svn/vcc/default': 400 Bad Request (http://scm.sipfoundry.org) You are behind a web proxy that is not passing the WebDAV methods that subversion uses. You can work around the problem by using SSL to hide what you're doing from the proxy: > svn co https://scm.sipfoundry.org/rep/project/main project Frederic, can it be that you are behind such a proxy? Unfortunately the ipython server is not setup to serve SVN over SSL, it seems. I may try to ask the admin for that, but I have no idea if their infrastructure is set for it at all. Can you try tweaks to your proxy side of things? f From jorgen.stenarson at bostream.nu Tue Sep 13 15:54:02 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Tue, 13 Sep 2005 21:54:02 +0200 Subject: [IPython-dev] Wildcard Message-ID: <43272E5A.7060807@bostream.nu> Hi Fernando, I have been trying to integrate the wildcard functionality better with the other introspection functions but right now I'm not sure how to proceed. In Magic.py I only have calls to the functions that does the actual work similar to pdef, psource... In OInspect.py I have tried to add the function I used to call list_def but I have now renamed to psearch. The problem with this solution is that I need the information from user_ns, alias_ns etc. And as far as I can tell I cannot reach this information from here. I could pass this information into psearch but that would be a significant difference to the other p_methods. Do you have any suggestions? Or is the previous version ok? Will these things be different in the refactored design, chainsaw? I have included a patch of where I am right now. However it crashes in Inspector.psearch when trying to access the shell as if it was still in the magic class. I'm going on a business trip tomorrow and will not be back until this weekend. best regards, J?rgen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch_20050913 URL: From mantegazza at ill.fr Wed Sep 14 02:47:20 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Wed, 14 Sep 2005 08:47:20 +0200 Subject: [IPython-dev] Re: svn co failed In-Reply-To: <43270C7E.7040801@colorado.edu> References: <200509121127.23284.mantegazza@ill.fr> <43270C7E.7040801@colorado.edu> Message-ID: <200509140847.21071.mantegazza@ill.fr> Le Mardi 13 Septembre 2005 19:29, Fernando Perez a ?crit : > Frederic, can it be that you are behind such a proxy? Unfortunately the > ipython server is not setup to serve SVN over SSL, it seems. I may try > to ask the admin for that, but I have no idea if their infrastructure is > set for it at all. Can you try tweaks to your proxy side of things? Yes, I'm behind a Proxy, you're right. I didn't thought it could be a problem, as the connexion is started from inside... Anyway, I will ask the webmaster if he can let the WebDAV methods pass through the proxy... Thank's, -- Fr?d?ric From mantegazza at ill.fr Wed Sep 14 07:40:43 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Wed, 14 Sep 2005 13:40:43 +0200 Subject: [IPython-dev] Re: [IPython-user] Evaluation of arbitrary expressions in the prompt In-Reply-To: <062459791b0a2e0fcc52686deefa7f15@uva.nl> References: <00c34877b59a80600f0aeb5006880cec@uva.nl> <062459791b0a2e0fcc52686deefa7f15@uva.nl> Message-ID: <200509141340.43931.mantegazza@ill.fr> Le Mercredi 14 Septembre 2005 13:13, Michael Scarpa string a ?crit : > I just found out that this behavior disappeared when using the most > recent version of IPython. Sorry for the fuzz. Still, I would like to > know if doing this using the prompt string is the best way, or if there > is a more feasible way to achieve what I need. If your goal is just to have a method executed, and don't need to display anything in the prompt, then it could be nice to have a special hook for that (even if the prompt way is working). Fernando, what about 2 additional hooks : one to execute arbitrary code *before* the input string is executed, and one *after* ? An interesting things could be to analyse input code, and maybe modify it before having ipython executing it. The same for output: one could check/modify the answer before ipython prints it (the way it is done for exceptions hook). -- Fr?d?ric From Fernando.Perez at colorado.edu Wed Sep 14 11:59:20 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Wed, 14 Sep 2005 09:59:20 -0600 Subject: [IPython-dev] Re: [IPython-user] Evaluation of arbitrary expressions in the prompt In-Reply-To: <200509141340.43931.mantegazza@ill.fr> References: <00c34877b59a80600f0aeb5006880cec@uva.nl> <062459791b0a2e0fcc52686deefa7f15@uva.nl> <200509141340.43931.mantegazza@ill.fr> Message-ID: <432848D8.4030605@colorado.edu> Fr?d?ric Mantegazza wrote: > Le Mercredi 14 Septembre 2005 13:13, Michael Scarpa string a ?crit : > > >>I just found out that this behavior disappeared when using the most >>recent version of IPython. Sorry for the fuzz. Still, I would like to >>know if doing this using the prompt string is the best way, or if there >>is a more feasible way to achieve what I need. > > > If your goal is just to have a method executed, and don't need to display > anything in the prompt, then it could be nice to have a special hook for > that (even if the prompt way is working). > > Fernando, what about 2 additional hooks : one to execute arbitrary code > *before* the input string is executed, and one *after* ? They already exist :) They are called: In [3]: __IP.prefilter? Type: instancemethod Base Class: String Form: > Namespace: Interactive File: /usr/local/home/fperez/code/python/IPython/iplib.py Definition: __IP.prefilter(self, line, continue_prompt) Docstring: Calls different preprocessors, depending on the form of line. In [4]: __IP.outputcache.display? Type: instancemethod Base Class: String Form: > Namespace: Interactive File: /usr/local/home/fperez/code/python/IPython/Prompts.py Definition: __IP.outputcache.display(self, arg) Docstring: Default printer method, uses pprint. This can be over-ridden by the users to implement special formatting of certain types of output. Display isn't very well documented (prefilter is, since the pysh and other examples show how to use it), but it's there. However, I think that for Michael's needs, using the dynamic prompt system is simpler, since he doesn't need to subclass or override anything. > An interesting things could be to analyse input code, and maybe modify it > before having ipython executing it. The same for output: one could > check/modify the answer before ipython prints it (the way it is done for > exceptions hook). Have a look at the pysh, tutorial or physics profiles :) Cheers, f From jorgen.stenarson at bostream.nu Tue Sep 20 17:00:55 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Tue, 20 Sep 2005 23:00:55 +0200 Subject: [IPython-dev] wildcard-patch Message-ID: <43307887.4090207@bostream.nu> hi, here are the latest developments for the wildcard patch. I have continued work on the last patch. I now require the shell environment to be passed down to psearch() in the inspector class perhaps not the best solution but it works. ?PATTERN [OBJECT TYPE] [-NAMSPACE]+ [+NAMESPACE]+ [!a] [!i] I have added two options that are chosen with !a or !i !a Show objects with a single leading underscore, default is to hide these objects. !i Ignore case in searches The namespaces that can be searched are user, builtin, internal, alias. The default list contains user and builtin. Using a minus sign infront of these names removes the namespace from the search, using a plus adds it to the list. OBJECT TYPE are from the list in the module types. E.g float<=>FloatType ex. ?* float would match all objects of type float I'm sure we could have a better syntax so suggestions are welcome. I would for instance like to be able to match multiple object types. regards, J?rgen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch_20050920 URL: From Fernando.Perez at colorado.edu Wed Sep 21 00:45:42 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 20 Sep 2005 22:45:42 -0600 Subject: [IPython-dev] wildcard-patch In-Reply-To: <43307887.4090207@bostream.nu> References: <43307887.4090207@bostream.nu> Message-ID: <4330E576.8060109@colorado.edu> J?rgen Stenarson wrote: > hi, > > here are the latest developments for the wildcard patch. Just a note: I'll be heading to scipy'05 tomorrow so I'll be unable to respond for a few days. If anyone from the list is coming to the conference or is a Caltech person, let me know! I'd love to put some faces on the names from the list. Cheers, f From vivainio at gmail.com Wed Sep 21 13:33:03 2005 From: vivainio at gmail.com (Ville Vainio) Date: Wed, 21 Sep 2005 19:33:03 +0200 Subject: [IPython-dev] wildcard-patch In-Reply-To: <43307887.4090207@bostream.nu> References: <43307887.4090207@bostream.nu> Message-ID: <46cb515a05092110337946ed4e@mail.gmail.com> You need to work on the docstrings at least. It's supposed to be %psearch, not %listdef. Does "%psearch *.*ste*" work, so that it will find os.system? Can I search for methods in a bunch classes, a'la %psearch mymod.MyClass*Impl.get* ? I'm not a big fan of "!i", I think ignoring the case should be the default. Using ! for options is too different from the rest of ipython. Perhaps the searchable namespaces could be "remembered" and removed by %psearch -addns os %psearch -rmns sys ? Of course additions like this could go in later on, it's not like the feature would have to be fully "done" immediately in the next release... -- Ville Vainio http://tinyurl.com/2prnb From mantegazza at ill.fr Fri Sep 23 03:44:37 2005 From: mantegazza at ill.fr (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Fri, 23 Sep 2005 09:44:37 +0200 Subject: [IPython-dev] Re: svn co failed In-Reply-To: <43270C7E.7040801@colorado.edu> References: <200509121127.23284.mantegazza@ill.fr> <43270C7E.7040801@colorado.edu> Message-ID: <200509230944.37981.mantegazza@ill.fr> Le Mardi 13 Septembre 2005 19:29, Fernando Perez a ?crit : > svn: REPORT request failed on '/rep/project/!svn/vcc/default' > svn: REPORT of '/rep/project/!svn/vcc/default': 400 Bad Request > (http://scm.sipfoundry.org) Ok, I solved this problem by asking to the proxy admin to add all WebDAV methods subversion needs in the proxy config. Now all is working fine. Thank's, -- Fr?d?ric From vivian at vdesmedt.com Sat Sep 24 13:12:13 2005 From: vivian at vdesmedt.com (Vivian De Smedt) Date: Sat, 24 Sep 2005 19:12:13 +0200 Subject: [IPython-dev] Improvement of IPython Pdb Message-ID: <433588ED.6090905@vdesmedt.com> Dear IPython developpers, You will find a patch proposition that improve the IPython debugger. Here is a list of the think it improve. The Pdb debugger output code line in various occasions. - The current line each time the code pointer move (after step, continue, up, down, ..., commands are triggered) - Part of the code listing when the list command is used - One line of each frame when the were command is used - .... The classic Pdb debugger output that code in black and white. The new IPython debugger output that same code in color (according to the color scheme of IPython) with the same format used by IPython to output the stack of trace back when an exception is not catched by the python code. The classic Pdb debugger signal the breakpoint with a 'B' in front of the line it is positioned. The new IPython debugger signal the breakpoint with a red number (bright is the breakpoint in enabled, dark otherwise) with the advantage that: - it is easy to know the breakpoint index (to enable or disable or clear them with the corresponding debugger commands) - the status of the breakpoint is visible - it is in color (I like colors) With the current IPython debugger the completion list do not take into account the frame context of the running code. It is stuck to the IPython namespace. In particular it will no make suggestions for local variable name. The new IPython debugger fix that situation now the completion mecanism is adapted to the running code making suggestion for both local and global variable names of the runing program and it will return to the one of the IPython namespace when the debugger return. I'm impatient to know how you appreciate these new features and to learn from you how to improve this new debugger. I hope you will accept this patch (I'll be to proud to contribute to such nice software) Kindest regards, Vivian. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch.txt URL: From vivian at vdesmedt.com Sun Sep 25 09:29:15 2005 From: vivian at vdesmedt.com (Vivian De Smedt) Date: Sun, 25 Sep 2005 15:29:15 +0200 Subject: [IPython-dev] Improve traceback and where output deep (and patch against svn version) Message-ID: <4336A62B.6060401@vdesmedt.com> Dear IPython developper, This is a new version of my previous patch. It is done on the svn version of IPython so integration to the code (at least to test) should be easier. Furthermore that patch improve traceback and where output. The classic version of IPython traceback contains a bit more that is really relevant. specially when the traceback is produced after: run -d myscript.py and that myscript raise and un catched error. Furthermore if %pdb is on the where command shows the stack starting from the mainloop of IPython. After the patch the traceback produced in all situations: - run -d myscript.py - run myscript.py contains only what is relevant for the script. Furthermore the where command output the same part of the stack that the traceback. Kindest regards, Vivian. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch.txt URL: From jorgen.stenarson at bostream.nu Mon Sep 26 14:54:59 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Mon, 26 Sep 2005 20:54:59 +0200 Subject: [IPython-dev] wildcard-patch Message-ID: <43384403.6070505@bostream.nu> hi I have thought about Ville's suggestions and have made the following changes (some are not related to his comments) *Changed docstring for %psearch to replace %listdef with %psearch. Added a few more examples. *Added use of the pager, so long outputs are paused *Now searches all objects not just modules. This means a lot more matches are generated if a loose pattern is specified. ?*.* will match all objects in all modules just as before and also all attributes of all objects in the searched namespaces. *Case insensitive by default *Changed options to use hyphen+singleletter instead of !+singleletter eg. -c for case sensitive -a for show all (even objects starting with single underscore) usage: ?PATTERN [OBJECT TYPE] [-NAMSPACE]+ [+NAMESPACE]+ [-a] [-c] Ville Vainio wrote: ... > Does "%psearch *.*ste*" work, so that it will find os.system? > > Can I search for methods in a bunch classes, a'la > > %psearch mymod.MyClass*Impl.get* Now both these cases work as expected ... > ipython. Perhaps the searchable namespaces could be "remembered" and > removed by > > %psearch -addns os > %psearch -rmns sys This may be something that is desireable but currently the only possible choices for namespaces are: user, builtin, internal, alias which are the four namespaces stored in the shell object. And they can be added/removed by +- before the namespace. At this point I think the wildcard patch is feature complete, from my point of view, for the next release. Fernando are there any other changes you would like before comitting the patch? /J?rgen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch-20050926 URL: From Fernando.Perez at colorado.edu Wed Sep 28 05:42:58 2005 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Wed, 28 Sep 2005 03:42:58 -0600 Subject: [IPython-dev] wildcard-patch In-Reply-To: <43384403.6070505@bostream.nu> References: <43384403.6070505@bostream.nu> Message-ID: <433A65A2.5020603@colorado.edu> Sorry for my silence for the last few days... I was at scipy'05 and transitioned into a family visit. I should be back to more normal activity (to look into this and other ipython-related issues) by the weekend. Thanks for being patient... f From hans_meine at gmx.net Thu Sep 29 10:57:20 2005 From: hans_meine at gmx.net (Hans Meine) Date: Thu, 29 Sep 2005 16:57:20 +0200 Subject: [IPython-dev] random.seed() Was: [FWD] An interesting take on the Notebook Problem In-Reply-To: <200508011821.14279.hans_meine@gmx.net> References: <200508011821.14279.hans_meine@gmx.net> Message-ID: <200509291657.21225.hans_meine@gmx.net> On Monday 01 August 2005 18:21, Hans Meine wrote: > > random.seed() deterministically sets the whole state from an > > integer/long. Calling random.seed() should be enough. > > That's what I thought, too. However, I tried that with a unit-testing > program which draws a lot more than 20 numbers, and there was a difference > (fatal for me). That is the whole reason for my posting, because what you > wrote was exactly my understanding of a "seed". I finally found out what caused my problems. This is how my program started: import random, time if len(sys.argv) > 1: seed = long(sys.argv[1]) else: seed = time.time() print "using %d as seed." % (seed, ) random.seed(seed) This is for stochastic unit-testing, but when it fails, I wanted to be able to reproduce that, see the cmdline parameter. Now please tell me if you see the problem? *** solution follows *** I found it: time.time() gives a float, but the %d output silently truncates it. Seeding with the float does something different (IIRC, the docs say that any hashable object can be used for seed()ing, but seed(hash(seed)) is *not* what happens). Sorry for the noise, but you know this satisfied feeling when you finally found an explanation.. ;-) Have a nice day, Hans PS: My next posting will be on-topic again, promised! :-) From jorgen.stenarson at bostream.nu Thu Sep 29 16:29:39 2005 From: jorgen.stenarson at bostream.nu (=?ISO-8859-15?Q?J=F6rgen_Stenarson?=) Date: Thu, 29 Sep 2005 22:29:39 +0200 Subject: [IPython-dev] wildcard-patch In-Reply-To: <200509271005.57986.hans_meine@gmx.net> References: <43384403.6070505@bostream.nu> <200509271005.57986.hans_meine@gmx.net> Message-ID: <433C4EB3.60803@bostream.nu> Hans Meine wrote: ... >>usage: >>?PATTERN [OBJECT TYPE] [-NAMSPACE]+ [+NAMESPACE]+ [-a] [-c] > > If you put this into the docs somewhere, I would change [...]+ to [...]* to > make it match the regular expression syntax. Otherwise, one could read it as > "at least one specification" which is probably not what you mean. :-) > > And BTW: One "E" is missing, but I guess that's just a typo in your mail. > I have improved the docstrings taking Hans's suggestions into account. However I don't feel comfortable editing the manual since I don't have lyx installed. /J?rgen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wildcard-patch-20050929 URL: