forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT26-Mutable.py
More file actions
30 lines (22 loc) · 749 Bytes
/
T26-Mutable.py
File metadata and controls
30 lines (22 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: T26-GMutable
@Time: 2025/4/9 00:04
@Desc:
"""
from PyCGraph import GPipeline
from MyGNode.MyNode1 import MyNode1
from MyGNode.MyWriteParamNode import MyWriteParamNode
from MyGMutable.MyMutable import MyMutable
def tutorial_mutable():
pipeline = GPipeline()
a, c, d = MyNode1(), MyNode1(), MyWriteParamNode()
b_mutable = MyMutable([MyNode1('nodeB1'), MyNode1('nodeB2'), MyNode1('nodeB3')])
pipeline.registerGElement(a, set(), "nodeA")
pipeline.registerGElement(b_mutable, {a}, "nodeB")
pipeline.registerGElement(c, {a}, "nodeC")
pipeline.registerGElement(d, {b_mutable, c}, "nodeD")
pipeline.process(6)
if __name__ == '__main__':
tutorial_mutable()