diff --git a/wrap/Method.cpp b/wrap/Method.cpp index 476260b2c..eadf452e3 100644 --- a/wrap/Method.cpp +++ b/wrap/Method.cpp @@ -29,6 +29,7 @@ using namespace std; using namespace wrap; /* ************************************************************************* */ +/// Cython: Rename functions which names are python keywords static const std::array pythonKeywords{{"print", "lambda"}}; static std::string pyRename(const std::string& name) { if (std::find(pythonKeywords.begin(), pythonKeywords.end(), name) == diff --git a/wrap/Module.cpp b/wrap/Module.cpp index 4f0dcd98c..192992dbc 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -369,9 +369,10 @@ void Module::emit_cython_pxd(FileWriter& pxdFile) const { /* ************************************************************************* */ void Module::emit_cython_pyx(FileWriter& pyxFile) const { // headers... + string pxdHeader = name + "_wrapper"; pyxFile.oss << "cimport numpy as np\n" - "cimport cythontest_wrapper as gtsam\n" - "from cythontest_wrapper cimport shared_ptr\n" + "cimport " << pxdHeader << " as " << name << "\n" + "from "<< pxdHeader << " cimport shared_ptr\n" "from eigency.core cimport *\n" "from libcpp cimport bool\n\n" "from libcpp.pair cimport pair\n"