[vtk-developers] PROPOSAL: Adding buffer interface to vtkDataArray python wrappers

Berk Geveci berk.geveci at kitware.com
Sat Feb 16 08:57:25 EST 2008


Awesome! Thanks a bunch.

-berk

On 2/16/08, Prabhu Ramachandran <prabhu at aero.iitb.ac.in> wrote:
> Berk Geveci wrote:
> > I committed the buffer support to VTK. I also have some stuff that
> > provides the python support for this but it is definitely not as
> > robust as Prabhu's code in TVTK. If you don't have time in the next
> > few weeks to put those in VTK, maybe I can do it using TVTK as
> > baseline.
>
> I've added this code along with tests to CVS.  The code is in
> vtk.util.numpy_support.  I am not going to add the imports to util's
> __init__ since that will add a dependency on numpy just to get anything
> in the util namespace.
>
> This version is different from that in TVTK in that it does not do
> automatic caching of input arrays.  Therefore it will raise an error if
> you pass it a non-contiguous array.  Likewise if a user gc's the numpy
> array and uses the VTK array they will run into problems.  The array
> caching is definitely doable but adds complexity to the code.  If this
> is desired I can add it.  Do let me know.
>
> I've added a test case for the code in
> Common/Testing/Python/TestNumpySupport.py.
>
> cheers,
> prabhu
>



More information about the vtk-developers mailing list