Actually, this reproduces the problem:
from numarray import * from numarray.objects import * abs(-1.)
ObjectArray(1.0)
abs(-1)
ObjectArray(1)
Please ignore this bit of my previous message:
abs(-1)
ObjectArray(1)
Something in my environment (probably me) got a bit confused.
Gary
On Sat, 2004-03-27 at 01:48, Gary Ruben wrote:
Actually, this reproduces the problem:
from numarray import * from numarray.objects import * abs(-1.)
ObjectArray(1.0)
abs(-1)
ObjectArray(1)
I'm guessing, but I think you would like to see:
abs(-1.)
1.0
abs(1)
1
If so, this is a bug. Two things are going on:
1) numarray.objects redefines abs()
2) Internally, numarray has a concept of "rank-0" arrays which it uses to represent scalars. Apparently, numarray.objects lacks the extra code to filter rank-0 arrays out (convert back to scalars) as is done with numerical arrays.
I logged this as a bug on Source Forge and it will be fixed for 1.0.
Regards, Todd