[PYTHON MATRIX-SIG] Default Axes revisited

Jim Hugunin hugunin@mit.edu
Wed, 4 Sep 1996 09:15:32 -0400


> Jim wrote:
> > However, because I don't think it's always obvious what's a structural
and
> > what's a numeric operation, all numeric operations will have a "_"
after
> > their name.
> 
> Just to put in my $0.02:
> 
> I think that using names ending in underscores to distinguish structural
> from numeric_ operations lacks elegance.

I don't think anyone will argue with you here, including myself :-)

> How about making another module, called Structural?
> 
> Then:
> 
> from Numeric import argsort
> from Structural import concatenate
> 
> Use the already-existing Python notion of modules to make it clear which
> operations are numeric and which are structural.  Don't introduce any new
> and arbitrary convention about trailing underscores.

I like this basic idea, but as usual I'm having some problems with the
details (and therein lies the devil)...

Current situation:

There is a package called Numeric Python.

If you do import Numeric, you get all of the functions in that package.

This includes many functions which are axis independent:
	sin, choose, zeros, greater, arrayrange, ...

Some which are structural:
	take, repeat, ...

Some which are numeric (well sort of):
	sort, argmax, ...


I assume that the new proposal would be to put all of these in seperate
modules?  What would you name these three modules (or would you combine
some of them together?)

My other major concern is extensibility.  

fft will not come in the basic package of functions.

Neither will inverse, svd, or others.

These will all come in seperate modules with their own unique names.  I
myself have a module for speech recognition that has both structural
(framing operations) and numeric (mfcc's) functions in it.  Would you
suggest that this be broken up into two modules?

> > I will also probably define functions of the form:
> > 
> > def argmax(x,y=None):
> > 	raise AttributeError, "argmax is a Numeric function, use argmax_"
> 
> I second Konrad's and Guido's comments that this is not a good idea!

Guido rarely needs seconding on this sort of thing.  Forget I ever
mentioned this foolish idea.

-Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================