[Numpy-discussion] Thoughts on getting "something" in the Python core
verveer at embl-heidelberg.de
Fri Apr 1 00:40:06 CST 2005
Good idea, for many applications such an extension would be 'good
1) python code using such arrays should be 100% compatible with
numarray/numeric/scipy. Should be possible if a sub-set of
numeric/numarray/scipy is used.
2) Extensions written in C should handle such arrays transparently
(without unnecessary copying). Should also be possible given a
compatible data layout.
> 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.
> 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
> 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.
> 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
> 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.
> 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.
> 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.
More information about the Numpy-discussion