Re: [Numpy-discussion] Leaking memory problem

2013-02-25 Thread Nathaniel Smith
Is this with 1.7? There see a few memory leak fixes in 1.7, so if you aren't using that you should try it to be sure. And if you are using it, then there is one known memory leak bug in 1.7 that you might want to check whether you're hitting: https://github.com/numpy/numpy/issues/2969 -n On 25 Feb

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread josef . pktd
On Mon, Feb 25, 2013 at 9:58 PM, wrote: > On Mon, Feb 25, 2013 at 9:20 PM, Sebastian Berg > wrote: >> On Mon, 2013-02-25 at 10:50 -0500, Skipper Seabold wrote: >>> On Mon, Feb 25, 2013 at 10:43 AM, Till Stensitzki >>> wrote: >>> > >>> > First, sorry that i didnt search for an old thread, but be

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread josef . pktd
On Mon, Feb 25, 2013 at 9:20 PM, Sebastian Berg wrote: > On Mon, 2013-02-25 at 10:50 -0500, Skipper Seabold wrote: >> On Mon, Feb 25, 2013 at 10:43 AM, Till Stensitzki >> wrote: >> > >> > First, sorry that i didnt search for an old thread, but because i >> disagree with >> > conclusion i would at

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Sebastian Berg
On Mon, 2013-02-25 at 10:50 -0500, Skipper Seabold wrote: > On Mon, Feb 25, 2013 at 10:43 AM, Till Stensitzki > wrote: > > > > First, sorry that i didnt search for an old thread, but because i > disagree with > > conclusion i would at least address my reason: > > > >> I don't like > >> np.abs(arr)

Re: [Numpy-discussion] drawing the line (was: Adding .abs() method to the array object)

2013-02-25 Thread Alan G Isaac
I'm hoping this discussion will return to the drawing the line question. http://stackoverflow.com/questions/8108688/in-python-when-should-i-use-a-function-instead-of-a-method Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread josef . pktd
On Mon, Feb 25, 2013 at 7:49 PM, wrote: > On Mon, Feb 25, 2013 at 7:11 PM, Charles R Harris > wrote: >> >> >> On Sat, Feb 23, 2013 at 1:33 PM, Robert Kern wrote: >>> >>> On Sat, Feb 23, 2013 at 7:25 PM, Nathaniel Smith wrote: >>> > On Sat, Feb 23, 2013 at 3:38 PM, Till Stensitzki >>> > wrote:

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread josef . pktd
On Mon, Feb 25, 2013 at 7:11 PM, Charles R Harris wrote: > > > On Sat, Feb 23, 2013 at 1:33 PM, Robert Kern wrote: >> >> On Sat, Feb 23, 2013 at 7:25 PM, Nathaniel Smith wrote: >> > On Sat, Feb 23, 2013 at 3:38 PM, Till Stensitzki >> > wrote: >> >> Hello, >> >> i know that the array object is a

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Charles R Harris
On Sat, Feb 23, 2013 at 1:33 PM, Robert Kern wrote: > On Sat, Feb 23, 2013 at 7:25 PM, Nathaniel Smith wrote: > > On Sat, Feb 23, 2013 at 3:38 PM, Till Stensitzki > wrote: > >> Hello, > >> i know that the array object is already crowded, but i would like > >> to see the abs method added, especi

Re: [Numpy-discussion] Leaking memory problem

