Re: [Numpy-discussion] matrixdef.py

2006-10-30 Thread Travis Oliphant
Colin J. Williams wrote: > Line 71 has: data.view(subtype) > > This appears to involve a call to __array_finalize__. Is this an > unconditional call? > Yes. Every-time an array is constructed the __array_finalize__ method is called unless the __array_finalize__ attribute is None > If not, w

Re: [Numpy-discussion] Strange numpy.argmax behavior on object arrays in numpy 1.0.

2006-10-30 Thread Travis Oliphant
Tom Denniston wrote: > I recently upgraded to numpy 1.0 from 1.0b5. I noticed that > numpy.argmax behavior is very strange on object arrays. See below: > > (Pdb) numpy.__version__ > '1.0' > (Pdb) numpy.argmax(numpy.array([2, 3], dtype=object)) > 0 > (Pdb) numpy.argmax(numpy.array([2, 3], dtyp

Re: [Numpy-discussion] dtype.hasobject value

2006-10-30 Thread Travis Oliphant
Matthew Brett wrote: > Hi, > > I notice that the value for: > > zeros((1,), dtype=object).dtype.hasobject > > is now 63, whereas previously it had been 1. Is this intended? > > Yes. We are using hasobject as an 8-bit flag now and separating out some of the concepts that make object arrays ob

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Andrew Straw
Fernando Perez wrote: > Here is some more info. We left a long-running job over the weekend > with the prints you suggested. Oddly, something happened at the OS > level which killed our SSH connection to that machine, but the above > numpy dealloc() warning never printed (we logged this). As an a

Re: [Numpy-discussion] Conversion about getting array interface into Python

2006-10-30 Thread Colin J. Williams
Travis Oliphant wrote: > If anybody has a desire to see the array interface into Python, please > help by voicing an opinion on python-dev in the discussion about adding > data-type objects to Python. There are a few prominent people who > don't get why applications would need to share data-

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Fernando Perez
On 10/30/06, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > FYI, this is what is defined in Include/object.h > > /* PyObject_HEAD defines the initial segment of every PyObject. */ > #define PyObject_HEAD \ > _PyObject_HEAD_EXTRA\ > Py_ssize_t ob_refcnt;

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > David Huard wrote: > > > Ok, > > I'll update numpy and give it another try tonight. > > > > I just fixed some reference-count problems in f2py today. These were of > the variety that there was a missing decref that would cause the > referen

Re: [Numpy-discussion] Conversion about getting array interface into Python

2006-10-30 Thread Christopher Barker
Lisandro Dalcin wrote: > Perhaps the reason for this is simple: > few Python core developers are involved in scientific computing and do > not have a clear idea of what it is needed for this. Perhaps true, but. I imagine one of the issues that the python-dev crowd has is that they don't want

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > FYI, this is what is defined in Include/object.h > I forgoy to say in Python-2.5 -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industri

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Fernando Perez <[EMAIL PROTECTED]> wrote: > On 10/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > I suspect the real problem is that the refcount keeps going up. Even if it > > was unsigned it would eventually wrap to zero and with a bit of luck get > > garbage collected. So

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Travis Oliphant
David Huard wrote: > Ok, > I'll update numpy and give it another try tonight. > I just fixed some reference-count problems in f2py today. These were of the variety that there was a missing decref that would cause the reference count of certain often-used data-types to increase without bound a

[Numpy-discussion] dtype.hasobject value

2006-10-30 Thread Matthew Brett
Hi, I notice that the value for: zeros((1,), dtype=object).dtype.hasobject is now 63, whereas previously it had been 1. Is this intended? Thanks, Matthew - Using Tomcat but need to do more? Need to support web services,

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread A. M. Archibald
On 30/10/06, Fernando Perez <[EMAIL PROTECTED]> wrote: > On 10/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > I suspect the real problem is that the refcount keeps going up. Even if it > > was unsigned it would eventually wrap to zero and with a bit of luck get > > garbage collected. So

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Fernando Perez wrote: > > >On 10/30/06, David Huard <[EMAIL PROTECTED]> wrote: > > > > > >>Hi, > >>I have a script that crashes, but only if it runs over 9~10 hours, with the > >>following backtrace from gdb. The script uses PyMC, and repeat

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Travis Oliphant
Fernando Perez wrote: >On 10/30/06, David Huard <[EMAIL PROTECTED]> wrote: > > >>Hi, >>I have a script that crashes, but only if it runs over 9~10 hours, with the >>following backtrace from gdb. The script uses PyMC, and repeatedly calls (> >>100) likelihood functions written in fortran and

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Fernando Perez wrote: > >This sounds awfully reminiscent of the bug I recently mentioned: > > > >http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/3312099 > > > > > > It actually looks very much like it. I think the problem ma

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Travis Oliphant
Fernando Perez wrote: >On 10/30/06, David Huard <[EMAIL PROTECTED]> wrote: > > >>Hi, >>I have a script that crashes, but only if it runs over 9~10 hours, with the >>following backtrace from gdb. The script uses PyMC, and repeatedly calls (> >>100) likelihood functions written in fortran and

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Fernando Perez
On 10/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > I suspect the real problem is that the refcount keeps going up. Even if it > was unsigned it would eventually wrap to zero and with a bit of luck get > garbage collected. So probably something isn't decrementing the refcount. Oops, my ba

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Charles R Harris
On 10/30/06, Fernando Perez <[EMAIL PROTECTED]> wrote: On 10/23/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:> I've placed them in SVN (r3384):>> arraydescr_dealloc needs to do something like. >> if (self->fields == Py_None) {> print something> incref(self)> return;> }Here is some more

Re: [Numpy-discussion] Abaqus Python

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Jonathan Makem <[EMAIL PROTECTED]> wrote: > > Hi, > > I work with Abaqus 6.6.1 finite element software. To access the results > from a simulation, the Abaqus scripting interface is used in Python by > importing OdbAccess modules. These modules can only be accessed using the > versi

Re: [Numpy-discussion] Conversion about getting array interface into Python

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > If anybody has a desire to see the array interface into Python, please > help by voicing an opinion on python-dev in the discussion about adding > data-type objects to Python. There are a few prominent people who > don't get why applicat

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Fernando Perez
On 10/23/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: I've placed them in SVN (r3384): arraydescr_dealloc needs to do something like. if (self->fields == Py_None) { print something incref(self) return; } Here is some more info. We left a long-running job over the weekend with

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread David Huard
Ok, I'll update numpy and give it another try tonight. Regards, David2006/10/30, Fernando Perez <[EMAIL PROTECTED]>: On 10/30/06, David Huard <[EMAIL PROTECTED] > wrote:> Hi,> I have a script that crashes, but only if it runs over 9~10 hours, with the> following backtrace from gdb. The script uses

Re: [Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread Fernando Perez
On 10/30/06, David Huard <[EMAIL PROTECTED]> wrote: > Hi, > I have a script that crashes, but only if it runs over 9~10 hours, with the > following backtrace from gdb. The script uses PyMC, and repeatedly calls (> > 100) likelihood functions written in fortran and wrapped with f2py. > Numpy: 1.

[Numpy-discussion] Conversion about getting array interface into Python

2006-10-30 Thread Travis Oliphant
If anybody has a desire to see the array interface into Python, please help by voicing an opinion on python-dev in the discussion about adding data-type objects to Python. There are a few prominent people who don't get why applications would need to share data-type information about memory a

[Numpy-discussion] Abaqus Python

2006-10-30 Thread Jonathan Makem
Hi,     I work with Abaqus 6.6.1 finite element software. To access the results from a simulation, the Abaqus scripting interface is used in Python by importing OdbAccess modules. These modules can only be accessed using the version of Python that is installed with Abaqus. However, I canno

Re: [Numpy-discussion] dtype() examples that used to work

2006-10-30 Thread Francesc Altet
El dl 30 de 10 del 2006 a les 14:58 +0100, en/na Joris De Ridder va escriure: > IMO, record arrays seem powerful, but also intimidating at a first glance. Agreed, specially if you start to nest datatypes. > I think many didactical examples will help getting them into common use. > I made some eff

Re: [Numpy-discussion] Strange numpy.argmax behavior on object arrays in numpy 1.0.

2006-10-30 Thread Tom Denniston
Yes I definately agree about the latter! On 10/29/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/29/06, Tom Denniston < [EMAIL PROTECTED]> wrote: Oh.  My mistake. I thought I had an array of 2 objects which were ints.  I actually had an array of one list of 2 ints.  It works properly if I

[Numpy-discussion] glibc invalid pointer error

2006-10-30 Thread David Huard
Hi, I have a script that crashes, but only if it runs over 9~10 hours, with the following backtrace from gdb. The script uses PyMC, and repeatedly calls (> 100) likelihood functions written in fortran and wrapped with f2py. Numpy: 1.0.dev3327Python: 2.4.3Does this backtrace give enough info t

Re: [Numpy-discussion] dtype() examples that used to work

2006-10-30 Thread Joris De Ridder
On Friday 27 October 2006 19:06, Francesc Altet wrote: [FA]: for example: [FA]: [FA]: In [67]: dtype([('f1', int16)]) [FA]: Out[67]: dtype([('f1', 'http://www.kuleuven.be/cwis/email_disclaimer.htm - Using Tomcat

Re: [Numpy-discussion] astype() behaviour

2006-10-30 Thread Joris De Ridder
On Friday 27 October 2006 19:01, Francesc Altet wrote: [FA]: A Divendres 27 Octubre 2006 17:58, Joris De Ridder va escriure: [FA]: > Hi, [FA]: > [FA]: > Is the following behaviour of astype() intentional in NumPy 1.0? [FA]: > [FA]: > >>> x = array([1,2,3]) [FA]: > >>> x.astype

[Numpy-discussion] porting

2006-10-30 Thread GMT Hours
Timestamp stack trace etc so too in However am happen before am fixed in are correctly?Its displayed n v notably par am Consoles im getting or two know help much figuring problem thought let know Quote Error am exception returned failure a nsresult is location frame data getvisible latter

Re: [Numpy-discussion] How to check for nan in an array?

2006-10-30 Thread Yves
Forget it. N.isnan() does the job. YVES On Mon, Oct 30, 2006 at 11:47:57AM +0100, Yves wrote: > Hi, > > Is there a way of checking for nan's in an array, as comparing to N.nan > doesn't seem to work. > > In [1]: import numpy as N > > In [2]: a = N.asarray(0.)/0 > Warning: in

[Numpy-discussion] How to check for nan in an array?

2006-10-30 Thread Yves
Hi, Is there a way of checking for nan's in an array, as comparing to N.nan doesn't seem to work. In [1]: import numpy as N In [2]: a = N.asarray(0.)/0 Warning: invalid value encountered in divide In [3]: a Out[3]: nan In [4]: a==N.nan O

[Numpy-discussion] A few questions about numpy.distutils

2006-10-30 Thread David Cournapeau
Hi there, I would like to improve a bit the packaging of pyaudio, and for that, I need to do the following when configuring my package: - to be able to retrieve a header file (sndfile.h). I need the full pathname, because I need to read its content - to be able to retrieve a library fi