[Numpy-discussion] Thoughts on getting "something" in the Python core

Colin J. Williams cjw at sympatico.ca
Fri Apr 1 06:07:38 EST 2005


Travis Oliphant wrote:

>
> To all interested in the future of arrays...
>
> I'm still very committed to Numeric3 as I want to bring the numarray 
> and Numeric people together behind a single array object for 
> scientific computing.
>
Good.

> But,  I've been thinking about the array protocol and thinking that it 
> would be a good thing if this became universal.  One of the ways to 
> make it universal is by having something that follows it in the Python 
> core.
>
>
> So, what if we proposed for the Python core not something like 
> Numeric3 (which would still exist in scipy.base and be everybody's 
> favorite array :-) ),  but a very minimal array object (scaled back 
> even from Numeric) that followed the array protocol and had some C-API 
> associated with it.
>
I thought that your original Numeric3 proposal was in this direction - a 
simple multidimensional array class/type which could
eventually replace Python's array module.  In addition, and separately, 
there were to be a collection of ufuncs.

Later, discussion seemed to drift from the basic Numeric3 towards SciPy.

>
> This minimal array object would support 5 basic types ('bool', 
> 'integer', 'float', 'complex', 'Object').   (Maybe a void type could 
> be defined and a void "scalar" introduced (which would be the bytes 
> object)).  These types correspond to scalars already available in 
> Python and so the whole 0-dim array Python scalar arguments could be 
> ignored.  

Could this be subclassed so that provision could be made for Int8 (or 
even Int1)?

How would an array of records be handled?

>
> Math could be done without ufuncs initially (people really needing 
> speed would use scipy.base anyway).   But, more people in the Python 
> community would be able to use arrays and get used to them.  And we 
> would have a reference array_protocol object so that extension writers 
> could write to it.

It would be good if the user could write his/her ufunc in Python.

>
>
> I would not try a project like this until after scipy_core is out, but 
> it's an interesting thing to think about.  I mainly wanted feedback on 
> the basic concept.
>
The concept looks good.  Regarding timing, it seems better to build the 
foundation before building the house.

Colin W.

>
> An alternative would be to "add" multidimensionality to the array 
> object already part of Python, fix it's reallocating with an exposed 
> buffer problem, and add the array protocol.
>
>
>
> -Travis






More information about the NumPy-Discussion mailing list