Skip to content

Commit e77a13c

Browse files
committed
Fix Python bindings without adding new functionality yet
Overload resolution
1 parent 602ed08 commit e77a13c

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

src/binding/python/Series.cpp

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121

22+
#include <pybind11/detail/common.h>
2223
#include <pybind11/pybind11.h>
2324
#include <pybind11/stl.h>
2425

@@ -283,9 +284,23 @@ this method.
283284
&Series::setOpenPMDextension)
284285
.def_property("base_path", &Series::basePath, &Series::setBasePath)
285286
.def_property(
286-
"meshes_path", &Series::meshesPath, &Series::setMeshesPath)
287+
"meshes_path",
288+
&Series::meshesPath,
289+
py::overload_cast<std::string const &>(&Series::setMeshesPath))
287290
.def_property(
288-
"particles_path", &Series::particlesPath, &Series::setParticlesPath)
291+
"particles_path",
292+
&Series::particlesPath,
293+
py::overload_cast<std::string const &>(&Series::setParticlesPath))
294+
.def_property(
295+
"meshes_paths",
296+
&Series::meshesPath,
297+
py::overload_cast<std::vector<std::string> const &>(
298+
&Series::setMeshesPath))
299+
.def_property(
300+
"particles_paths",
301+
&Series::particlesPath,
302+
py::overload_cast<std::vector<std::string> const &>(
303+
&Series::setParticlesPath))
289304
.def_property("author", &Series::author, &Series::setAuthor)
290305
.def_property(
291306
"machine",
@@ -327,8 +342,20 @@ this method.
327342
.def("set_openPMD", &Series::setOpenPMD)
328343
.def("set_openPMD_extension", &Series::setOpenPMDextension)
329344
.def("set_base_path", &Series::setBasePath)
330-
.def("set_meshes_path", &Series::setMeshesPath)
331-
.def("set_particles_path", &Series::setParticlesPath)
345+
.def(
346+
"set_meshes_path",
347+
py::overload_cast<std::string const &>(&Series::setMeshesPath))
348+
.def(
349+
"set_meshes_path",
350+
py::overload_cast<std::vector<std::string> const &>(
351+
&Series::setMeshesPath))
352+
.def(
353+
"set_particles_path",
354+
py::overload_cast<std::vector<std::string> const &>(
355+
&Series::setParticlesPath))
356+
.def(
357+
"set_particles_path",
358+
py::overload_cast<std::string const &>(&Series::setParticlesPath))
332359
.def("set_author", &Series::setAuthor)
333360
.def("set_date", &Series::setDate)
334361
.def("set_iteration_encoding", &Series::setIterationEncoding)

0 commit comments

Comments
 (0)