[Numpy-discussion] Questions about the array interface.

Chris Barker Chris.Barker at noaa.gov
Thu Apr 7 16:01:03 EDT 2005

Tim Hochberg wrote:
> Scott Gilbert wrote:
>> --- Chris Barker <Chris.Barker at noaa.gov> wrote:

>> I don't see the trade off.

I wasn't sure it applied in this case, but if there were a trade off, we 
should make things easiest for the consumers of arrays.

> I think there is a trade off, but not the one that Chris is worried 
> about. It should be easy to hide complexity of dealing with missing 
> attributes through the various helper functions. The cost will be in 
> speed and will probably be most noticable in C extensions using small 
> arrays where the extra code to check if an attribute is present will be 
> signifigant.

Actually, that is one I'm worried about. You're quite right, if I'm 
dealing with a 2X2 array, those helper functions are going to take much 
longer to run than accessing (and maybe using) the data. Like Tim, I'm 
mostly interested in using this for large data sets, but I think the 
small array thing might crop up unexpectedly. For example, with the 
current numarray, if you pass in an NX2 array to wxPython (to draw a 
polygon, for instance), it's very slow. It turns out that that's because 
a whole set of (2,) arrays are created when extracting the data, so even 
though you're dealing with a large data set, you end up dealing with a 
LOT of small arrays. Of course, the whole point of this is to avoid 
that, but I don't think we should assume that any overhead is negligible.

>> This has to be easier than the situation you have today right?  
well, sure. Though it seems to be harder than using the Numeric API. 
Directly. However, I'll shut up now, as it seems that the proposed 
utility functions will address my issues.


PS to Tim: Want to help out with the wxPython integration?

Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the NumPy-Discussion mailing list