From 5bb3629d764c06eb1baf2a10721dfab4fedd9a38 Mon Sep 17 00:00:00 2001 From: Shaohui Liu Date: Sat, 18 Apr 2026 20:39:41 +0200 Subject: [PATCH] Return (bool, str) tuple for the IsValid method of SolverOptions. --- _pyceres/core/solver.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_pyceres/core/solver.h b/_pyceres/core/solver.h index 35de604..dc25ac0 100644 --- a/_pyceres/core/solver.h +++ b/_pyceres/core/solver.h @@ -66,7 +66,12 @@ void BindSolver(py::module& m) { py::classh PyOptions(m, "SolverOptions"); PyOptions.def(py::init<>()) .def(py::init()) - .def("IsValid", &Options::IsValid) + .def("IsValid", + [](const Options& self) { + std::string error; + bool valid = self.IsValid(&error); + return std::make_pair(valid, error); + }) .def_property( "callbacks", [](const Options& self) { return self.callbacks; },