[Cython] Move IPython's cython extension to cython

Martín Gaitán gaitan at gmail.com
Sun Apr 6 06:24:10 CEST 2014


On Sun, Apr 6, 2014 at 12:37 AM, Robert Bradshaw <robertwb at gmail.com> wrote:

> I'd say this could generally make sense. Would it be the case that iff
> cython is installed then the %cython magic would be available and just
> work?
>

Yes, but before to use it, you'll need to load the extension somewhere.
Could be with ipython's %load_ext or setting up it in your config script to
be loaded automatically on the startup.

For example, see how octave magic (included in the package oct2py) works

http://nbviewer.ipython.org/github/blink1073/oct2py/blob/master/example/octavemagic_extension.ipynb?create=1

and here is the code
https://github.com/blink1073/oct2py/tree/master/oct2py/ipython

Also, how testable is this (e.g. via automated tests vs. having
> to fire up a notebook and test it manually)?
>

There is some unittests

https://github.com/ipython/ipython/blob/master/IPython/extensions/tests/test_cythonmagic.py

Of course, they could/should be included in the moving. I could refactor
them to remove Nose as a requirement, but obviously IPython (probably few
versions) would be mandatory to run them.

let me know any other consideration/question.

cheers
Martin

-- 
mgaitan.github.io
textosyprextextos.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20140406/1ddc104e/attachment.html>


More information about the cython-devel mailing list