[PYTHON MATRIX-SIG] Final conventions for alpha2

Konrad HINSEN hinsenk@ere.umontreal.ca
Fri, 16 Aug 1996 13:59:13 -0400

> I don't have a particular bias towards fft, but I do have one towards
> the huge collection of non-strctural numeric operations that have the
> same properties.  Things like histogram, spline, sort, argmax, etc.

That may be a long list, but how often are they applied to arrays
of rank higher than 1? In other words, how frequently would one
have to override a default of zero?

If we settle for a single default for every function (which I still
consider a bad solution), the best test would be to write a lot
of code with explicit axis specifications for everything and then
count which one occurs most often. I bet that is going to be zero.

> If this really troubles you, write:
> def take(a, axis=0): Numeric.take(a, axis)
> at the start of your modules (though not at the start of modules that
> you want me to be able to read).

That's the point, we don't want to create dialects. The problem is
that *I* don't want to read code that is compatible with a general
default of -1.

> And one of my greatest complaints with J is similar to the complaints
> you are always hearing about perl, it makes for very concise but hard to
> read code.  Python has always made the tradeoff for greater readability

But for different reasons. BTW, I don't particularly like J either;
I can never remember all the funny symbols after not using them for
two days. But I never had problems with remembering the default ranks,
because in almost all cases you can deduce them by considering the
most typical application of a function. Basically, the default
should be zero for structural operations, -1 for non-structural
operations acting on vectors, and -2 for non-structural operations
acting on matrices (e.g. inversion). I don't think this is difficult
to remember, and I can't think of a function for which the answer
according to this rule is not obvious.


Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)

MATRIX-SIG  - SIG on Matrix Math for Python

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