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

David Ascher da@maigret.cog.brown.edu
Fri, 20 Sep 1996 11:45:37 -0400 (EDT)


> 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.

Ugh.  It seems cumbersome in 95% of cases -- in other words, a given
user is likely to want either umath or fast_umath most of the time.
Having to type .umath every time seems user-unfriendly.

Is there a setup which would let people do:

	import Numeric
	Numeric.log(1.0)   [referring to Numeric.umath.log]
	Numeric.makeFast()
	Numeric.log(1.0)   [referring to Numeric.fast_umath.log]
	Numeric.makeSafe()
	Numeric.log(1.0)   [referring to Numeric.umath.log]


[with the .umath and .fast_umath ways still being there in case people
 want .umath.log and .fast_umath.exp]


Alternatively:

	import Numeric
	Numeric.log(1.0)   [referring to Numeric.umath.log]
	import FastNumeric
	Numeric = FastNumeric
	Numeric.log(1.0)   [referring to Numeric.fast_umath.log]
	import SafeNumeric
	Numeric = SafeNumeric
	Numeric.log(1.0)   [referring to Numeric.umath.log]
 
Or some such variant? 

--david

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

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