Re: [Numpy-discussion] numpy array to C API

2013-03-25 Thread Gaël Varoquaux
On Thu, Mar 21, 2013 at 05:34:51PM +0100, Valentin Haenel wrote: > > I got currious about the Ctypes approach as well as "Gaël Varoquaux’s > > blog post about avoiding data copies", but the link in the article > > didn't seem to work. (Under "Further Reading and References") > There seems to be

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Valentin Haenel
Dear Søren, * Søren [2013-03-21]: > Your article fell in dry spot when a newbie in C/Python interfacing. > Python-C-API fits perfectly with my current use-case. > > I got currious about the Ctypes approach as well as "Gaël Varoquaux’s > blog post about avoiding data copies", but the link in the

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Søren
Thanks Valentin Your article fell in dry spot when a newbie in C/Python interfacing. Python-C-API fits perfectly with my current use-case. I got currious about the Ctypes approach as well as "Gaël Varoquaux’s blog post about avoiding data copies", but the link in the article didn't seem to work

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Valentin Haenel
* Daniele Nicolodi [2013-03-21]: > On 21/03/2013 10:16, Valentin Haenel wrote: > > Dear Daniele > > > > * Daniele Nicolodi [2013-03-21]: > >> On 21/03/2013 09:45, Valentin Haenel wrote: > >>> if you are new to interfacing python/numpy with C/C++, you may want to > >>> check out: > >>> > >>> http

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Daniele Nicolodi
On 21/03/2013 10:16, Valentin Haenel wrote: > Dear Daniele > > * Daniele Nicolodi [2013-03-21]: >> On 21/03/2013 09:45, Valentin Haenel wrote: >>> if you are new to interfacing python/numpy with C/C++, you may want to >>> check out: >>> >>> http://scipy-lectures.github.com/advanced/interfacing_wi

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Valentin Haenel
Dear Daniele * Daniele Nicolodi [2013-03-21]: > On 21/03/2013 09:45, Valentin Haenel wrote: > > if you are new to interfacing python/numpy with C/C++, you may want to > > check out: > > > > http://scipy-lectures.github.com/advanced/interfacing_with_c/interfacing_with_c.html > > > > Disclaimer:

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Daniele Nicolodi
On 21/03/2013 09:45, Valentin Haenel wrote: > if you are new to interfacing python/numpy with C/C++, you may want to > check out: > > http://scipy-lectures.github.com/advanced/interfacing_with_c/interfacing_with_c.html > > Disclaimer: I am the author of this chapter, so this response is a bit > o

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Valentin Haenel
Dear Søren, if you are new to interfacing python/numpy with C/C++, you may want to check out: http://scipy-lectures.github.com/advanced/interfacing_with_c/interfacing_with_c.html Disclaimer: I am the author of this chapter, so this response is a bit of a shameless plug :D Hope it helps none the

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Søren
Thanks Robert, for making that clear. I got a deprecated warning the second I added #include and I got scared off too fast in my exploring phase. Cheers Søren On 20/03/2013 17:03, Robert Kern wrote: > On Wed, Mar 20, 2013 at 1:59 PM, Søren wrote: >> Greetings >> >> I'm extending our existing C

Re: [Numpy-discussion] numpy array to C API

2013-03-20 Thread Chris Barker - NOAA Federal
On Wed, Mar 20, 2013 at 9:03 AM, Robert Kern wrote: I highly recommend using an existing tool to write this interface, to take care of the reference counting, etc for you. Cython is particularly nice. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R

Re: [Numpy-discussion] numpy array to C API

2013-03-20 Thread Robert Kern
On Wed, Mar 20, 2013 at 1:59 PM, Søren wrote: > Greetings > > I'm extending our existing C/C++ software with Python/Numpy in order to do > extra number crunching. > It already works like a charm calling python with the C API . > > But what is the proper way of passing double arrays returned from

[Numpy-discussion] numpy array to C API

2013-03-20 Thread Søren
Greetings I'm extending our existing C/C++ software with Python/Numpy in order to do extra number crunching. It already works like a charm calling python with the C API . But what is the proper way of passing double arrays returned from Python/Numpy routines back to C? I came across PyArray bu