Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: update api for python module, drop python2 #777

Merged
merged 13 commits into from
Nov 11, 2022
Prev Previous commit
Next Next commit
python_module: overload function for add_atom(label, list)
  • Loading branch information
simonpintarelli committed Nov 11, 2022
commit 14a96bd5db462e656f91621876d6eecf2b4b204d
2 changes: 1 addition & 1 deletion python_module/py_sirius.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ PYBIND11_MODULE(py_sirius, m)

py::class_<Unit_cell>(m, "Unit_cell")
.def("add_atom_type", &Unit_cell::add_atom_type, py::return_value_policy::reference)
.def("add_atom", [](Unit_cell& obj, std::string& label, std::array<double, 3>& v) { obj.add_atom(label, v); })
.def("add_atom", py::overload_cast<const std::string, vector3d<double>>(&Unit_cell::add_atom))
.def("atom", py::overload_cast<int>(&Unit_cell::atom), py::return_value_policy::reference)
.def("atom_type", py::overload_cast<int>(&Unit_cell::atom_type), py::return_value_policy::reference)
Expand Down Expand Up @@ -826,4 +827,3 @@ PYBIND11_MODULE(py_sirius, m)
}
/* sirius.smearing submodules (end) */
}