From 0a82966676717a533aca9bffa4a110453158f29c Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Wed, 20 Mar 2024 15:58:14 +0100 Subject: [PATCH] Add note in the cpp-dummy that pickling support does not work due to no good way to pass the sim id to the new micro simulation instance --- examples/cpp-dummy/micro_cpp_dummy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/cpp-dummy/micro_cpp_dummy.cpp b/examples/cpp-dummy/micro_cpp_dummy.cpp index dd0b6863..3127cc84 100644 --- a/examples/cpp-dummy/micro_cpp_dummy.cpp +++ b/examples/cpp-dummy/micro_cpp_dummy.cpp @@ -68,7 +68,8 @@ PYBIND11_MODULE(micro_dummy, m) { .def("solve", &MicroSimulation::solve) .def("get_state", &MicroSimulation::get_state) .def("set_state", &MicroSimulation::set_state) - .def(py::pickle( + // Pickling support does not work currently, as there is no way to pass the simulation ID to the new instance ms. + .def(py::pickle( // https://pybind11.readthedocs.io/en/latest/advanced/classes.html#pickling-support [](const MicroSimulation &ms) { // __getstate__ return ms.get_state(); },