Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Matthieu Brucher
Hi, scikits.learn.machine/manifold_learning.regression.neighbor contains a kd-tree for neighbors search as well (implemented in C++). Matthieu 2008/7/11 Charles R Harris <[EMAIL PROTECTED]>: > > > On Thu, Jul 10, 2008 at 5:48 PM, Andrew Dalke <[EMAIL PROTECTED]> > wrote: > > > >> >> You can als

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Charles R Harris
On Thu, Jul 10, 2008 at 5:48 PM, Andrew Dalke <[EMAIL PROTECTED]> wrote: > You can also grab the KDTree from Biopython, which is implemented in C. > > > http://www.biopython.org/DIST/docs/api/Bio.KDTree.KDTree'-module.html

Re: [Numpy-discussion] new chararray test fails on Mac OS X

2008-07-10 Thread Robert Kern
On Thu, Jul 10, 2008 at 19:20, Alan McIntyre <[EMAIL PROTECTED]> wrote: > On Thu, Jul 10, 2008 at 8:14 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> For things that you don't expect to be platform specific, there is no >> need. For things that you do expect to be platform specific on >> platforms t

Re: [Numpy-discussion] new chararray test fails on Mac OS X

2008-07-10 Thread Alan McIntyre
On Thu, Jul 10, 2008 at 8:14 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > For things that you don't expect to be platform specific, there is no > need. For things that you do expect to be platform specific on > platforms that you cannot access, please ask for volunteers. Make an > SVN branch if the

Re: [Numpy-discussion] new chararray test fails on Mac OS X

2008-07-10 Thread Robert Kern
On Thu, Jul 10, 2008 at 09:26, Alan McIntyre <[EMAIL PROTECTED]> wrote: > On Thu, Jul 10, 2008 at 10:06 AM, Christopher Hanley <[EMAIL PROTECTED]> > wrote: >> From the svn log it looks like the tests are intended to fail? However >> I would prefer tests that are designed only to fail when probl

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Robert Kern
On Thu, Jul 10, 2008 at 10:33, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > >> Because that's just what a buffer= argument *is*. It is not a place >> for presenting the starting pointer to exotically-strided memory. Use >> __array_interface__s to describe

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Andrew Dalke
On Jul 10, 2008, at 6:38 PM, Dan Lussier wrote: > What I'm trying to do is to calculate the total total potential > energy and coordination number of each atom within a relatively large > simulation. Anne Archibald already responded: > you could try a three-dimensional grid (if your atoms aren't >

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Christopher Barker
Anne Archibald wrote: > Unfortunately, implementing most of the algorithms in the literature > within numpy is going to be fairly cumbersome. Maybe this rtree implementation would help: http://pypi.python.org/pypi/Rtree -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Divi

Re: [Numpy-discussion] python user defined type

