[PYTHON MATRIX-SIG] Using Packages for Numeric Python

Ken Manheimer klm@CNRI.Reston.Va.US
Mon, 9 Sep 1996 16:32:55 -0400 (EDT)


On Mon, 9 Sep 1996, Jim Hugunin wrote:

> Directory is called Numeric.
> 
> The "Standard" Numeric Library is contained in the following modules:
> 	LinearAlgebra.py
> 	Random.py
> 	FFT.py
> 
> What should I now call the module that used to be known as Numeric?  This
> is the module that contains all of the "core" functionality of the
> extension.
> 
> import Numeric.Numeric seems kind of broken to me.
> from Numeric import Numeric works, but I'm not thrilled with it...
> 
> For the life of me I can't come up with a good name to use here.  Is there
> a standard solution to this?

This is where the packages philosophy diverges.  My inclination would be
to have the top level package contain data and functions, as does the
current Numeric module, as well as containing the special-purpose
submodules - Random, FFT, etc.

(You can do this by putting the code for initting the basic numeric
routines in the package's __init__.py module, and/or putting the code in
other modules in the directory and having the __init__.py do a 'from
<blat> import *'.) 

This will reduce the ease of identifying the module components of the
system at the top level, though, similar to the way that files obscure
the visibility of contained directories, in a file system. 

The only name i can think of for doing it as a nested module is
"base.py", and to me that merely emphasizes the notion that the base
routines and data should be situated at the top level.  Fwiw, there is
some precedent for the top-level situation - the os module directly
contains many routines and some data, and also the nested os.path
module.  (In that case the nesting is not effected using ni, however.)

Ken Manheimer		klm@cnri.reston.va.us	    703 620-8990 x268
	    (orporation for National Research |nitiatives

	# If you appreciate Python, consider joining the PSA! #
		  # <http://www.python.org/psa/>. #


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

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