[WAYANG-#8] WyOperator change name to PywyWayang
Signed-off-by: bertty <bertty@apache.org>
diff --git a/python/src/pywy/dataquanta.py b/python/src/pywy/dataquanta.py
index 2854b6b..b38ac15 100644
--- a/python/src/pywy/dataquanta.py
+++ b/python/src/pywy/dataquanta.py
@@ -42,10 +42,10 @@
"""
Represents an intermediate result/data flow edge in a [[WayangPlan]].
"""
- previous : WyOperator = None
+ previous : PywyOperator = None
context: WayangContext
- def __init__(self, context:WayangContext, operator: WyOperator):
+ def __init__(self, context:WayangContext, operator: PywyOperator):
self.operator = operator
self.context = context
@@ -66,7 +66,7 @@
trs.translate()
# TODO add the logic to execute the plan
- def __connect(self, op:WyOperator, port_op: int = 0) -> WyOperator:
+ def __connect(self, op:PywyOperator, port_op: int = 0) -> PywyOperator:
self.operator.connect(0, op, port_op)
return op
diff --git a/python/src/pywy/graph/graphtypes.py b/python/src/pywy/graph/graphtypes.py
index fdd1280..26664ed 100644
--- a/python/src/pywy/graph/graphtypes.py
+++ b/python/src/pywy/graph/graphtypes.py
@@ -1,43 +1,43 @@
from typing import ( Iterable, List )
from pywy.graph.graph import ( GraphNode, WayangGraph )
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
-class NodeOperator(GraphNode[WyOperator]):
+class NodeOperator(GraphNode[PywyOperator]):
- def __init__(self, op: WyOperator):
+ def __init__(self, op: PywyOperator):
super(NodeOperator, self).__init__(op)
- def getadjacents(self) -> Iterable[WyOperator]:
- operator: WyOperator = self.current
+ def getadjacents(self) -> Iterable[PywyOperator]:
+ operator: PywyOperator = self.current
if operator is None or operator.inputs == 0:
return []
return operator.inputOperator
- def build_node(self, t:WyOperator) -> 'NodeOperator':
+ def build_node(self, t:PywyOperator) -> 'NodeOperator':
return NodeOperator(t)
class WGraphOfOperator(WayangGraph[NodeOperator]):
- def __init__(self, nodes: List[WyOperator]):
+ def __init__(self, nodes: List[PywyOperator]):
super(WGraphOfOperator, self).__init__(nodes)
- def build_node(self, t:WyOperator) -> NodeOperator:
+ def build_node(self, t:PywyOperator) -> NodeOperator:
return NodeOperator(t)
-class NodeVec(GraphNode[List[WyOperator]]):
+class NodeVec(GraphNode[List[PywyOperator]]):
- def __init__(self, op: WyOperator):
+ def __init__(self, op: PywyOperator):
super(NodeVec, self).__init__([op, None])
- def getadjacents(self) -> Iterable[List[WyOperator]]:
- operator: WyOperator = self.current[0]
+ def getadjacents(self) -> Iterable[List[PywyOperator]]:
+ operator: PywyOperator = self.current[0]
if operator is None or operator.inputs == 0:
return []
return operator.inputOperator
- def build_node(self, t:WyOperator) -> 'NodeVec':
+ def build_node(self, t:PywyOperator) -> 'NodeVec':
return NodeVec(t)
def __str__(self):
@@ -48,8 +48,8 @@
class WGraphOfVec(WayangGraph[NodeVec]):
- def __init__(self, nodes: List[WyOperator]):
+ def __init__(self, nodes: List[PywyOperator]):
super(WGraphOfVec, self).__init__(nodes)
- def build_node(self, t:WyOperator) -> NodeVec:
+ def build_node(self, t:PywyOperator) -> NodeVec:
return NodeVec(t)
\ No newline at end of file
diff --git a/python/src/pywy/platforms/basic/mapping.py b/python/src/pywy/platforms/basic/mapping.py
index e8f14a2..9749ebd 100644
--- a/python/src/pywy/platforms/basic/mapping.py
+++ b/python/src/pywy/platforms/basic/mapping.py
@@ -1,5 +1,5 @@
from typing import Dict
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
class Mapping:
mappings: Dict[str, type]
@@ -7,10 +7,10 @@
def __init__(self):
self.mappings = {}
- def add_mapping(self, operator: WyOperator):
+ def add_mapping(self, operator: PywyOperator):
self.mappings[operator.name_basic()] = type(operator)
- def get_instanceof(self, operator: WyOperator):
+ def get_instanceof(self, operator: PywyOperator):
template = self.mappings[operator.name_basic()]
if template is None:
raise Exception(
diff --git a/python/src/pywy/platforms/python/operators/PythonExecutionOperator.py b/python/src/pywy/platforms/python/operators/PythonExecutionOperator.py
index 52a8294..2db44f0 100644
--- a/python/src/pywy/platforms/python/operators/PythonExecutionOperator.py
+++ b/python/src/pywy/platforms/python/operators/PythonExecutionOperator.py
@@ -1,7 +1,7 @@
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
from pywy.platforms.python.channels import Channel
-class PythonExecutionOperator(WyOperator):
+class PythonExecutionOperator(PywyOperator):
def prefix(self) -> str:
return 'Py'
diff --git a/python/src/pywy/wayangplan/__init__.py b/python/src/pywy/wayangplan/__init__.py
index 265e2d2..b0c87a1 100644
--- a/python/src/pywy/wayangplan/__init__.py
+++ b/python/src/pywy/wayangplan/__init__.py
@@ -1,10 +1,10 @@
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
from pywy.wayangplan.sink import TextFileSink
from pywy.wayangplan.source import TextFileSource
from pywy.wayangplan.unary import FilterOperator, MapOperator, FlatmapOperator
#
__ALL__= [
- WyOperator,
+ PywyOperator,
TextFileSink,
TextFileSource,
FilterOperator,
diff --git a/python/src/pywy/wayangplan/base.py b/python/src/pywy/wayangplan/base.py
index 1eedf1b..1a81052 100644
--- a/python/src/pywy/wayangplan/base.py
+++ b/python/src/pywy/wayangplan/base.py
@@ -1,15 +1,15 @@
from typing import ( TypeVar, Optional, List, Set )
from pywy.platforms.basic.channel import ChannelDescriptor
-class WyOperator:
+class PywyOperator:
inputSlot : List[TypeVar]
inputChannel : ChannelDescriptor
- inputOperator: List['WyOperator']
+ inputOperator: List['PywyOperator']
inputs : int
outputSlot : List[TypeVar]
outputChannel: ChannelDescriptor
- outputOperator: List['WyOperator']
+ outputOperator: List['PywyOperator']
outputs: int
def __init__(self,
@@ -47,7 +47,7 @@
self.validate_inputs(input)
self.validate_outputs(output)
- def connect(self, port:int, that: 'WyOperator', port_that:int):
+ def connect(self, port:int, that: 'PywyOperator', port_that:int):
self.outputOperator[port] = that
that.inputOperator[port_that] = self
diff --git a/python/src/pywy/wayangplan/sink.py b/python/src/pywy/wayangplan/sink.py
index 2d83209..3cd26ad 100644
--- a/python/src/pywy/wayangplan/sink.py
+++ b/python/src/pywy/wayangplan/sink.py
@@ -1,9 +1,9 @@
from typing import Any
from pywy.types import GenericTco
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
-class SinkOperator(WyOperator):
+class SinkOperator(PywyOperator):
def postfix(self) -> str:
return 'Sink'
diff --git a/python/src/pywy/wayangplan/source.py b/python/src/pywy/wayangplan/source.py
index 202a465..1439c10 100644
--- a/python/src/pywy/wayangplan/source.py
+++ b/python/src/pywy/wayangplan/source.py
@@ -1,6 +1,6 @@
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
-class SourceUnaryOperator(WyOperator):
+class SourceUnaryOperator(PywyOperator):
def __init__(self, name:str):
super(SourceUnaryOperator, self).__init__(
diff --git a/python/src/pywy/wayangplan/unary.py b/python/src/pywy/wayangplan/unary.py
index aa1d957..725159e 100644
--- a/python/src/pywy/wayangplan/unary.py
+++ b/python/src/pywy/wayangplan/unary.py
@@ -1,5 +1,5 @@
from itertools import chain
-from pywy.wayangplan.base import WyOperator
+from pywy.wayangplan.base import PywyOperator
from pywy.types import (
GenericTco,
GenericUco,
@@ -13,7 +13,7 @@
-class UnaryToUnaryOperator(WyOperator):
+class UnaryToUnaryOperator(PywyOperator):
def __init__(self, name:str, input:GenericTco, output:GenericUco):
super().__init__(name, input, output, 1, 1)