On Feb 5, 2010, at 2:52 AM, Dag Sverre Seljebotn wrote:

> Robert Bradshaw wrote:
>> On Feb 3, 2010, at 1:22 AM, Dag Sverre Seljebotn wrote:
>>
>>
>>> Me and Kurt's been talking about (finally) getting the memory views
>>> merged. Initially I held back because I wanted to do my part of the
>>> job
>>> first (support indexing, currently they only support raw buffer  
>>> access
>>> and copying), but in the light of how long that's been taking me  
>>> it's
>>> better to get things merged now -- especially as Kurt has a use for
>>> the
>>> existing functionality in fwrap.
>>>
>>
>> I think we should probably be merging this stuff, but just to confirm
>> what I'm reading below, it's all new stuff (not changing or breaking
>> what's there, right)?
>>
> Yep, new stuff (so people shouldn't notice it being there, modulo  
> any bugs).

Does this mean you've re-worked a lot of the buffer code under the  
hood then? (At least we have decent tests, but how confident are you  
that there aren't new bugs for existing code?)

>>> Question first:
>>> - Should the memoryview namespace be named "cython.view",
>>> "cython.memview", "cython.memoryview", "cython.mview",
>>> "cython.memory",
>>> "cython.buffer"?
>>>
>>
>> When will the user be seeing this namespace? Is it all hidden in the
>> int[:] syntax (in which case it shouldn't matter much)? Are there a
>> plethera of functions, or do you just need a place to stick a single
>> class (in which case the namespace might be unneeded, though there's
>> still the question of naming the class).
>>
> 1) The main usecase is for the stride specifiers:
>
> cdef int[::cython.mview.indirect & cython.mview.contig]
>
> for a contiguous array of pointers to single integers, for instance.

I really hope there's eventually a shorthand for this simple case  
someday, though of course you're working on something far more generic.

> 2) The cython.mview.array type. But in time I expect that will be
> enhanced more and can then live in the plain cython scope, so this
> doesn't affect naming.
>
> 3) Some things from that namespace is used in testcases, but that's  
> not
> important.

Lets go for the full "cython.memoryview" as it seems these concepts  
are similar enough to what Python's memoryviews will be offering.  
People who shorten numpy to np are certainly going to shorten this one  
too. FWIW, I implemented the ability to use cython.X namespaces for  
directives in the C++ branch.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to