[Numpy-discussion] Latest Array-Interface PEP

Travis Oliphant oliphant at ee.byu.edu
Fri Jan 12 17:23:27 CST 2007


Christopher Barker wrote:

>Gael Varoquaux wrote:
>  
>
>>Yes, indeed. I was just wondering if the PEP could be used for a
>>performant implementation of trees.
>>    
>>
>
>That would be a whole new PEP, and one we're not the least bit ready for.
>
>  
>
>>Basicaly that is mapping a tree to an
>>array, which is possible.
>>    
>>
>
>Possible, but probably not very useful for dense data -- maybe for 
>sparse arrays?
>
>The idea of an array API, rather than (actually in addition to) and 
>array data structure is fabulous! It could be used for sparse arrays, 
>for instance.
>
>I do think it's a topic for another PEP, and probably not even a PEP 
>until we have at least some working code - maybe a sparse array and/or 
>PIL image?
>
>  
>
>>So at what level do we propose the API.  Single-item 
>>access for sure, but  what about
>>
>>array_interface->get_block_from_slice() ?
>>    
>>
>
>I think a slicing API is critical -- at least at the Python level, 
>though at the C level is would sure be nice, and probably could allow 
>for some good optimizations for getting a "block" of data out of some 
>odd data structure.
>
>"Simple is better than complex."
>
>"Although practicality beats purity."
>
>"Now is better than never."
>
>Tells me that we should just focus on the array data structure for the 
>PEP now.
>
>  
>
This is what I'm thinking of too, and I think what Tim is also concerned 
about.   We have the array object and ctypes types that can expose this 
array data structure API (I'm calling it the extended buffer protocol) 
in Python now.  

-Travis




More information about the Numpy-discussion mailing list