[PYTHON MATRIX-SIG] Open Issues (packages, umath, ...)

Jim Hugunin hugunin@mit.edu
Fri, 20 Sep 1996 10:37:05 -0400


There are two open issues that need to be resolved before the alpha5
release can go out.  I'd be tempted to say that these are the only
remaining issues before a beta release (except for cleaner installs on all
the platforms out there).  These are handling errors in umath functions and
use/disuse of packages.

1) umath

I've decided to be reasonable on this issue (well, I guess I just got
intimidated by all the knowledgable people who disagreed with me).  Here's
my current proposal:

Numeric will do "import umath".  Note: it will not do "from umath import
*".

This means that the safe version of the math functions will be used by
default.  On the other hand, you won't be able to type: Numeric.log(1.0)
anymore, this will now look like Numeric.umath.log(1.0) [or any other way
you care to import this module into your namespace].

If you want to change the functions used internally by Numeric, you can
just do Numeric.umath = fast_umath (I hope this actually works...).

I think this scheme makes sense and should make most everybody happy.

Nonetheless, there's an outstanding problem that reveals my ignorance (and
is probably the secret reaons that I've been avoiding umath recently). 
Currently, the safe version of umath does two checks:

1) It tests to see if "errno != 0" which will tell if any of the math
library routines raised an error.  This is obviously an extremely fast
test.

2) It iterates over all of the elements in the array to make sure that they
have legal values (-Infinity < x < Infinity).  This is obviously the slow
part of this process.  This second part of the check is also hard to
implement portably.  Look at the code for the CHECK macro at the top of
ofuncobject.c to see how I'm currently doing it.

So, my questions are, am I doing the right thing here for the safe version
of umath?  Should the two saftely options be split apart so that we now
have three modules with different levels of error checking?



2) packages

I think that the benefits of packages are obvious.  I'm just not sure that
they are currently mature enough to be used in a system that already has
enough complications of its own.

Konrad has already brought up a number of complaints about the package
system.  I'd like to add a few of my own:

1) On my Unix platform (Solaris on a PentiumPro) "import ni" takes about
1.0 seconds.  This is a fairly annoying addition to the startup time of
some of my simpler scripts.  I find it particularly annoying when I try and
run my "numpy" calculator which basically starts up a python interpreter
and does "from Numeric import *".  Interestingly enough, on this same
system I can import all of the modules in the Numeric package (including
the huge LinearAlgebra module) in far less time than I can import ni.

2) "import ni" is just an ugly thing to have at the top of all my files.

Have other people had different experiences using the package system with
alpha4?  Good or bad?

-Jim

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

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