From f9e7c7d942618c346d96704a7f0b0880e526b0a8 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 7 Oct 2020 01:42:57 -0400 Subject: [PATCH] Squashed 'wrap/' changes from 5e1373486..2192b194e 2192b194e Merge pull request #8 from borglab/fix/serialization 3a3461a35 Fix test ce3d5c35d Fix serialization git-subtree-dir: wrap git-subtree-split: 2192b194edc35142e529adcf50ed5e6803d48975 --- pybind_wrapper.py | 4 ++-- tests/expected-python/geometry_pybind.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pybind_wrapper.py b/pybind_wrapper.py index 3624d06df..8022a2f77 100755 --- a/pybind_wrapper.py +++ b/pybind_wrapper.py @@ -74,8 +74,8 @@ class PybindWrapper(object): ) .def("deserialize", []({class_inst} self, string serialized){{ - return gtsam::deserialize(serialized, self); - }}) + gtsam::deserialize(serialized, *self); + }}, py::arg("serialized")) '''.format(class_inst=cpp_class + '*')) is_method = isinstance(method, instantiator.InstantiatedMethod) diff --git a/tests/expected-python/geometry_pybind.cpp b/tests/expected-python/geometry_pybind.cpp index 6e18f83d7..2cf104d34 100644 --- a/tests/expected-python/geometry_pybind.cpp +++ b/tests/expected-python/geometry_pybind.cpp @@ -45,8 +45,8 @@ PYBIND11_MODULE(geometry_py, m_) { ) .def("deserialize", [](gtsam::Point2* self, string serialized){ - return gtsam::deserialize(serialized, self); - }) + gtsam::deserialize(serialized, *self); + }, py::arg("serialized")) ; py::class_>(m_gtsam, "Point3") @@ -59,8 +59,8 @@ PYBIND11_MODULE(geometry_py, m_) { ) .def("deserialize", [](gtsam::Point3* self, string serialized){ - return gtsam::deserialize(serialized, self); - }) + gtsam::deserialize(serialized, *self); + }, py::arg("serialized")) .def_static("staticFunction",[](){return gtsam::Point3::staticFunction();}) .def_static("StaticFunctionRet",[]( double z){return gtsam::Point3::StaticFunctionRet(z);}, py::arg("z"));