[PYTHON MATRIX-SIG] Some thoughts on default axes.

Konrad Hinsen hinsen@ibs.ibs.fr
Thu, 22 Aug 1996 20:52:10 +0100

Jim Hugunin wrote:
> Konrad Hinsen wrote:
> >
> > Jim Hugunin wrote:
> > >
> > > I really don't think that a complete set of both function should be
> > > provided.  The great value in this proposal is it lets me define the
> > > "proper" default axis for each function without fear of people not being
> > > able to remember which one that is.
> >
> > That supposes that the naming convention is easier to remember than
> > the default axis, which is not obvious to me. I can imagine people
> > wondering whether the correct function is fft or fft_.
> I'd argue here that if you can remember that fft operates on the -1
> axis, you can remember that all functions that operate by default on the
> -1 axis have an underscore after them (which by the way is not a naming
> convention I find reasonable).

I agree, but such a naming convention is useful if it is *easier*
to remember, not just as easy.

> Your concern about people wondering whether it's fft or fft_ is exactly
> my concern about people wondering if its axis=-1 or axis=0.

That was the point of my example!

> > > If the names of these functions somehow made their categories obvious,
> > > then I'd be happy to set the default axis for the nonstructural
> > > operations to be -1.
> >
> > I can't think of a naming scheme that would work like that.
> I can't either, but I do think this would be a fine solution if somebody
> can come up with the right names.

Actually, of all the "weird" proposals made by Tim, I give the best
chances to something like the "verb/adjective" distinction. At least
this is a clear distinction, which does not depend on some trivial
add-on that could or could not be there. But of course I can't propose
any working scheme that looks reasonable...

Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-
Institut de Biologie Structurale       | Fax:  +33-
41, Ave. des Martyrs                   | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais

MATRIX-SIG  - SIG on Matrix Math for Python

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