2008-07-10 Thread Christopher Barker
Nicolas Rougier wrote: > Concerning the dtype argument during array creation, I thought it was > here for somehow controlling the type of array elements. For example, if > I use a "regular" numpy array (let's say a float array), I cannot set an > item to a string value (it raises a ValueError: sett

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Stéfan van der Walt
2008/7/10 Anne Archibald <[EMAIL PROTECTED]>: > Unfortunately, implementing most of the algorithms in the literature > within numpy is going to be fairly cumbersome. But I think there are > better algorithms you could try: There's also http://pypi.python.org/pypi/scikits.ann Regards Stéfan _

Re: [Numpy-discussion] python user defined type

2008-07-10 Thread Nicolas Rougier
Thanks for the precise explanation that make things clearer. In fact, the example I gave was mainly to illustrate my question in the quickest way. Concerning the dtype argument during array creation, I thought it was here for somehow controlling the type of array elements. For example, if I use

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Charles R Harris
On Thu, Jul 10, 2008 at 2:25 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/10 Charles R Harris <[EMAIL PROTECTED]>: > > > On Thu, Jul 10, 2008 at 9:33 AM, Anne Archibald < > [EMAIL PROTECTED]> > > wrote: > >> > >> 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > >> > >> > Because that's just w

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Bill Baxter
On Fri, Jul 11, 2008 at 5:55 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/10 Dan Lussier <[EMAIL PROTECTED]>: > > We seem to get quite a few posts from people wanting some kind of > spatial data structure (whether they know it or not). Would it make > sense to come up with some kind of c

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Charles R Harris
On Thu, Jul 10, 2008 at 2:55 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/10 Dan Lussier <[EMAIL PROTECTED]>: > > > I am relatively new to numpy and am having trouble with the speed of > > a specific array based calculation that I'm trying to do. > > > > What I'm trying to do is to calcu

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Anne Archibald
2008/7/10 Dan Lussier <[EMAIL PROTECTED]>: > I am relatively new to numpy and am having trouble with the speed of > a specific array based calculation that I'm trying to do. > > What I'm trying to do is to calculate the total total potential > energy and coordination number of each atom within a r

Re: [Numpy-discussion] python user defined type

2008-07-10 Thread Christopher Barker
Nicolas Rougier wrote: > I would like to create numpy array with my own (python) datatype, so I > tried the obvious solution: > > from numpy import * > class Unit(object): > def __init__(self,value=0.0): > self.value = value > def __float__(self): > return self.value >

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Anne Archibald
2008/7/10 Charles R Harris <[EMAIL PROTECTED]>: > On Thu, Jul 10, 2008 at 9:33 AM, Anne Archibald <[EMAIL PROTECTED]> > wrote: >> >> 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: >> >> > Because that's just what a buffer= argument *is*. It is not a place >> > for presenting the starting pointer to exo

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Bruce Southey
Charles R Harris wrote: > > > On Thu, Jul 10, 2008 at 10:38 AM, Dan Lussier <[EMAIL PROTECTED] > > wrote: > > Hello, > > I am relatively new to numpy and am having trouble with the speed of > a specific array based calculation that I'm trying to do. > > Wh

[Numpy-discussion] python user defined type

2008-07-10 Thread Nicolas Rougier
Hi all, I'm rather new to the list so maybe the question is well known but from my researches on the web and list archive, I did not find a clear explanation. I would like to create numpy array with my own (python) datatype, so I tried the obvious solution: from numpy import * class Unit(objec

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Stéfan van der Walt
2008/7/10 Robert Kern <[EMAIL PROTECTED]>: > I was about a week ahead of you. See numpy/lib/stride_tricks.py in the trunk. Robert, this is fantastic! I think people are going to enjoy your talk at SciPy'08. If you want, we could also tutor this in the advanced NumPy session. Cheers Stéfan _

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Charles R Harris
On Thu, Jul 10, 2008 at 10:38 AM, Dan Lussier <[EMAIL PROTECTED]> wrote: > Hello, > > I am relatively new to numpy and am having trouble with the speed of > a specific array based calculation that I'm trying to do. > > What I'm trying to do is to calculate the total total potential > energy and co

[Numpy-discussion] huge array calculation speed

2008-07-10 Thread Dan Lussier
Hello, I am relatively new to numpy and am having trouble with the speed of a specific array based calculation that I'm trying to do. What I'm trying to do is to calculate the total total potential energy and coordination number of each atom within a relatively large simulation. Each atom

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Charles R Harris
On Thu, Jul 10, 2008 at 9:33 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > > > Because that's just what a buffer= argument *is*. It is not a place > > for presenting the starting pointer to exotically-strided memory. Use > > __array_interface__s to des

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-10 Thread Anne Archibald
2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > Because that's just what a buffer= argument *is*. It is not a place > for presenting the starting pointer to exotically-strided memory. Use > __array_interface__s to describe the full range of representable > memory. See below. Aha! Is this stuff docume

Re: [Numpy-discussion] new chararray test fails on Mac OS X

2008-07-10 Thread Alan McIntyre
On Thu, Jul 10, 2008 at 10:06 AM, Christopher Hanley <[EMAIL PROTECTED]> wrote: > From the svn log it looks like the tests are intended to fail? However > I would prefer tests that are designed only to fail when problems > occur. Otherwise we end up with problems with our automatic build and >

[Numpy-discussion] new chararray test fails on Mac OS X

2008-07-10 Thread Christopher Hanley
From the svn log it looks like the tests are intended to fail? However I would prefer tests that are designed only to fail when problems occur. Otherwise we end up with problems with our automatic build and test scripts. Thanks, Chris ==