Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robin
On Sat, May 17, 2008 at 7:22 PM, Brian Blais <[EMAIL PROTECTED]> wrote: > at least for me, that was the motivation. I am trying to build a simulation > framework for part of the brain, which requires connected layers of nodes. > A layer is either a 1D or 2D structure of nodes, with each node a >

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Anne Archibald <[EMAIL PROTECTED]>: > 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > >> at least for me, that was the motivation. I am trying to build a simulation >> framework for part of the brain, which requires connected layers of nodes. >> A layer is either a 1D or 2D structure of no

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 3:33 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Sat, May 17, 2008 at 3:18 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> > Base classes also tend to have limited functionality th

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 3:18 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Base classes also tend to have limited functionality that will be common > to > > all derived types. The object type in Python has only a few

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 3:18 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Base classes also tend to have limited functionality that will be common > to > > all derived types. The object type in Python has only a few

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 3:18 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Base classes also tend to have limited functionality that will be common to > all derived types. The object type in Python has only a few methods and > attributes: > > In [4]: dir(object) > Out[4]: > ['__class__', > '__

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:45 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Sat, May 17, 2008 at 1:18 PM, Anne Archibald <[EMAIL PROTECTED]> > wrote: > >> 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: >> >> > at least for me, that was the motivation. I am trying to build a >> simulation >>

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Bryan Cole
> > > From the response, the answer seems to be no, and that I should stick > with the python loops for clarity. But also, the words of Anne > Archibald, makes me think that I have made a bad choice by inheriting > from ndarray, although I am not sure what a convenient alternative > would be.

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:18 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > > > at least for me, that was the motivation. I am trying to build a > simulation > > framework for part of the brain, which requires connected layers of > nodes. > > A layer

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > at least for me, that was the motivation. I am trying to build a simulation > framework for part of the brain, which requires connected layers of nodes. > A layer is either a 1D or 2D structure of nodes, with each node a > relatively complex beast. R

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:02 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/5/17 Charles R Harris <[EMAIL PROTECTED]>: > > > > > > On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> > wrote: > >> > >> On Fri, 16 May 2008, Anne Archibald apparently wrote: > >> > storing actual

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Charles R Harris <[EMAIL PROTECTED]>: > > > On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: >> >> On Fri, 16 May 2008, Anne Archibald apparently wrote: >> > storing actual python objects in an array is probably not >> > a good idea >> >> I have been wondering what

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Brian Blais
On May 17, 2008, at May 17:11:52 AM, Alan G Isaac wrote: On Fri, 16 May 2008, Anne Archibald apparently wrote: storing actual python objects in an array is probably not a good idea I have been wondering what people use object arrays for. I have been guessing that it is for indexing convenienc

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Fri, 16 May 2008, Anne Archibald apparently wrote: > > storing actual python objects in an array is probably not > > a good idea > > I have been wondering what people use object arrays for. > I have been guessing that it

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Alan G Isaac
On Fri, 16 May 2008, Anne Archibald apparently wrote: > storing actual python objects in an array is probably not > a good idea I have been wondering what people use object arrays for. I have been guessing that it is for indexing convenience? Are there other core motivations? Alan Isaac __

Re: [Numpy-discussion] question about optimizing

2008-05-16 Thread Anne Archibald
2008/5/16 Brian Blais <[EMAIL PROTECTED]>: > I have a custom array, which contains custom objects (I give a stripped down > example below), and I want to loop over all of the elements of the array and > call a method of the object. I can do it like: > a=MyArray((5,5),MyObject,10) > > for

[Numpy-discussion] question about optimizing

2008-05-16 Thread Brian Blais
Hello, I have a custom array, which contains custom objects (I give a stripped down example below), and I want to loop over all of the elements of the array and call a method of the object. I can do it like: a=MyArray((5,5),MyObject,10) for obj in a.flat: obj.update() b