<br><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 11:42 AM, Aaron Meurer <span dir="ltr"><<a href="mailto:asmeurer@gmail.com" target="_blank">asmeurer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tue, Oct 16, 2012 at 12:38 PM, MinRK <<a href="mailto:benjaminrk@gmail.com">benjaminrk@gmail.com</a>> wrote:<br>
><br>
><br>
> On Tue, Oct 16, 2012 at 11:14 AM, Matthias BUSSONNIER<br>
> <<a href="mailto:bussonniermatthias@gmail.com">bussonniermatthias@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> Le 16 oct. 2012 à 20:03, David Warde-Farley a écrit :<br>
>><br>
>> > On Tue, Oct 16, 2012 at 1:45 PM, Matthias BUSSONNIER<br>
>> > <<a href="mailto:bussonniermatthias@gmail.com">bussonniermatthias@gmail.com</a>> wrote:<br>
>> >><br>
>> >> Le 16 oct. 2012 à 19:24, David Warde-Farley a écrit :<br>
>> >><br>
>> >>> On Thu, Oct 11, 2012 at 7:22 PM, Aaron Meurer <<a href="mailto:asmeurer@gmail.com">asmeurer@gmail.com</a>><br>
>> >>> wrote:<br>
>> >>>> You may want to start a deprecation cycle for the SymPy printing<br>
>> >>>> extension, which has been moved to SymPy itself as of 0.7.2. I would<br>
>> >>>> just have the following logic:<br>
>> >>>><br>
>> >>>> if SymPy version is 0.7.2 or greater: use the ipython version (or<br>
>> >>>> should it use the sympy version?), but emit a deprecation warning<br>
>> >>>> telling the user to just load sympy.interactive.ipythonprinting<br>
>> >>>><br>
>> >>>> if SymPy version is less than 0.7.2: don't do any warnings<br>
>> >>>><br>
>> >>>> And then, when it's been long enough that probably most people are<br>
>> >>>> using SymPy 0.7.2 and IPython 0.13.1 or greater, remove it entirely.<br>
>> >>><br>
>> >>> Hmm. I just fired up one of my SymPy-centric notebooks that I haven't<br>
>> >>> touched in a while with IPython master, SymPy still 0.7.1 from EPD<br>
>> >>> 7.1-2, and the pretty printing is mysteriously not working with<br>
>> >>> %load_ext sympy. Any idea why?<br>
>> >><br>
>> >> %load_ext sympyprinting ?<br>
>> >> ( note that it is currently being moved from IPython to the sympy<br>
>> >> module)<br>
>> ><br>
>> > Thanks Matthias.<br>
>> ><br>
>> > Was it always named "sympyprinting"? I had %load_ext sympy in my<br>
>> > notebook and it used to work, strangely.<br>
>><br>
>> I've always known the extension as sympyprinting.<br>
>><br>
>> ><br>
>> > Why does %load_ext sympy still work then? Does it just silently pass<br>
>> > with any module name? (I noticed just now that "%load_ext pickle"<br>
>> > works…).<br>
>><br>
>> Hum; I have no idea why `%load_ext module` works, or if it should print a<br>
>> warning when there is no extension available with a module.<br>
>> Let's say it's a feature, so that for modules that have extension bundled<br>
>> in it you don't have to remember the name of the extension.<br>
><br>
><br>
> I believe this is the way extensions work:<br>
><br>
> %load_ext [module]<br>
><br>
> which imports [module], then *if module.load_ipython_extension is defined*,<br>
> calls `module.load_ipython_extension(shell)`. The IPython extensions dir is<br>
> just added to sys.path. In this way, any module can be an IPython<br>
> extension. We could definitely add a message in cases where<br>
> `load_ipython_extension` is not defined, which would suggest that it may not<br>
> actually be an extension (not necessarily the case).<br>
<br>
</div></div>So if we wanted to make %load_ext sympy work, what should we do? Just<br>
define load_ipython_extension in __init__.py?</blockquote><div><br></div><div>Yes, that should do it. Even `from sympy.interactive.ipythonprinting import load_ipython_extension` ought to work.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a way to do it<br>
so that load_ipython_extension doesn't get imported with "from sympy<br>
import *"?<br></blockquote><div><br></div><div>I think the only way to do this is to use an explicit `__all__` list of names.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Aaron Meurer<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> But someone who is more familiar with the extension machinery can correct<br>
> me.<br>
><br>
> By the way, I wrote an extension this morning: autosave for notebooks<br>
> (<a href="https://github.com/minrk/autosave_ipython" target="_blank">https://github.com/minrk/autosave_ipython</a>)<br>
><br>
> -MinRK<br>
><br>
>><br>
>> --<br>
>> Matthias<br>
>> _______________________________________________<br>
>> IPython-User mailing list<br>
>> <a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
>> <a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> IPython-User mailing list<br>
> <a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
><br>
_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
</div></div></blockquote></div><br>