[C++-sig] (no subject)

Eilif Mueller eilif at gmx.de
Thu Sep 21 14:10:39 CEST 2006


Hi All,

maybe this is obvious to most, but...

the following code 

*****************

BOOST_PYTHON_MODULE(atest)
{
  using namespace numeric;
  using namespace boost::python;

  import_array();
  array::set_module_and_type("numpy", "ArrayType");
...

********************

works with numpy-0.9.5 but not with numpy-1.0b5 or up since it seems the 'ArrayType' attribute has been removed from the namespace.  While the module will build and import, the following messages occur when using functions that return arrays or have arrays as arguements:

***************

ImportError: No module named 'numpy' or its type 'ArrayType' did not follow the NumPy protocol

***************

It is sufficient to replace the above line with

array::set_module_and_type("numpy", "ndarray");


cheers,


Eilif

-- 
NEU: GMX DSL Sofort-Start-Set - blitzschnell ins Internet!
Echte DSL-Flatrate ab 0,- Euro* http://www.gmx.net/de/go/dsl



More information about the Cplusplus-sig mailing list