From e77a13c6266758ad234c058c4257234692719ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 1 Aug 2023 15:10:41 +0200 Subject: [PATCH] Fix Python bindings without adding new functionality yet Overload resolution --- src/binding/python/Series.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/binding/python/Series.cpp b/src/binding/python/Series.cpp index 207b09bfd2..fc2a367925 100644 --- a/src/binding/python/Series.cpp +++ b/src/binding/python/Series.cpp @@ -19,6 +19,7 @@ * If not, see . */ +#include #include #include @@ -283,9 +284,23 @@ this method. &Series::setOpenPMDextension) .def_property("base_path", &Series::basePath, &Series::setBasePath) .def_property( - "meshes_path", &Series::meshesPath, &Series::setMeshesPath) + "meshes_path", + &Series::meshesPath, + py::overload_cast(&Series::setMeshesPath)) .def_property( - "particles_path", &Series::particlesPath, &Series::setParticlesPath) + "particles_path", + &Series::particlesPath, + py::overload_cast(&Series::setParticlesPath)) + .def_property( + "meshes_paths", + &Series::meshesPath, + py::overload_cast const &>( + &Series::setMeshesPath)) + .def_property( + "particles_paths", + &Series::particlesPath, + py::overload_cast const &>( + &Series::setParticlesPath)) .def_property("author", &Series::author, &Series::setAuthor) .def_property( "machine", @@ -327,8 +342,20 @@ this method. .def("set_openPMD", &Series::setOpenPMD) .def("set_openPMD_extension", &Series::setOpenPMDextension) .def("set_base_path", &Series::setBasePath) - .def("set_meshes_path", &Series::setMeshesPath) - .def("set_particles_path", &Series::setParticlesPath) + .def( + "set_meshes_path", + py::overload_cast(&Series::setMeshesPath)) + .def( + "set_meshes_path", + py::overload_cast const &>( + &Series::setMeshesPath)) + .def( + "set_particles_path", + py::overload_cast const &>( + &Series::setParticlesPath)) + .def( + "set_particles_path", + py::overload_cast(&Series::setParticlesPath)) .def("set_author", &Series::setAuthor) .def("set_date", &Series::setDate) .def("set_iteration_encoding", &Series::setIterationEncoding)