Adding numpy support to boost::python

Has anyone tried yet adding numpy support to boost::python? Is the only requirement to add "numpy" to load function, or are there more extensive API changes from numarray to numpy?

Neal Becker writes:
Has anyone tried yet adding numpy support to boost::python? Is the only requirement to add "numpy" to load function, or are there more extensive API changes from numarray to numpy?
The only real problem I've encountered is handling the new type object. e.g.: >>> check(y.typecode()); in boost_1_33_1/libs/python/test/numpy.py will fail because the character id returned by y.typecode() has been replaced by a new dtype object: In [19]:import numpy as np In [20]:npArray=np.zeros(5) In [21]:print npArray.typecode() --------------------------------------------------------------------------- exceptions.AttributeError Traceback (most recent call last) /nfs/kite/users/phil/<ipython console> AttributeError: 'numpy.ndarray' object has no attribute 'typecode' In [22]:print npArray.dtype '<i4' In [23]:print npArray.dtype.name int32 In [24]:print npArray.dtype.num 7

Neal Becker <ndbecker2@gmail.com> writes:
Has anyone tried yet adding numpy support to boost::python? Is the only requirement to add "numpy" to load function, or are there more extensive API changes from numarray to numpy?
I don't know what you mean. NumPy is already supported, such as it is. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams writes:
Neal Becker <ndbecker2@gmail.com> writes:
Has anyone tried yet adding numpy support to boost::python? Is the only requirement to add "numpy" to load function, or are there more extensive API changes from numarray to numpy?
I don't know what you mean. NumPy is already supported, such as it is.
He's referring to http://numeric.scipy.org, the merged replacement for Numeric and numarray, which is the new core for http://www.scipy.org. The current version is 0.9.5, it's a couple months away from version 1.0. best, Phil
participants (3)
-
David Abrahams
-
Neal Becker
-
Philip Austin