Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
On Tue, Jul 16, 2013 at 7:15 PM, Geoffrey Irving wrote: > On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz > wrote: > > Hi Geoffrey, > > > > Not to toot my own horn here too much, but you really should have a look > at > > xdress (http://xdress.org/ and https://github.com/xdress/xdress). > XDre

Re: [Numpy-discussion] Really cruel draft of vbench setup for NumPy (.add.reduce benchmarks since 2011)

2013-07-16 Thread Yaroslav Halchenko
and to put so far reported findings into some kind of automated form, please welcome http://www.onerussian.com/tmp/numpy-vbench/#benchmarks-performance-analysis This is based on a simple 1-way anova of last 10 commits and some point in the past where 10 other commits had smallest timing and were

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
Hey Geoffrey, Let's definitely take this off (this) list. The discussion could get involved :). Be Well Anthony On Tue, Jul 16, 2013 at 7:15 PM, Geoffrey Irving wrote: > On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz > wrote: > > Hi Geoffrey, > > > > Not to toot my own horn here too much,

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Geoffrey Irving
On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz wrote: > Hi Geoffrey, > > Not to toot my own horn here too much, but you really should have a look at > xdress (http://xdress.org/ and https://github.com/xdress/xdress). XDress > will generate a wrapper of the Force class for you and then also crea

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
Hi Geoffrey, Not to toot my own horn here too much, but you really should have a look at xdress (http://xdress.org/ and https://github.com/xdress/xdress). XDress will generate a wrapper of the Force class for you and then also create a custom numpy dtype for this class. In this way, you could ge

[Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Geoffrey Irving
Is there a standard way of creating an object array restricted to a particular python type? I want a safe way of sending arrays of objects back and forth between Python and C++, and it'd be great if I could use numpy arrays on the Python side instead of creating a new type. For example, I might h

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Frédéric Bastien
Hi, On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith wrote: > On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma wrote: > >> >Each ndarray does two mallocs, for the obj and buffer. These could be >> combined into 1 - just allocate the total size and do some pointer >> >arithmetic, then set OWNDATA

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Nathaniel Smith
On 16 Jul 2013 11:35, "Arink Verma" wrote: > > Hi, > > I am working on performance parity between numpy scalar/small array and python array as GSOC mentored By Charles. > > Currently I am looking at PyArray_Return, which allocate separate memory just for scalar return. Unlike python which allocate

[Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Arink Verma
Hi, I am working on performance parity between numpy scalar/small array and python array as GSOC mentored By Charles. Currently I am looking at PyArray_Return, which allocate separate memory just for scalar return. Unlike python which allocate memory once for returning result of scalar operatio