You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wayang.apache.org by be...@apache.org on 2022/04/08 17:16:31 UTC
[incubator-wayang] 10/32: [WAYANG-#8] Change name in graphtypes.py
This is an automated email from the ASF dual-hosted git repository.
bertty pushed a commit to branch python-platform
in repository https://gitbox.apache.org/repos/asf/incubator-wayang.git
commit 1dbbaaacb2a4cf1adc6dcbce7b925dc39b4f631a
Author: Bertty Contreras-Rojas <be...@databloom.ai>
AuthorDate: Wed Apr 6 16:42:04 2022 +0200
[WAYANG-#8] Change name in graphtypes.py
Signed-off-by: bertty <be...@apache.org>
---
python/src/pywy/graph/graphtypes.py | 18 +++++++++---------
python/src/pywy/wayangplan/wayang.py | 6 +++---
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/python/src/pywy/graph/graphtypes.py b/python/src/pywy/graph/graphtypes.py
index d31b4cde..aa748e3c 100644
--- a/python/src/pywy/graph/graphtypes.py
+++ b/python/src/pywy/graph/graphtypes.py
@@ -1,12 +1,12 @@
-from typing import Iterable, List
+from typing import Iterable, List, Tuple
from pywy.graph.graph import GraphNode, WayangGraph
from pywy.wayangplan.base import WyOperator
-class WayangNode(GraphNode[WyOperator]):
+class NodeOperator(GraphNode[WyOperator]):
def __init__(self, op: WyOperator):
- super(WayangNode, self).__init__(op)
+ super(NodeOperator, self).__init__(op)
def getadjacents(self) -> Iterable[WyOperator]:
operator: WyOperator = self.current
@@ -14,13 +14,13 @@ class WayangNode(GraphNode[WyOperator]):
return []
return operator.inputOperator
- def build_node(self, t:WyOperator) -> 'WayangNode':
- return WayangNode(t)
+ def build_node(self, t:WyOperator) -> 'NodeOperator':
+ return NodeOperator(t)
-class WayangGraphOfWayangNode(WayangGraph[WayangNode]):
+class WGraphOfOperator(WayangGraph[NodeOperator]):
def __init__(self, nodes: List[WyOperator]):
- super(WayangGraphOfWayangNode, self).__init__(nodes)
+ super(WGraphOfOperator, self).__init__(nodes)
- def build_node(self, t:WyOperator) -> WayangNode:
- return WayangNode(t)
+ def build_node(self, t:WyOperator) -> NodeOperator:
+ return NodeOperator(t)
\ No newline at end of file
diff --git a/python/src/pywy/wayangplan/wayang.py b/python/src/pywy/wayangplan/wayang.py
index eacad67c..1ba41ba6 100644
--- a/python/src/pywy/wayangplan/wayang.py
+++ b/python/src/pywy/wayangplan/wayang.py
@@ -1,7 +1,7 @@
from typing import Iterable, Set
from pywy.graph.graph import WayangGraph
-from pywy.graph.graphtypes import WayangGraphOfWayangNode, WayangNode
+from pywy.graph.graphtypes import WGraphOfOperator, NodeOperator
from pywy.wayangplan.sink import SinkOperator
from pywy.platforms.basic.plugin import Plugin
@@ -16,10 +16,10 @@ class PywyPlan:
self.set_graph()
def set_graph(self):
- self.graph = WayangGraphOfWayangNode(self.sinks)
+ self.graph = WGraphOfOperator(self.sinks)
def print(self):
- def print_plan(current: WayangNode, previous: WayangNode):
+ def print_plan(current: NodeOperator, previous: NodeOperator):
if current is None:
print("this is source")
print(previous.current)