correct cython wrapper module name in pyx import
parent
435870ebf0
commit
547606e6c2
|
@ -29,6 +29,7 @@ using namespace std;
|
||||||
using namespace wrap;
|
using namespace wrap;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
/// Cython: Rename functions which names are python keywords
|
||||||
static const std::array<std::string,2> pythonKeywords{{"print", "lambda"}};
|
static const std::array<std::string,2> pythonKeywords{{"print", "lambda"}};
|
||||||
static std::string pyRename(const std::string& name) {
|
static std::string pyRename(const std::string& name) {
|
||||||
if (std::find(pythonKeywords.begin(), pythonKeywords.end(), name) ==
|
if (std::find(pythonKeywords.begin(), pythonKeywords.end(), name) ==
|
||||||
|
|
|
@ -369,9 +369,10 @@ void Module::emit_cython_pxd(FileWriter& pxdFile) const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Module::emit_cython_pyx(FileWriter& pyxFile) const {
|
void Module::emit_cython_pyx(FileWriter& pyxFile) const {
|
||||||
// headers...
|
// headers...
|
||||||
|
string pxdHeader = name + "_wrapper";
|
||||||
pyxFile.oss << "cimport numpy as np\n"
|
pyxFile.oss << "cimport numpy as np\n"
|
||||||
"cimport cythontest_wrapper as gtsam\n"
|
"cimport " << pxdHeader << " as " << name << "\n"
|
||||||
"from cythontest_wrapper cimport shared_ptr\n"
|
"from "<< pxdHeader << " cimport shared_ptr\n"
|
||||||
"from eigency.core cimport *\n"
|
"from eigency.core cimport *\n"
|
||||||
"from libcpp cimport bool\n\n"
|
"from libcpp cimport bool\n\n"
|
||||||
"from libcpp.pair cimport pair\n"
|
"from libcpp.pair cimport pair\n"
|
||||||
|
|
Loading…
Reference in New Issue