mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Move NumPy API initialization into libarrow_python
This commit is contained in:
1 parent
0a2d3874bd
commit
68e2d5b8d9
3 files changed
+6
-8
No files matched your search
@@ -47,6 +47,7 @@ set(ARROW_PYTHON_SRCS
|
||||
common.cc
|
||||
config.cc
|
||||
helpers.cc
|
||||
init.cc
|
||||
io.cc
|
||||
numpy_convert.cc
|
||||
pandas_convert.cc
|
||||
@@ -82,6 +83,7 @@ install(FILES
|
||||
config.h
|
||||
do_import_numpy.h
|
||||
helpers.h
|
||||
init.h
|
||||
io.h
|
||||
numpy_convert.h
|
||||
numpy_interop.h
|
||||
|
||||
@@ -19,14 +19,13 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "arrow/python/do_import_numpy.h"
|
||||
#include "arrow/python/numpy_interop.h"
|
||||
#include "arrow/python/init.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
Py_Initialize();
|
||||
arrow::py::import_numpy();
|
||||
arrow::py::InitNumPy();
|
||||
|
||||
int ret = RUN_ALL_TESTS();
|
||||
|
||||
|
||||
@@ -14,17 +14,14 @@
|
||||
# distutils: language = c++
|
||||
# cython: embedsignature = True
|
||||
|
||||
cdef extern from 'arrow/python/do_import_numpy.h':
|
||||
cdef extern from 'arrow/python/init.h':
|
||||
pass
|
||||
|
||||
cdef extern from 'arrow/python/numpy_interop.h' namespace 'arrow::py':
|
||||
int import_numpy()
|
||||
|
||||
cdef extern from 'arrow/python/config.h' namespace 'arrow::py':
|
||||
void Init()
|
||||
void set_numpy_nan(object o)
|
||||
|
||||
import_numpy()
|
||||
InitNumPy()
|
||||
Init()
|
||||
|
||||
import numpy as np
|
||||
|
||||
Reference in new issue
Block a user