[Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

Christopher Barker Chris.Barker at noaa.gov
Mon Aug 3 14:47:55 EDT 2009


Raymond de Vries wrote:
> Thanks for the explanation. After having looked at the documentation, I 
> decided to do my own plain Python c-api implementation.

That is unlikely to be the best option these days -- it's simply too 
easy to make a type checking and or reference counting error.

If SWIG isn't your cup of tea, take a look at Cython or Ctypes -- lower 
level and more control, but still handle much of the book keeping for you.

The Cython team is working on better C++ support, though I don't know 
where they are at with that.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list