|
37 | 37 | #include "../shell/Shell.h" |
38 | 38 | #include "../shell/Wildcard.h" |
39 | 39 | #include "../utility/strutil.h" |
| 40 | + |
| 41 | +#include "../basecode/global.h" |
| 42 | + |
40 | 43 | #include "helper.h" |
41 | 44 | #include "pymoose.h" |
42 | 45 |
|
43 | 46 | using namespace std; |
44 | 47 | namespace py = pybind11; |
| 48 | +using namespace pybind11::literals; |
45 | 49 |
|
46 | 50 | Id initModule(py::module& m) |
47 | 51 | { |
@@ -343,31 +347,30 @@ PYBIND11_MODULE(_cmoose, m) |
343 | 347 | .def("setClock", &Shell::doSetClock) |
344 | 348 | .def("reinit", &Shell::doReinit) |
345 | 349 | .def("delete", &Shell::doDelete) |
346 | | - .def("start", &Shell::doStart, py::arg("runtime"), |
347 | | - py::arg("notify") = false) |
| 350 | + .def("start", &Shell::doStart, "runtime"_a, "notify"_a = false) |
348 | 351 | .def("quit", &Shell::doQuit); |
349 | 352 |
|
350 | 353 | // Module functions. |
351 | 354 | m.def("getShell", |
352 | 355 | []() { return reinterpret_cast<Shell*>(Id().eref().data()); }, |
353 | 356 | py::return_value_policy::reference); |
354 | 357 |
|
| 358 | + m.def("seed", [](size_t a){ moose::mtseed(a);}); |
| 359 | + m.def("rand", [](double a, double b){ return moose::mtrand(a, b);}, "a"_a=0, "b"_a=1); |
355 | 360 | m.def("wildcardFind", &wildcardFind2); |
356 | 361 | m.def("delete", &mooseDelete); |
357 | 362 | m.def("create", &mooseCreate); |
358 | 363 | m.def("reinit", &mooseReinit); |
359 | | - m.def("start", &mooseStart, py::arg("runtime"), py::arg("notify") = false); |
| 364 | + m.def("start", &mooseStart, "runtime"_a, "notify"_a = false); |
360 | 365 | m.def("element", &mooseElement); |
361 | 366 | m.def("exists", &doesExist); |
362 | 367 | m.def("connect", &mooseConnect); |
363 | 368 | m.def("getCwe", &mooseGetCwe); |
364 | 369 | m.def("setClock", &mooseSetClock); |
365 | 370 | m.def("loadModelInternal", &loadModelInternal); |
366 | | - m.def("getFieldDict", &mooseGetFieldDict, py::arg("className"), |
367 | | - py::arg("finfoType") = ""); |
368 | | - m.def("copy", &mooseCopy, py::arg("orig"), py::arg("newParent"), |
369 | | - py::arg("newName"), py::arg("num") = 1, py::arg("toGlobal") = false, |
370 | | - py::arg("copyExtMsgs") = false); |
| 371 | + m.def("getFieldDict", &mooseGetFieldDict, "className"_a, "finfoType"_a = ""); |
| 372 | + m.def("copy", &mooseCopy, "orig"_a, "newParent"_a, "newName"_a |
| 373 | + , "num"_a = 1, "toGlobal"_a = false, "copyExtMsgs"_a = false); |
371 | 374 | // Attributes. |
372 | 375 | m.attr("NA") = NA; |
373 | 376 | m.attr("PI") = PI; |
|
0 commit comments