[PYTHON MATRIX-SIG] Final matrix object renaming and packaging

James Hugunin jjh@Goldilocks.LCS.MIT.EDU
Tue, 16 Jan 96 13:07:03 EST


   Date: Tue, 16 Jan 1996 12:17:41 -0500
   From: hinsenk@ERE.UMontreal.CA (Hinsen Konrad)

      importing Matrix and Array.  Is there any reason for the user to
      import Array directly?  I am strongly opposed to using "Array" unless

   Certainly, e.g. if the user doesn't want anything else. Besides, as I
   pointed out in my last mail, a general "Numeric" module is not such a
   terrific idea.

      So someone who wants to create a matrix object will do something like:

	import Numeric

	m=Numeric.Matrix_d(...)

   Speaking about constructors... I still prefer (strongly) more
   meaningful names, like IntegerMatrix. Noone should be forced
   to learn these silly type codes for standard applications.

Well, actually I guess I wasn't clear enough about my choice for
constructors.

The array constructor (for PyArrayObjects):

array([1,2,3], 'd') OR array([1,2,3], types.FloatType)

will both produce a 1d array of doubles.

Similarly for Arrays (and Matrix's):

Array([1,2,3], 'd') OR Array([1.,2.,3.]) OR 
Array([1,2,3], types.FloatType)

One dilemma left is what should be used as the standard string
representation of an Array (or an array).

I vote for Array([1,2,3], 'd'), but I'm open to other proposals.


Now, I happen to really like the old notation, and I'd love to come up
with a way to keep it around as a shorthand input notation.  I really
did find that the removal of a set of parenthesis made some of my
denser code a lot easier to read.

So, I propose to add A_d(1,2,3) as a convenient shorthand for
Array([1,2,3], "d").  Please, let me know how terrible an idea this is.

I'd also be happy to have FloatArray(1,2,3) instead.  If something
like this is desired, then I might even choose to use it as the
standard string representation.


-Jim


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

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