[Numpy-discussion] Trying out Numeric3

Peter Verveer verveer at embl.de
Fri Mar 25 11:54:14 EST 2005

>> This could be made a bit simpler by allowing only contiguous arrays, 
>> but then there would need to be a contiguous flag.
> I'm thinking just contiguous arrays would be passed.  While Numeric 
> does support the multi-segment buffer interface.  I doubt extension 
> writers want to try and understand how to deal with it.    I think it 
> would be too much of a burden to other extensions if the array they 
> saw was not contiguous.    Even internal to Numeric, discontiguous 
> arrays are made contiguous all the time (although the new iterator in 
> Numeric3 makes it much easier for a programmer to deal with 
> discontiguous arrays).

It think it would be a real shame not to support non-contiguous data. 
It would be great if such a byte object could be used instead of 
Numeric/numarray arrays when writing extensions. Then I could write C 
extensions that could be made available very easily/efficiently to any 
package supporting it without having to worry about the specific C api 
of those packages. If only contiguous byte objects are supported that 
byte object is not a good option anymore for implementing extensions 
for Numeric unless I am prepared to live with a lot of copying of 
non-contiguous arrays.


More information about the NumPy-Discussion mailing list