2013-02-25 Thread Raul Cota
Josef's suggestion is the first thing I'd try. Are you doing any of this in C ? It is easy to end up duplicating memory that you need to Py_DECREF . In the C debugger you should be able to monitor the ref count of your python objects. btw, for manual tracking of reference counts you can do, sy

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Sebastian Berg
On Mon, 2013-02-25 at 18:01 +0100, Todd wrote: > The problem with b is that it breaks down if the two status have the > same dimensionality. > > I think a better approach would be for > > a in b > > With a having n dimensions, it returns true if there is any subarray > of b that matches a alon

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Sebastian Berg
On Mon, 2013-02-25 at 16:33 +, Nathaniel Smith wrote: > On Mon, Feb 25, 2013 at 3:10 PM, Sebastian Berg > wrote: > > Hello all, > > > > currently the `__contains__` method or the `in` operator on arrays, does > > not return what the user would expect when in the operation `a in b` the > > `a`

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Charles R Harris
On Mon, Feb 25, 2013 at 8:50 AM, Skipper Seabold wrote: > On Mon, Feb 25, 2013 at 10:43 AM, Till Stensitzki > wrote: > > > > First, sorry that i didnt search for an old thread, but because i > disagree with > > conclusion i would at least address my reason: > > > >> I don't like > >> np.abs(arr).

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Todd
The problem with b is that it breaks down if the two status have the same dimensionality. I think a better approach would be for a in b With a having n dimensions, it returns true if there is any subarray of b that matches a along the last n dimensions. So if a has 3 dimensions and b has 6, a i

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Nathaniel Smith
On Mon, Feb 25, 2013 at 3:10 PM, Sebastian Berg wrote: > Hello all, > > currently the `__contains__` method or the `in` operator on arrays, does > not return what the user would expect when in the operation `a in b` the > `a` is not a single element (see "In [3]-[4]" below). True, I did not expec

Re: [Numpy-discussion] Leaking memory problem

2013-02-25 Thread josef . pktd
On Mon, Feb 25, 2013 at 8:41 AM, Jaakko Luttinen wrote: > Hi! > > I was wondering if anyone could help me in finding a memory leak problem > with NumPy. My project is quite massive and I haven't been able to > construct a simple example which would reproduce the problem.. > > I have an iterative a

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Skipper Seabold
On Mon, Feb 25, 2013 at 10:43 AM, Till Stensitzki wrote: > > First, sorry that i didnt search for an old thread, but because i disagree with > conclusion i would at least address my reason: > >> I don't like >> np.abs(arr).max() >> because I have to concentrate to much on the braces, especially if

Re: [Numpy-discussion] Leaking memory problem

2013-02-25 Thread Thouis (Ray) Jones
I added allocation tracking tools to numpy for exactly this reason. They are not very well documented, but you can see how to use them here: https://github.com/numpy/numpy/tree/master/tools/allocation_tracking Ray On Mon, Feb 25, 2013 at 8:41 AM, Jaakko Luttinen wrote: > Hi! > > I was wonderi

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Frédéric Bastien
On Sat, Feb 23, 2013 at 9:34 PM, Benjamin Root wrote: > > My issue is having to remember which ones are methods and which ones are > functions. There doesn't seem to be a rhyme or reason for the choices, and > I would rather like to see that a line is drawn, but I am not picky as to > where it is

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-25 Thread Till Stensitzki
First, sorry that i didnt search for an old thread, but because i disagree with conclusion i would at least address my reason: > I don't like > np.abs(arr).max() > because I have to concentrate to much on the braces, especially if arr > is a calculation This exactly, adding an abs into an old e

[Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Sebastian Berg
Hello all, currently the `__contains__` method or the `in` operator on arrays, does not return what the user would expect when in the operation `a in b` the `a` is not a single element (see "In [3]-[4]" below). The first solution coming to mind might be checking `all()` for all dimensions given i

[Numpy-discussion] Leaking memory problem

2013-02-25 Thread Jaakko Luttinen
Hi! I was wondering if anyone could help me in finding a memory leak problem with NumPy. My project is quite massive and I haven't been able to construct a simple example which would reproduce the problem.. I have an iterative algorithm which should not increase the memory usage as the iteration

Re: [Numpy-discussion] a question about freeze on numpy 1.7.0

2013-02-25 Thread Bradley M. Froehle
I submitted a bug report (and patch) to cx_freeze. You can follow up with them at http://sourceforge.net/p/cx-freeze/bugs/36/. -Brad On Mon, Feb 25, 2013 at 12:06 AM, Gelin Yan wrote: > > > On Mon, Feb 25, 2013 at 3:53 PM, Bradley M. Froehle < > brad.froe...@gmail.com> wrote: > >> I can repro

Re: [Numpy-discussion] a question about freeze on numpy 1.7.0

2013-02-25 Thread Gelin Yan
On Mon, Feb 25, 2013 at 3:53 PM, Bradley M. Froehle wrote: > I can reproduce with NumPy 1.7.0, but I'm not convinced the bug lies > within NumPy. > > The exception is not being raised on the `del sys` line. Rather it is > being raised in numpy.__init__: > > File > "/home/bfroehle/.local/lib/pyt