mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-05-03 19:24:12 +02:00
Access to parameter names and fast erf approx (#298)
- Set parameter starting values, limits or fix through name as well as index - Updated parameter names for the scurve - Fast approximation to erf function (~10% speedup of fitting) --------- Co-authored-by: Khalil Ferjaoui <khalilferjaoui@yahoo.fr>
This commit is contained in:
+12
-4
@@ -31,10 +31,18 @@ void bind_fit_model(py::module& m, const char* name) {
|
||||
py::arg("max_calls") = 100,
|
||||
py::arg("tolerance") = 0.5,
|
||||
py::arg("compute_errors") = false)
|
||||
.def("SetParLimits", &FM::SetParLimits, py::arg("idx"), py::arg("lo"), py::arg("hi"))
|
||||
.def("FixParameter", &FM::FixParameter, py::arg("idx"), py::arg("val"))
|
||||
.def("ReleaseParameter", &FM::ReleaseParameter, py::arg("idx"))
|
||||
.def("SetParameter", &FM::SetParameter, py::arg("idx"), py::arg("val"))
|
||||
.def("SetParLimits", py::overload_cast<unsigned int, double, double>(&FM::SetParLimits), py::arg("idx"), py::arg("lo"), py::arg("hi"))
|
||||
.def("SetParLimits", py::overload_cast<const std::string&, double, double>(&FM::SetParLimits), py::arg("idx"), py::arg("lo"), py::arg("hi"))
|
||||
.def("FixParameter", py::overload_cast<unsigned int, double>(&FM::FixParameter), py::arg("idx"), py::arg("val"))
|
||||
.def("FixParameter", py::overload_cast<const std::string&, double>(&FM::FixParameter), py::arg("idx"), py::arg("val"))
|
||||
.def("ReleaseParameter", py::overload_cast<unsigned int>(&FM::ReleaseParameter), py::arg("idx"))
|
||||
.def("ReleaseParameter", py::overload_cast<const std::string&>(&FM::ReleaseParameter), py::arg("idx"))
|
||||
.def("SetParameter", py::overload_cast<unsigned int, double>(&FM::SetParameter), py::arg("idx"), py::arg("val"))
|
||||
.def("SetParameter", py::overload_cast<const std::string&, double>(&FM::SetParameter), py::arg("idx"), py::arg("val"))
|
||||
.def("GetParName", &FM::GetParName, py::arg("idx"))
|
||||
.def("GetParNames", &FM::GetParNames)
|
||||
.def_property_readonly("par_names", &FM::GetParNames)
|
||||
.def_property_readonly("n_par", [](py::object /*cls*/) { return Model::npar; })
|
||||
.def_property("max_calls", &FM::max_calls, &FM::SetMaxCalls)
|
||||
.def_property("tolerance", &FM::tolerance, &FM::SetTolerance)
|
||||
.def_property("compute_errors", &FM::compute_errors, &FM::SetComputeErrors)
|
||||
|
||||
Reference in New Issue
Block a user