[Numpy-discussion] Latest Array-Interface PEP

Christopher Barker Chris.Barker at noaa.gov
Tue Jan 9 01:38:03 CST 2007


Timothy Hochberg wrote:
> The reason that I ask is that the two projects that I use regularly are 
> wxPython and PIL generally operate on relatively large data chunks and 
> it's not clear that they would see much benefit over this mechanism 
> versus the array protocol.

But is this mechanism any harder? It doesn't look like it to me. In 
fact, as I have written a tiny bit of Numeric extension code, this looks 
  familiar and pretty easy to work with.

> I imagine that between us Chris Barker and I could hack together 
> something for wxPython (not that I've asked him aout it).

I'm not sure when I'll find the time, but I do want to do this.

> And code would 
> probably go a long way to convincing people what a great idea this is. 
> However, all else being equal, it'd be a lot easier to do this for the 
> array protocol since there's no extra infrastructure involved.

Is it that much infrastructure?

It looks like this would, at the least, require an extra include file. 
If this flies , then that will be delivered with python 2.8?  until then 
(and for older pythons) would various extension writers all need to add 
this extra file to their source? And might we get a mess with different 
versions floating around out there trying to interact?

> FWIW, the array protocol PEP seems more relevant to what I do since I'm 
> not concerned so much with the overhead since I'm sending big chunks of 
> data back and forth.

That's the biggest issue, but I think a lot of us use a lot of small 
arrays as well -- and while I don't know if it's a performance hit worth 
worrying about, it's always bugged me that is is faster to convert to a 
python list, then pass it in to wxPython than it is to just pass in the 
array directly.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

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


More information about the Numpy-discussion mailing list