On Mon, Jul 2, 2012 at 11:15 PM, Andrew Dalke <da...@dalkescientific.com> wrote: > On Jul 2, 2012, at 11:38 PM, Fernando Perez wrote: >> No, that's the wrong thing to test, because it effectively amounts to >> 'import numpy', sicne the numpy __init__ file is still executed. As >> David indicated, you must import multarray.so by itself. > > I understand that clarification. However, it does not affect me. > > I do "import rdkit.Chem". This is all I really care about. > > That imports "rdkit.Chem.rdchem" which is a shared library. > > That shared library calls the C function/macro "import_array", which appears > to be: > > #define import_array() { if (_import_array() < 0) {PyErr_Print(); > PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); > } } > > > The _import_array looks to be defined via > numpy/core/code_generators/generate_numpy_api.py > which contains > > static int > _import_array(void) > { > int st; > PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray"); > PyObject *c_api = NULL; > ... > > > Thus, I don't see any way that I can import 'multiarray' directly, > because the underlying C code is the one which imports > 'numpy.core.multiarray' and by design it is inaccessible to change > from Python code. > > Thus, the correct reference benchmark is "import numpy.core.multiarray"
Oh, I see. I withdraw my comment about how you shouldn't import numpy.core.multiarray directly, I forgot import_array() does that. -n _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion