Skip to content

Commit

Permalink
Add note in the cpp-dummy that pickling support does not work due to …
Browse files Browse the repository at this point in the history
…no good way to pass the sim id to the new micro simulation instance
  • Loading branch information
IshaanDesai committed Mar 20, 2024
1 parent edb60de commit 0a82966
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/cpp-dummy/micro_cpp_dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit 0a82966

Please sign in to comment.