<br><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 11:14 AM, Matthias BUSSONNIER <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Le 16 oct. 2012 à 20:03, David Warde-Farley a écrit :<br>
<div class="im"><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>> 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 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>
</div>I've always known the extension as sympyprinting.<br>
<div class="im"><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>
</div>> works…).<br>
<br>
Hum; I have no idea why `%load_ext module` works, or if it should print a 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 in it you don't have to remember the name of the extension.<br></blockquote><div><br></div><div>I believe this is the way extensions work:</div>
<div><br></div><div>%load_ext [module]</div><div><br></div><div>which imports [module], then *if module.load_ipython_extension is defined*, calls `module.load_ipython_extension(shell)`. The IPython extensions dir is just added to sys.path. In this way, any module can be an IPython extension. We could definitely add a message in cases where `load_ipython_extension` is not defined, which would suggest that it may not actually be an extension (not necessarily the case).</div>
<div><br></div><div>But someone who is more familiar with the extension machinery can correct me.</div><div><br></div><div>By the way, I wrote an extension this morning: autosave for notebooks (<a href="https://github.com/minrk/autosave_ipython">https://github.com/minrk/autosave_ipython</a>)</div>
<div><br></div><div>-MinRK</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>
Matthias<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<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>