From 0e278f81c68821b03ead7ccb4976a139fee562f0 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Fri, 10 Mar 2017 23:33:14 -0500 Subject: [PATCH] remove Vectorize, simplify to just numpy.squeeze --- wrap/Module.cpp | 6 ------ wrap/ReturnType.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/wrap/Module.cpp b/wrap/Module.cpp index 9422ac726..a6d9a72f6 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -420,12 +420,6 @@ void Module::emit_cython_pyx(FileWriter& pyxFile) const { "from libcpp.pair cimport pair\n" "from libcpp.string cimport string\n" "from cython.operator cimport dereference as deref\n\n\n"; - pyxFile.oss << -R"rawstr(def Vectorize(*args): - ret = npp.squeeze(npp.asarray(args, dtype='float')) - if ret.ndim == 0: ret = npp.expand_dims(ret, axis=0) - return ret -)rawstr"; // all classes include all forward declarations std::vector allClasses = expandedClasses; diff --git a/wrap/ReturnType.cpp b/wrap/ReturnType.cpp index dbaf2f25c..506e7d471 100644 --- a/wrap/ReturnType.cpp +++ b/wrap/ReturnType.cpp @@ -94,7 +94,7 @@ std::string ReturnType::pyx_casting(const std::string& var, if (isEigen()) { string s = "ndarray_copy(" + var + ")"; if (pyxClassName() == "Vector") - return "Vectorize(" + s + ")"; + return s + ".squeeze()"; else return s; } else if (isNonBasicType()) {