correct cython wrapper module name in pyx import

release/4.3a0
Duy-Nguyen Ta 2016-09-14 07:45:26 -04:00
parent 435870ebf0
commit 547606e6c2
2 changed files with 4 additions and 2 deletions

View File

@ -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) ==

View File

@ -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"