[SciPy-user] numarray complex comparisons
Perry Greenfield
perry at stsci.edu
Tue Dec 10 17:44:22 EST 2002
Tim Hochberg writes:
> numarray.set_complex_comp_map(lambda V : V.real) # Do it Travis's way
> numarray.set_complex_comp_map(lambda V : abs(V)) # Do it my way (although
> I'd never actually do this)
> numarray.set_complex_comp_map(None) # Turn it off (the way it should be ;)
>
I'm ambivalent about such solutions since if the person that uses them
isn't careful about resetting the behavior, it could lead to
odd problems occurring in other modules that normally work.
Imagine dealing with a bug report with a problem that you can't
replicate. Customization has been talked about with regard to a number
of things (elementwise vs matrix ops, coercion rules, ...) and
this is always a problem. It cuts both ways, yes more convenient
for specialized uses but harder to integrate with other code which
uses other options.
> > > Off the top of my head, allowing complex comparison and the default
> > > value for the 'axis' keyword will likely be different in SciPy.
> >
> > Not to sound like Eric's parrot (we do disagree on some things
> :-)), but I
> > have to again agree.
>
> How is the axis keyword going to differ?
>
Which axis Numeric defaults to using in a multi-dimensional array
for functions or operations that only operate on one dimension
depends on the kind of operation. Reduction-like operations operate
on axis=0, but processing or time-series-like operations operate
on the last axis (axis=-1). Scipy has adopted a simpler rule of always
using axis=-1 as the default. Each has its adherents. See the
numpy-discussion
list archives in June of this year for some example discussion ("default
axis for numarray"). Particularly look at Konrad Hinsen (pro status quo)
and Eric's message (pro scipy behavior).
Perry
More information about the SciPy-User
mailing list