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] Reading in a mesh file

2016-08-31 Thread Robert Kern
On Wed, Aug 31, 2016 at 4:00 PM, Florian Lindner wrote: > > Hello, > > I have mesh (more exactly: just a bunch of nodes) description with values associated to the nodes in a file, e.g. for a > 3x3 mesh: > > 0 0 10 > 0 0.3 11 > 0 0.6 12 > 0.3 0 20 > 0.3 0.3 21 > 0.3 0.6 22 > 0.6 0 30 >

[Numpy-discussion] Reading in a mesh file

2016-08-31 Thread Florian Lindner
Hello, I have mesh (more exactly: just a bunch of nodes) description with values associated to the nodes in a file, e.g. for a 3x3 mesh: 0 0 10 0 0.3 11 0 0.6 12 0.3 0 20 0.3 0.3 21 0.3 0.6 22 0.6 0 30 0.6 0.3 31 0.6 0.6 32 What is best way to read it in and get data structures like

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] Include last element when subindexing numpy arrays?

2016-08-31 Thread Robert Kern
On Wed, Aug 31, 2016 at 1:34 PM, Matti Viljamaa wrote: > > On 31 Aug 2016, at 15:22, Robert Kern wrote: > > On Wed, Aug 31, 2016 at 12:28 PM, Matti Viljamaa wrote: > > > > Is there a clean way to include the last element when subindexing numpy arrays? > > Since the default behaviour of numpy arr

Re: [Numpy-discussion] Include last element when subindexing numpy arrays?

2016-08-31 Thread Matti Viljamaa
> On 31 Aug 2016, at 15:22, Robert Kern wrote: > > On Wed, Aug 31, 2016 at 12:28 PM, Matti Viljamaa > wrote: > > > > Is there a clean way to include the last element when subindexing numpy > > arrays? > > Since the default behaviour of numpy arrays is to omit the “st

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

Re: [Numpy-discussion] Why np.fft.rfftfreq only returns up to Nyqvist?

2016-08-31 Thread Robert Kern
On Wed, Aug 31, 2016 at 1:14 PM, Matti Viljamaa wrote: > > What’s the reasonability of np.fft.rfftfreq returning frequencies only up to Nyquist, rather than for the full sample rate? The answer to the question that you asked is that np.fft.rfft() only computes values for frequencies only up to Ny

Re: [Numpy-discussion] Include last element when subindexing numpy arrays?

2016-08-31 Thread Robert Kern
On Wed, Aug 31, 2016 at 12:28 PM, Matti Viljamaa wrote: > > Is there a clean way to include the last element when subindexing numpy arrays? > Since the default behaviour of numpy arrays is to omit the “stop index”. > > So for, > > >>> A > array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) > >>> A[0:5] > array(

[Numpy-discussion] Why np.fft.rfftfreq only returns up to Nyqvist?

2016-08-31 Thread Matti Viljamaa
What’s the reasonability of np.fft.rfftfreq returning frequencies only up to Nyquist, rather than for the full sample rate? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Include last element when subindexing numpy arrays?

2016-08-31 Thread Matti Viljamaa
Is there a clean way to include the last element when subindexing numpy arrays? Since the default behaviour of numpy arrays is to omit the “stop index”. So for, >>> A array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> A[0:5] array([0, 1, 2, 3, 4]) ___ NumPy-Dis

[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

Re: [Numpy-discussion] Which NumPy/Numpy/numpy spelling?

2016-08-31 Thread Sebastian Berg
On Di, 2016-08-30 at 12:17 -0700, Stefan van der Walt wrote: > On Mon, Aug 29, 2016, at 04:43, m...@telenczuk.pl wrote: > > > > The documentation is not consistent and it mixes both NumPy and > > Numpy. > > For example, the reference manual uses both spellings in the > > introduction > > paragraph