[PyKDE] sip support for Numeric extensions?

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Thu Oct 2 11:12:00 BST 2003


On Wed, 01 Oct 2003 14:39:27 -0600
Joe Van Andel <vanandel at atd.ucar.edu> wrote:

> Has anyone used SIP to build C++ extensions that accept Numeric arrays 
> as arguments, and return Numeric arrays?
> 
> I've found the PyQwt package that converts Numeric arrays to 
> QwtArray's.  This is a good start, but I also need to code extensions 
> that return Numeric arrays.
> 
> If so, could you share a sample of your code (and .sip files)?
> 
I never did, but you can trick sip into returning any kind of Python object
as shown in the attached file (this code returns VTK Python extension objects).

Pointers to classes that should not be handled by sip are replaced by pointers
to void.  This implies that you have provide %MemberCode to do the interfacing
yourself. 

Beware, you have to patch sip's output to import the Numerical Python
extensions.

If you don't get it working, send me a very simple example and I'll wrap it
for you.

Gerard 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: renderwindow.sip
Type: application/octet-stream
Size: 2155 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20031002/c8c27427/renderwindow.obj


More information about the PyQt mailing list