Re: [Numpy-discussion] subclassing array in c

2012-03-30 Thread mark florisson
On 29 March 2012 09:07, Christoph Gohle christoph.go...@mpq.mpg.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 08.03.2012 um 20:39 schrieb Pauli Virtanen: 08.03.2012 17:37, Christoph Gohle kirjoitti: thanks for testing. I have now tried on different platforms. I get all kinds

Re: [Numpy-discussion] subclassing array in c

2012-03-30 Thread Chris Barker
On Fri, Mar 30, 2012 at 10:57 AM, mark florisson markflorisso...@gmail.com wrote: Although the segfault was caused by a bug in NumPy, you should probably also consider using Cython, which can make a lot of this pain and boring stuff go away. Is there a good demo/sample somewhere of an ndarray

Re: [Numpy-discussion] subclassing array in c

2012-03-30 Thread mark florisson
On 30 March 2012 19:53, Chris Barker chris.bar...@noaa.gov wrote: On Fri, Mar 30, 2012 at 10:57 AM, mark florisson markflorisso...@gmail.com wrote: Although the segfault was caused by a bug in NumPy, you should probably also consider using Cython, which can make a lot of this pain and boring

Re: [Numpy-discussion] subclassing array in c

2012-03-30 Thread mark florisson
On 30 March 2012 21:38, mark florisson markflorisso...@gmail.com wrote: On 30 March 2012 19:53, Chris Barker chris.bar...@noaa.gov wrote: On Fri, Mar 30, 2012 at 10:57 AM, mark florisson markflorisso...@gmail.com wrote: Although the segfault was caused by a bug in NumPy, you should probably

Re: [Numpy-discussion] subclassing array in c

2012-03-30 Thread mark florisson
On 30 March 2012 21:40, mark florisson markflorisso...@gmail.com wrote: On 30 March 2012 21:38, mark florisson markflorisso...@gmail.com wrote: On 30 March 2012 19:53, Chris Barker chris.bar...@noaa.gov wrote: On Fri, Mar 30, 2012 at 10:57 AM, mark florisson markflorisso...@gmail.com wrote:

Re: [Numpy-discussion] subclassing array in c

2012-03-29 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 08.03.2012 um 20:39 schrieb Pauli Virtanen: 08.03.2012 17:37, Christoph Gohle kirjoitti: thanks for testing. I have now tried on different platforms. I get all kinds of crashes on os x (now with numpy 1.6.1) and windows with numpy 1.6.0. On

Re: [Numpy-discussion] subclassing array in c

2012-03-29 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 08.03.2012 um 20:39 schrieb Pauli Virtanen: 08.03.2012 17:37, Christoph Gohle kirjoitti: thanks for testing. I have now tried on different platforms. I get all kinds of crashes on os x (now with numpy 1.6.1) and windows with numpy 1.6.0. On

Re: [Numpy-discussion] subclassing array in c

2012-03-09 Thread Pauli Virtanen
09.03.2012 08:00, Christoph Gohle kirjoitti: I don't want to look as if I want other people do my work, so I would like to ask if there is a simple way of tracing memory leaks (without recompiling the python interpreter)? The easiest way probably is to compile Numpy with debug symbols on, set

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Val Kalatsky
Hi Christoph, I've just tried a=[spampub.UnitArray(i,{'s':i}) for i in xrange(1000)] and everything looks fine on my side. Probably my test environment is too different to give comparable results: In [3]: call([uname, -a]) Linux ubuntu 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Christoph Gohle
Dear Val, thanks for testing. I have now tried on different platforms. I get all kinds of crashes on os x (now with numpy 1.6.1) and windows with numpy 1.6.0. On Ubuntu with numpy 1.3.0 I get a hughe memory leak... Any hints would be welcome. Thanks, Christoph Am 08.03.2012 um 09:08 schrieb

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Pauli Virtanen
08.03.2012 17:37, Christoph Gohle kirjoitti: thanks for testing. I have now tried on different platforms. I get all kinds of crashes on os x (now with numpy 1.6.1) and windows with numpy 1.6.0. On Ubuntu with numpy 1.3.0 I get a hughe memory leak... Any hints would be welcome. The type

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Am 08.03.2012 um 20:39 schrieb Pauli Virtanen: 08.03.2012 17:37, Christoph Gohle kirjoitti: thanks for testing. I have now tried on different platforms. I get all kinds of crashes on os x (now with numpy 1.6.1) and windows with numpy 1.6.0. On

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi again, I don't want to look as if I want other people do my work, so I would like to ask if there is a simple way of tracing memory leaks (without recompiling the python interpreter)? Cheers, Christoph Am 09.03.2012 um 01:22 schrieb Christoph

Re: [Numpy-discussion] subclassing array in c

2012-03-08 Thread Francesc Alted
Sure. Check the memcheck tool of Valgrind: http://valgrind.org/info/tools.html#memcheck It is a really amazing tool. Francesc On Mar 8, 2012, at 11:00 PM, Christoph Gohle wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi again, I don't want to look as if I want other people do

[Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have been struggeling for quite some time now. Desperate as I am, now I need help. I was trying to subclass ndarrays in a c extension (see code below) and do constantly get segfaults. I have been checking my INCREF and DECREF stuff up and

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Val Kalatsky
Seeing the backtrace would be helpful. Can you do whatever leads to the segfault from python run from gdb? Val On Wed, Mar 7, 2012 at 7:04 PM, Christoph Gohle christoph.go...@mpq.mpg.dewrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have been struggeling for quite some time now.

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Val Kalatsky
Tried it on my Ubuntu 10.10 box, no problem: 1) Saved as spampub.c 2) Compiled with (setup.py attached): python setup.py build_ext -i 3) Tested from ipython: In [1]: import spampub In [2]: ua=spampub.UnitArray([0,1,2,3.0],'liter') In [3]: ua Out[3]: UnitArray([ 0., 1., 2., 3.]) In [4]: ua.unit

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohlke
FWIW, this crashes on Windows with numpy 1.6.1 but not numpy 1.7-git debug build. Christoph Gohlke On 3/7/2012 5:36 PM, Val Kalatsky wrote: Tried it on my Ubuntu 10.10 box, no problem: 1) Saved as spampub.c 2) Compiled with (setup.py attached): python setup.py build_ext -i 3) Tested from

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohle
Dear Val, I agree that more detail is needed. Sorry for that it was late yesterday. I am running Python 2.6.1, numpy development branch (numpy-2.0.0.dev_20101104-py2.6-macosx-10.6-universal.egg). maybe I should switch to release? I compile with your setup.py using 'python setup.py build_ext