[PYTHON MATRIX-SIG] NumPy 1.0a3

Jim Hugunin hugunin@mit.edu
Mon, 16 Sep 1996 12:55:18 -0400


> There are a couple of issues that I think ought to be discussed
> before moving from alpha to beta status:
>
> 1) The package system.
> 
I'll leave discussion of this one to others.

> 2) The umath module.
> --------------------

A couple of comments here.

1) fast_umath behavior WILL be the default.  I just don't feel like
compromising on this one.
2) I'd like to make life as easy as possible for people who want umath
exceptions.

Regarding 2, I just looked at that code again and had an interesting idea:

error checking behavior is an attribute of the ofuncs.  Each ofunc has this
attribute set seperately.
Exposing this attribute at the python level would be trivial.

It would then be easy to write the following:

for f in Numeric.umath:
	try:
		f.error_check = 1
	except(AttributeError):
		pass

This would turn on error checking for all of the functions in
Numeric.umath.  This would not involve global variables or any similar
evils.

This does allow things like having error checking on sqrt, but not on log. 
It also allows a function to say:

if sqrt.error_check: do something with errors
else: do something different

The problem (feature?) I see here is that it will change the behavior of
every instance of sqrt.  If I have a function that depends on sqrt not
doing this error check and you have one that does depend on it then there
could be problems (I can't actually think of any cases where this would be
a problem in well written code...)

Just trying to provide fuel to the discussion - Jim

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

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