On donderdag, jul 31, 2003, at 23:14 Europe/Amsterdam, Alex Martelli wrote: > E.g., the way src/surfarray.c does it in pygame (simplifying just a > bit): > > #include <Numeric/arrayobject.h> > > static PyObject* pixels3d(PyObject* self, PyObject* arg) > { > PyObject* array; > ... > array = PyArray_FromDimsAndData(3, dim, PyArray_UBYTE, startpixel); > if(array) > { > ((PyArrayObject*)array)->flags = > OWN_DIMENSIONS|OWN_STRIDES|SAVESPACE; > ... etc, finish initializing the array object > } > return array; > } Are you using a static build? Because if you use a dynamic build then the PyArray_ functions are actually funky macros that call through a vector, and you have to add an explicit call the the "import_array()" matrix somewhere. And this imports Numeric and initializes the vector. No, wait! import_array() does a PyImport_ImportModule("_numpy"), not PyImport_ImportModule("Numeric"). So maybe fixing this is only a question of importing Numeric, and getting Numeric._numpy._ARRAY_API in import_array(). -- - Jack Jansen <Jack.Jansen@oratrix.com> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4