We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d41e7eb commit cc7144fCopy full SHA for cc7144f
pybind11/pymoose.cpp
@@ -133,9 +133,12 @@ PYBIND11_MODULE(_cmoose, m)
133
.def("setField", &setProp<double>)
134
135
.def("setField", &setProp<vector<double>>)
136
- .def("setField", &setProp<string>)
+ .def("setField", &setProp<std::string>)
137
.def("setField", &setProp<bool>)
138
+
139
// Overload for Field::get
140
+ // NOTE: Get it tricky to get right.
141
+ // See discussion here: https://github.com/pybind/pybind11/issues/1667
142
.def("getField", &getProp<double>)
143
.def("getField", &getProp<string>)
144
.def("getField", &getProp<unsigned int>)
tests/pybind11/test_shell3.py
@@ -21,7 +21,7 @@ def makereac():
21
pools[6] = tot1 = moose.BufPool(k.path+"/tot1")
22
23
sum = moose.Function(tot1.path + "/func")
24
- # sumInput = M._Id(sum.value + 1);
+ sum.cobj.setField("expr", "x0+x1")
25
26
e1Pool = moose.Pool(k.path + "/e1Pool")
27
e2Pool = moose.Pool(k.path + "/e2Pool")
@@ -38,11 +38,10 @@ def makereac():
38
r1.connect("sub", A, "reac")
39
r1.connect("prd", B, "reac")
40
41
- # Field<unsigned int>::set(sum, "numVars", 2);
42
- sum.setField("numVars", 2)
+ sum.cobj.setField("numVars", 2)
43
44
- A.connect("nOut", M._ObjId(sumInput, 0, 0), "input")
45
- B.connect("nOut", M._ObjId(sumInput, 0, 1), "input")
+ A.connect("nOut", sum.cobj.x[0], "input")
+ B.connect("nOut", sum.cobj.x[1], "input")
46
sum.connect("valueOut", tot1, "setN");
47
48
r2.connect("sub", B, "reac")
0 commit comments