Hi,
I have C++ module (OpenGL) that extracts data from numpy arrays. The
interface is pure read-only: It never returns any Python objects but
only extracts data from numpy arrays. Eg:
#include numpy/arrayobject.h
void PrimitiveManager::deleteAtoms(PyObject * numpy_indices)
{
// Extract
Technically, when you write an extension module you really should use
import_array(); in the init method of the extensions module. This ensures
that the C-API is loaded so that the API -table is available if your C++ code
uses the C-API at all.
In this case you are just using some #defines
Hi,
The C++ module here is a class that's used by an OpenGL window, to
extract data from numpy arrays and basically draw molecules whose
coordinates are stored in numpy arrays.
The C++ module is accessed from Python using wrappers generated by swig.
Our application may contain many active
14.02.2012 10:20, Mads Ipsen kirjoitti:
[clip]
* Should import_array() only be called one time, namely when the main
application is started?
It should be called once when the application is started, before you do
any other Numpy-using operations.
On Tue, Feb 14, 2012 at 09:30, Pauli Virtanen p...@iki.fi wrote:
14.02.2012 10:20, Mads Ipsen kirjoitti:
[clip]
* Should import_array() only be called one time, namely when the main
application is started?
It should be called once when the application is started, before you do
any other
On 14/02/2012 10:30, Pauli Virtanen wrote:
14.02.2012 10:20, Mads Ipsen kirjoitti:
[clip]
* Should import_array() only be called one time, namely when the main
application is started?
It should be called once when the application is started, before you do
any other Numpy-using operations.