| 69 | namespace py { |
| 70 | |
| 71 | inline int import_numpy() { |
| 72 | #ifdef NUMPY_IMPORT_ARRAY |
| 73 | if (PyArray_ImportNumPyAPI() < 0) return -1; |
| 74 | if (PyUFunc_ImportUFuncAPI() < 0) return -1; |
| 75 | #endif |
| 76 | |
| 77 | return 0; |
| 78 | } |
| 79 | |
| 80 | // See above about the missing Numpy integer type numbers |
| 81 | inline int fix_numpy_type_num(int type_num) { |