Skip to content

Commit cc7144f

Browse files
author
Dilawar Singh
committed
Move to gulgula.
1 parent d41e7eb commit cc7144f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pybind11/pymoose.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ PYBIND11_MODULE(_cmoose, m)
133133
.def("setField", &setProp<double>)
134134
.def("setField", &setProp<double>)
135135
.def("setField", &setProp<vector<double>>)
136-
.def("setField", &setProp<string>)
136+
.def("setField", &setProp<std::string>)
137137
.def("setField", &setProp<bool>)
138+
138139
// Overload for Field::get
140+
// NOTE: Get it tricky to get right.
141+
// See discussion here: https://github.com/pybind/pybind11/issues/1667
139142
.def("getField", &getProp<double>)
140143
.def("getField", &getProp<string>)
141144
.def("getField", &getProp<unsigned int>)

tests/pybind11/test_shell3.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def makereac():
2121
pools[6] = tot1 = moose.BufPool(k.path+"/tot1")
2222

2323
sum = moose.Function(tot1.path + "/func")
24-
# sumInput = M._Id(sum.value + 1);
24+
sum.cobj.setField("expr", "x0+x1")
2525

2626
e1Pool = moose.Pool(k.path + "/e1Pool")
2727
e2Pool = moose.Pool(k.path + "/e2Pool")
@@ -38,11 +38,10 @@ def makereac():
3838
r1.connect("sub", A, "reac")
3939
r1.connect("prd", B, "reac")
4040

41-
# Field<unsigned int>::set(sum, "numVars", 2);
42-
sum.setField("numVars", 2)
41+
sum.cobj.setField("numVars", 2)
4342

44-
A.connect("nOut", M._ObjId(sumInput, 0, 0), "input")
45-
B.connect("nOut", M._ObjId(sumInput, 0, 1), "input")
43+
A.connect("nOut", sum.cobj.x[0], "input")
44+
B.connect("nOut", sum.cobj.x[1], "input")
4645
sum.connect("valueOut", tot1, "setN");
4746

4847
r2.connect("sub", B, "reac")

0 commit comments

Comments
 (0)