[Numpy-discussion] Does NumPy support indirect memory views?

Alexander Belopolsky ndarray at mac.com
Sat Dec 14 17:22:31 EST 2013


On Sat, Dec 14, 2013 at 2:59 PM, David Cournapeau <cournape at gmail.com>wrote:

> There is indeed no support in NumPy for this. Unfortunately, fixing this
> would be a significant amount of work, as buffer management is not really
> abstracted in NumPy ATM.


While providing a full support for indirect buffers as a storage for NumPy
ndarrays does look like a daunting task, I think some partial support can
be implemented rather easily.

When an ndarray from object constructor encounters an object that can only
expose its memory as an indirect buffer, the constructor can gather the
data into a contiguous buffer.

At the very least, _array_from_buffer_3118() should detect non-null
suboffsets and bail out with a meaningful message rather than expose
pointers as data.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131214/f94a6ed8/attachment.html>


More information about the NumPy-Discussion mailing list