[SciPy-user] Need more comments from scientific community on python-dev

Prabhu Ramachandran prabhu at aero.iitb.ac.in
Wed Nov 1 04:53:21 EST 2006


>>>>> "Travis" == Travis Oliphant <oliphant at ee.byu.edu> writes:

    Travis> 2) Examples of sharing memory between two objects.  PIL is
    Travis> the classic example and has some merit, but because the
    Travis> internal memory layout of the PIL is 'pointer-to-pointers'
    Travis> instead of 'big-chunk-of-memory' it's not a 1-1 match to
    Travis> NumPy and the array interface only can comunicate
    Travis> information about the "mode."  But, I can see other
    Travis> examples.  PyMedia, PyGame, PyVideo?  CVXOPT, PyVoxel.

VTK-Python and TVTK use this.  Right now these use the buffer protocol
to allow users to pass numpy data into a vtkDataArray.  It works
reasonably well.  The VTK data arrays have type information so it is
not absolutely essential for an extended buffer protocol here.  TVTK
uses this underlying functionality in VTK to present a cleaner
interface.  The idea is to have VTK use the data setup and manipulated
by numpy without an expensive copy.  The only caveat is that you need
to hang on to a reference of the numpy array if not you will end up
with a segfault.

I just thought this might be a useful data point.

FWIW, I am all for ndarrays/extended buffers in Python core.  It would
encourage a standard way to pass data in and out of wrapped code.

cheers,
prabhu


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the NumPy-Discussion mailing list