[PYTHON MATRIX-SIG] Finalized 0.3 interface (hopefully)

James Hugunin jjh@Goldilocks.LCS.MIT.EDU
Fri, 19 Jan 96 10:43:53 EST


Well, the comments on my previous post seem to have fallen off, so
I'll try to summarize again and see if everybody's more or less happy.

1) No argument about including Konrad's latest patches (which I now
have)

2) Naming conventions for the new module (this is new)

I think that it's important to understand the value of python's module
system in avoiding conflicts with the current array module, while
still using the name array.

The new array module will be called "multiarraymodule.c".  To use this
module I need to do the following:

import multiarray

a = multiarray.array([1,2,3])

Thus, the creation operator uses the name array (which has a different
meaning in the old arraymodule).

I will reccommend that people actually use the following style instead
to import this module:

import Numeric

a = Numeric.array([1,2,3])                  #an array of longs
b = Numeric.array([1,2,3], types.FloatType) #an array of doubles
c = Numeric.array([1,2,3], 'f')             #an array of floats 

This C type WILL continue to implement automatic type coercion, but I
reserve the right to remove it if I continue to have problems making
my floating point code work in floats instead of doubles.

I'll see how Jim Fulton's CObjects work out before making a final
decision on when to add them to the release.

An array of doubles will have the standard string representation of:

array([1,2,3], 'd')

As before, the print function is coded in python, and I encourage
people to design friendly array print functions.

3) The two math modules will be umath and fast_umath.

4) Two python object UserArray.py and Matrix.py where Matrix
inherits from UserArray.

The two special data members "__array__", and "__return_constructor__"
will be supported for python objects that want to pretend to be an
array.


5) I will have an overall library Numeric.py including what I consider
to be the basic functions desired by a numeric program.  Note: after
considering Konrad's and Paul's comments, this set of basic functions
will be kept to a minimum.

6) doc strings are still the only docs for 0.30, this should change in
BETA1

7) Test suite remains

8) pickle remains

9) "numericmodule.c" is scrapped for now

One last question on installation:

I plan to package this up as an addition to the standard python
distribution, therefore, installation will consist of adding files to
Modules, Lib, and Include.  Does this strike anybody as an
unreasonable thing to do?

-Jim

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

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