MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / tutorial_simple

Function tutorial_simple

python/tutorial/T01-Simple.py:15–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def tutorial_simple():
16 pipeline = GPipeline()
17 a, b, c, d = MyNode1(), MyNode2(), MyNode1(), MyNode2()
18
19 pipeline.registerGElement(a, set(), "nodeA")
20 pipeline.registerGElement(b, {a}, "nodeB")
21 pipeline.registerGElement(c, {a}, "nodeC")
22 pipeline.registerGElement(d, {b, c}, "nodeD")
23
24 status: CStatus = pipeline.init()
25 if status.isErr():
26 # please check api return status
27 # ret_code == 0 is ok, default
28 # ret_code < 0 means error, ex: return CStatus(-1, "my error info")
29 print('pipeline init failed, error code is {0}, error info is {1}'.format(
30 status.getCode(), status.getInfo()))
31 return
32
33 for i in range(0, 3):
34 status = pipeline.run()
35 print("==== tutorial_simple, loop: {0}, and run status = {1}".format(i + 1, status.getCode()))
36
37 pipeline.destroy()
38
39
40if __name__ == '__main__':

Callers 1

T01-Simple.pyFile · 0.70

Calls 8

initMethod · 0.95
runMethod · 0.95
destroyMethod · 0.95
MyNode1Class · 0.90
MyNode2Class · 0.90
GPipelineClass · 0.85
isErrMethod · 0.80
getCodeMethod · 0.80

Tested by

no test coverage detected