Commit 6ebbed9a authored by Jason Rhinelander's avatar Jason Rhinelander

Replace deprecated PYBIND11_PLUGIN with PYBIND11_MODULE

parent 922d579b
......@@ -7,8 +7,9 @@
namespace pyeris {
PYBIND11_PLUGIN(algorithms) {
py::module m("eris.algorithms", "eris interface for Python -- various algorithms and utilities");
PYBIND11_MODULE(algorithms, m) {
m.attr("__name__") = "eris.algorithms";
m.doc() = "eris interface for Python -- various algorithms and utilities";
py::class_<eris::single_peak_result>(m, "single_peak_result")
.def_readonly("arg", &eris::single_peak_result::arg, "The argument that maximizes the function given to single_peak_search()")
......@@ -24,8 +25,6 @@ PYBIND11_PLUGIN(algorithms) {
"`tol_rel` is the relative size of the search domain (i.e. `right-left`) at which to stop "
"iterating (iteration stops when either or these tolerances are met).\n\nReturns a"
"single_peak_result instance containing the argument and maximum at that argument.");
return m.ptr();
}
}
......@@ -7,8 +7,9 @@
namespace pyeris {
PYBIND11_PLUGIN(core) {
py::module m("eris", "eris interface for Python -- core functionality");
PYBIND11_MODULE(core, m) {
m.attr("__name__") = "eris";
m.doc() = "eris interface for Python -- core functionality";
py::class_<MemberID>(m, "MemberID")
.def(py::init<eris_id_t>())
......@@ -24,8 +25,6 @@ PYBIND11_PLUGIN(core) {
py::implicitly_convertible<Member, MemberID>();
return m.ptr();
}
}
......@@ -4,13 +4,12 @@
namespace pyeris {
PYBIND11_PLUGIN(learning) {
py::module m("eris.learning", "eris interface for Python -- agent learning classes");
PYBIND11_MODULE(learning, m) {
m.attr("__name__") = "eris.learning";
m.doc() = "eris interface for Python -- agent learning classes";
learning::bind_BL(m);
learning::bind_BLR(m);
return m.ptr();
}
}
......@@ -7,14 +7,13 @@
namespace pyeris {
PYBIND11_PLUGIN(position) {
py::module m("eris.position", "eris interface for Python -- position and positional member code");
PYBIND11_MODULE(position, m) {
m.attr("__name__") = "eris.position";
m.doc() = "eris interface for Python -- position and positional member code";
position::bind_position(m);
position::bind_positional(m);
position::bind_wrapped_positional(m);
return m.ptr();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment