Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-07 Thread Antoine Pitrou
On Fri, 2 Sep 2016 02:16:35 -0700 Nathaniel Smith wrote: > > > > Depending on how minimal and universal you want to keep things, I use > > the ctypes approach quite often, i.e. treat your numpy inputs an > > outputs as arrays of doubles etc using the ndpointer(...) syntax. I > > find it works well

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-06 Thread Chris Barker
On Fri, Sep 2, 2016 at 1:16 AM, Peter Creasey wrote: > > I'm not quite sure which approach is state-of-the-art as of 2016. How > would > > you do it if you had to make a C/C++ library available in Python right > now? > > > > In my case, I have a C library with some scientific functions on matrice

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Thiago Franco Moraes
I think you can use ffi.from_buffer and ffi.cast from cffi. On Fri, Sep 2, 2016 at 8:53 AM Carl Kleffner wrote: > fork / extension of cffiwrap: > > > *"cfficloak - A simple but flexible module for creating object-oriented, > pythonic CFFI wrappers.This is an extension of > https://bitbucket.or

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Carl Kleffner
fork / extension of cffiwrap: *"cfficloak - A simple but flexible module for creating object-oriented, pythonic CFFI wrappers.This is an extension of https://bitbucket.org/memotype/cffiwrap "* 2016-09-02 13:46 GMT+02:00 Sebastian Haase : > How do these t

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Sebastian Haase
How do these two relate to each other !? - Sebastian On Fri, Sep 2, 2016 at 12:33 PM, Carl Kleffner wrote: > maybe https://bitbucket.org/memotype/cffiwrap or https://github.com/ > andrewleech/cfficloak helps? > > C. > > > 2016-09-02 11:16 GMT+02:00 Nathaniel Smith : > >> On Fri, Sep 2, 2016 at

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Carl Kleffner
maybe https://bitbucket.org/memotype/cffiwrap or https://github.com/andrewleech/cfficloak helps? C. 2016-09-02 11:16 GMT+02:00 Nathaniel Smith : > On Fri, Sep 2, 2016 at 1:16 AM, Peter Creasey > wrote: > >> Date: Wed, 31 Aug 2016 13:28:21 +0200 > >> From: Michael Bieri > >> > >> I'm not quite

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Nathaniel Smith
On Fri, Sep 2, 2016 at 1:16 AM, Peter Creasey wrote: >> Date: Wed, 31 Aug 2016 13:28:21 +0200 >> From: Michael Bieri >> >> I'm not quite sure which approach is state-of-the-art as of 2016. How would >> you do it if you had to make a C/C++ library available in Python right now? >> >> In my case, I

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-02 Thread Peter Creasey
> Date: Wed, 31 Aug 2016 13:28:21 +0200 > From: Michael Bieri > > I'm not quite sure which approach is state-of-the-art as of 2016. How would > you do it if you had to make a C/C++ library available in Python right now? > > In my case, I have a C library with some scientific functions on matrices

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-09-01 Thread Neal Becker
Jason Newton wrote: > I just wanted to follow up on the C++ side of OP email - Cython has quite > a > few difficulties working with C++ code at the moment. It's really more of > a C solution most of the time and you must split things up into a mostly C > call interface (that is the C code Cython

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Ian Henriksen
On Wed, Aug 31, 2016 at 3:57 PM Jason Newton wrote: > Hey Ian - I hope I gave Cython a fair comment, but I have to add the > disclaimer that your capability to understand/implement those > solutions/workarounds in that project is greatly enhanced from your knowing > the innards of Cython from bei

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Stefan van der Walt
On Wed, Aug 31, 2016, at 13:57, Jason Newton wrote: > Hey Ian - I hope I gave Cython a fair comment, but I have to add the > disclaimer that your capability to understand/implement those > solutions/workarounds in that project is greatly enhanced from your > knowing the innards of Cython from being

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Jason Newton
Hey Ian - I hope I gave Cython a fair comment, but I have to add the disclaimer that your capability to understand/implement those solutions/workarounds in that project is greatly enhanced from your knowing the innards of Cython from being core developer on the Cython project. This doesn't detract

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Ian Henriksen
We use Cython very heavily in DyND's Python bindings. It has worked well for us even when working with some very modern C++. That said, a lot depends on exactly which C++ features you want to expose as a part of the interface. Interfaces that require things like non-type template parameters or vari

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Jason Newton
I just wanted to follow up on the C++ side of OP email - Cython has quite a few difficulties working with C++ code at the moment. It's really more of a C solution most of the time and you must split things up into a mostly C call interface (that is the C code Cython can call) and limit exposure/co

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread David Morris
On Wed, Aug 31, 2016 at 2:28 PM, Michael Bieri wrote: > Hi all > > There are several ways on how to use C/C++ code from Python with NumPy, as > given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore, > there's at least pybind11. > > I'm not quite sure which approach is state-of-t

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Sylvain Corlay
+1 on pybind11. Sylvain On Wed, Aug 31, 2016 at 1:28 PM, Michael Bieri wrote: > Hi all > > There are several ways on how to use C/C++ code from Python with NumPy, as > given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore, > there's at least pybind11. > > I'm not quite sure wh

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Neal Becker
Michael Bieri wrote: > Hi all > > There are several ways on how to use C/C++ code from Python with NumPy, as > given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore, > there's at least pybind11. > > I'm not quite sure which approach is state-of-the-art as of 2016. How > would y

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Robert Kern
On Wed, Aug 31, 2016 at 12:28 PM, Michael Bieri wrote: > > Hi all > > There are several ways on how to use C/C++ code from Python with NumPy, as given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore, there's at least pybind11. > > I'm not quite sure which approach is state-of-the

[Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Michael Bieri
Hi all There are several ways on how to use C/C++ code from Python with NumPy, as given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore, there's at least pybind11. I'm not quite sure which approach is state-of-the-art as of 2016. How would you do it if you had to make a C/C++ li