[SciPy-dev] Accessible SciPy (ASP) project

Alan G Isaac aisaac at american.edu
Tue Oct 19 10:01:30 CDT 2004


On Mon, 18 Oct 2004, Robert Kern apparently wrote:
> 1. Neither Numeric nor numarray have a consistent axis convention to adopt.

In numarray (which seeks Numeric compatibility) we find

axis=-1:
all of fft stuff
sort, argsort, argmin, argmax, trapz, diff

axis=0:
all of the linear algebra stuff
(except diff in mlab.py, which numarray no longer documents)
along with repeat, concatenate, compress, reduce,
accumulate, average, take, alltrue, sometrue, zreduce,
areduce, put

I consider it a convention to say:
all of the linear algebra stuff uses axis=0,
all of fft stuff uses axis=-1

If the axis question seems pressing for the other functions,
I suggest that for sort, argsort, argmin, argmax, trapz,
diff SciPy can *require* an axis argument, and document this
prominently.  Any other deviation is going to eventually
lead somebody to make a terrible mistake.

It is not tenable for users to know that SciPy relies on
Numeric/numarray but adopts different default behavior.
And, as I said before, this complicates documentation
efforts, which could be a shared effort across Numeric,
numarray, and SciPy.

fwiw,
Alan Isaac






More information about the Scipy-dev mailing list