[IPython-dev] How did Cython magic know to include np.get_include()?

Nathan Goldbaum nathan12343 at gmail.com
Fri Apr 3 22:49:48 EDT 2015


On Fri, Apr 3, 2015 at 7:35 PM, Yuxiang Wang <yw5aj at virginia.edu> wrote:

> Hi all,
>
> When I use %%cython magic, it automatically knows to include the
> np.get_include(), which works really great. But just being curious - how
> was that achieved? Did the code detect whether numpy was imported, and if
> yes it will add np.get_include to the include_dirs?
>
>
You may be interested in the implementation:

https://github.com/cython/cython/blob/9e956fa59e3899a5fae06519d3ca9728db52adb0/Cython/Build/IpythonMagic.py#L192


> Shawn
>
> --
> Yuxiang "Shawn" Wang
> Gerling Research Lab
> University of Virginia
> yw5aj at virginia.edu
> +1 (434) 284-0836
> https://sites.google.com/a/virginia.edu/yw5aj/
>
> _______________________________________________
> 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: <http://mail.python.org/pipermail/ipython-dev/attachments/20150403/5fd5f1d5/attachment.html>


More information about the IPython-dev mailing list