Re: [Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

2007-09-11 Thread Christopher Barker
Alexander Schmolck wrote: > I just saw a closely related question posted one > week ago here (albeit mostly from a swig context). SWIG, Boost, whatever, the issues are similar. I guess what I'd love to find is an array implementation that plays well with modern C++, and also numpy. > The cod

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread David Cournapeau
David M. Cooke wrote: > > I work on it off and on. As you say, it's not trivial :-) It also has > a tendency to be fragile, so large changes are harder. Something will work > for me, then I merge it into the trunk, and it breaks on half-a-dozen > platforms that I can't test on :-) So, it's slow goi

Re: [Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

2007-09-11 Thread Travis E. Oliphant
Timothy Hochberg wrote: > > > On 9/11/07, *Robert Kern* <[EMAIL PROTECTED] > > wrote: > > Mike Ressler wrote: > > The following seems to be a wart: is it expected? > > > > Set up a 10x10 array and some indexing arrays: > > > > a=arange(100) > >

Re: [Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

2007-09-11 Thread Travis E. Oliphant
> nd to copy hundres of MB around unnecessarily. > > I think it is a real shame that boost currently doesn't properly support numpy > out of the box, although numpy has long obsoleted both numarray and Numeric > (which is both buggy and completely unsupported). All the more so since > writing mult

Re: [Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

2007-09-11 Thread Mike Ressler
Thanks, Robert, for the quick response. On 9/11/07, Robert Kern <[EMAIL PROTECTED]> wrote: > There are operations you can express with this form that you couldn't if the > behavior that you expected were the case whereas you can get the result you > want > relatively straightforwardly. > > In [6]

Re: [Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

2007-09-11 Thread Timothy Hochberg
On 9/11/07, Robert Kern <[EMAIL PROTECTED]> wrote: > > Mike Ressler wrote: > > The following seems to be a wart: is it expected? > > > > Set up a 10x10 array and some indexing arrays: > > > > a=arange(100) > > a.shape=(10,10) > > q=array([0,2,4,6,8]) > > r=array([0,5]) > > > > Suppose I want to ext

Re: [Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

2007-09-11 Thread Alexander Schmolck
Philip Austin <[EMAIL PROTECTED]> writes: > Alexander Schmolck writes: > > > So my question is: might it make sense to use (a slightly wrapped) > > numpy.ndarray, and if so is some code already floating around for that (on > > first glance it seems like there's a bit of support for the obsolete

Re: [Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

2007-09-11 Thread Robert Kern
Mike Ressler wrote: > The following seems to be a wart: is it expected? > > Set up a 10x10 array and some indexing arrays: > > a=arange(100) > a.shape=(10,10) > q=array([0,2,4,6,8]) > r=array([0,5]) > > Suppose I want to extract only the "even" numbered rows from a - then > > print a[q,:] > >

[Numpy-discussion] Slicing/selection in multiple dimensions simultaneously

2007-09-11 Thread Mike Ressler
The following seems to be a wart: is it expected? Set up a 10x10 array and some indexing arrays: a=arange(100) a.shape=(10,10) q=array([0,2,4,6,8]) r=array([0,5]) Suppose I want to extract only the "even" numbered rows from a - then print a[q,:] Every fifth column: print a[:,r] Only the

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread David M. Cooke
David Cournapeau <[EMAIL PROTECTED]> writes: > Travis E. Oliphant wrote: >> Christopher Barker wrote: >> >>> I know this has been discussed, but why doesn't numpy put its includes >>> somewhere that distutils would know where to find it? >>> >>> >> I think one answer is because distuti

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread Bill Spotz
On Sep 11, 2007, at 1:02 PM, Christopher Barker wrote: > There are the tests, which built and ran fine for me, but > that's a bit of a complicated mess. There is a combinatorics problem there that make the tests difficult to follow. Lots of nested macros and such. > Anyway, I'm working on som

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread Christopher Barker
Travis E. Oliphant wrote: > Christopher Barker wrote: >> [OT: why the heck do none of the SWIG docs give examples (or even >> suggest) using distutils for building SWIG extensions???] > > I'm pretty sure this is because the people who contributed to the SWIG > docs the most are not currently usi

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread Travis E. Oliphant
Christopher Barker wrote: > [OT: why the heck do none of the SWIG docs give examples (or even > suggest) using distutils for building SWIG extensions???] > I'm pretty sure this is because the people who contributed to the SWIG docs the most are not currently using numpy.distutils (but probabl

Re: [Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

2007-09-11 Thread Philip Austin
Alexander Schmolck writes: > So my question is: might it make sense to use (a slightly wrapped) > numpy.ndarray, and if so is some code already floating around for that (on > first glance it seems like there's a bit of support for the obsolete Numeric > package in boost, but none for the newer

[Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

2007-09-11 Thread Alexander Schmolck
Hi, I've sent pretty much the same email to c++sig, but I thought I'd also try my luck here, especially since I just saw a closely related question posted one week ago here (albeit mostly from a swig context). I'm working working on an existing scientific code base that's mostly C++ and I'm curre

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread Christopher Barker
Travis E. Oliphant wrote: > I think one answer is because distutils doesn't have defaults that play > well with eggs. Fair enough -- anyone know about the progress of integrating setuptool into the standard library? > Look at any of the setup.py files for scipy for examples of how to use > nu

Re: [Numpy-discussion] how to include numpy headers when building an extension?

2007-09-11 Thread David Cournapeau
Travis E. Oliphant wrote: > Christopher Barker wrote: > >> I know this has been discussed, but why doesn't numpy put its includes >> somewhere that distutils would know where to find it? >> >> > I think one answer is because distutils doesn't have defaults that play > well with eggs.