[Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Per B . Sederberg
Hi Everybody: I was having a massive memory leak problem in some simulations I coded that I traced down to the setmember1d method. After running for about an hour, my program, which should have been taking up .6% of the RAM was taking up 100% of my 4GB of RAM and would eventually get killed by th

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Robert Kern
Per B. Sederberg wrote: > Does anyone have any idea of what might be occurring in setmember1d in > combination with this setup that would cause such a massive memory leak? Can you check out numpy from SVN and see if you can reproduce the leak? I do not see a leak with a recent checkout on OS X wit

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Per B . Sederberg
Robert Kern gmail.com> writes: > > Per B. Sederberg wrote: > > Does anyone have any idea of what might be occurring in setmember1d in > > combination with this setup that would cause such a massive memory leak? > > Can you check out numpy from SVN and see if you can reproduce the leak? > I do

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Robert Kern
Per B. Sederberg wrote: > So the next question is what changed to fix that bug? It looks like the only > difference in the code is that the call to argsort now has (kind='mergesort'). Possibly the default sort code had a bug that was fixed, too, or something deep in the array object. I've rerun

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Jan Strube
I would also like to see a method that doesn't have the unique members requirement. If setmember1d cannot be modified to do that, is there another method that doesn't have these restrictions. Or could one be added? Thanks, Jan ___ Numpy-discussion mai

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-22 Thread Robert Kern
Jan Strube wrote: > I would also like to see a method that doesn't have the unique members > requirement. > If setmember1d cannot be modified to do that, is there another method > that doesn't have these restrictions. Or could one be added? If you can write one that's reasonably efficient, yes. -

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-23 Thread Robert Cimrman
Robert Kern wrote: > Jan Strube wrote: >> I would also like to see a method that doesn't have the unique members >> requirement. >> If setmember1d cannot be modified to do that, is there another method >> that doesn't have these restrictions. Or could one be added? > > If you can write one that's

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-23 Thread Robert Kern
Robert Cimrman wrote: > Robert Kern wrote: >> Jan Strube wrote: >>> I would also like to see a method that doesn't have the unique members >>> requirement. >>> If setmember1d cannot be modified to do that, is there another method >>> that doesn't have these restrictions. Or could one be added? >> I

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-24 Thread Robert Cimrman
Robert Kern wrote: > Robert Cimrman wrote: >> Or you could just call unique1d prior to your call to setmember1d - it >> was meant to be used that way... you would not loose much speed that >> way, IMHO. > > But that doesn't do what they want. They want a function that gives the mask > against thei

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-24 Thread Robert Kern
Robert Cimrman wrote: > Robert Kern wrote: >> Robert Cimrman wrote: >>> Or you could just call unique1d prior to your call to setmember1d - it >>> was meant to be used that way... you would not loose much speed that >>> way, IMHO. >> But that doesn't do what they want. They want a function that giv

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-24 Thread Charles R Harris
On 1/24/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: Robert Kern wrote: > Robert Cimrman wrote: >> Or you could just call unique1d prior to your call to setmember1d - it >> was meant to be used that way... you would not loose much speed that >> way, IMHO. > > But that doesn't do what they want.

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Charles R Harris
On 1/24/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/24/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: > > Robert Kern wrote: > > Robert Cimrman wrote: > >> Or you could just call unique1d prior to your call to setmember1d - > it > >> was meant to be used that way... you would not loose

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Robert Cimrman
Charles R Harris wrote: > On 1/24/07, Charles R Harris <[EMAIL PROTECTED]> wrote: >> >> >> >> On 1/24/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: >> > >> > Robert Kern wrote: >> > > Robert Cimrman wrote: >> > >> Or you could just call unique1d prior to your call to setmember1d - >> > it >> > >> w

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Robert Cimrman
Robert Cimrman wrote: > Charles R Harris wrote: >> >> In [7]: def countmembers(a1, a2) : >> ...: a = sort(a2) >> ...: il = a.searchsorted(a1, side='l') >> ...: ir = a.searchsorted(a1, side='r') >> ...: return ir - il >> ...: >> The subtraction can be replaced by != to get

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Jan Strube
;s actually true. I found it easier to state my problem in terms of unique arrays rather than trying to figure out a general solution, but countmembers sure is nice. Jan -- Forwarded message -- From: Robert Cimrman <[EMAIL PROTECTED]> To: Discussion of Numerical Py

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-26 Thread Charles R Harris
On 1/25/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: Robert Cimrman wrote: > Charles R Harris wrote: >> >> In [7]: def countmembers(a1, a2) : >> ...: a = sort(a2) >> ...: il = a.searchsorted(a1, side='l') >> ...: ir = a.searchsorted(a1, side='r') >> ...: return ir - il >

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-26 Thread Robert Kern
Charles R Harris wrote: > This would be easy to add. I could put in an option side='mask' that > would return 1 if the object is found, 0 otherwise. The type would be > integer rather than boolean but I don't see that as a big problem. If I > add that, I would like to change the keyword to mode in