[Numpy-discussion] core library structure

Travis Oliphant oliphant at enthought.com
Thu Feb 3 16:50:50 EST 2011


I like the thoughts on core-architecture.   These are all things that we were not able to do as part of the NumPy for .NET discussions, but with the right interested parties could be acted upon. 

> 
> I like the lower two levels if, as I assume, they are basically aimed at allocating, deallocating blocks of memory (or equivalent) and doing basic manipulations such as dealing with endianess and casting. Where do you see array methods making an appearance?
> 
> That's correct. Currently, for example, the cast functions take array objects as parameters, something that would no longer be the case.  The array methods vs functions only shows up in the Python exposure, I believe.  The above structure only affects the C library, and how its exposed to Python could remain as it is now.

Right now, the reason the array objects are passed to the cast functions is because variable-sized data-types need the elsize information that comes from the array structure.    This could be handled differently, of course, but the low-levels will need some way of passing variable information like this.   For some data-types you know the size exactly, for others it's a parameter.  

> 
> The original Numeric only had three (IIRC) rather basic methods and everything else was function based, an approach which is probably easier to maintain. The extensive use of methods came from numarray and might be something that could be added at a higher level so that the current ndarrays would be objects combining ow level arrays and ufuncs.
>  
> Sounds reasonable to me.

I agree that the low-level objects should use a functional approach with very few methods.   

-Travis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110203/c54f56f0/attachment.html>


More information about the NumPy-Discussion mailing list