diff --git a/binaries/coordinator/examples/graphs/python_test.yml b/binaries/coordinator/examples/graphs/python_test.yml deleted file mode 100644 index 66044ba7..00000000 --- a/binaries/coordinator/examples/graphs/python_test.yml +++ /dev/null @@ -1,29 +0,0 @@ -communication: - zenoh: - prefix: /foo - -nodes: - - id: static-string - custom: - run: python examples/nodes/python/static_string.py - outputs: - - string - - - id: python-printer - custom: - run: python examples/nodes/python/printer.py - inputs: - string: static-string/string - time2: rust-timer/time - - - id: rust-timer - custom: - run: cargo run --example source_timer - outputs: - - time - - - id: rust-logger - custom: - run: cargo run --example sink_logger - inputs: - time: static-string/string \ No newline at end of file diff --git a/binaries/coordinator/examples/nodes/python/printer.py b/binaries/coordinator/examples/nodes/python/printer.py deleted file mode 100644 index 45943ed0..00000000 --- a/binaries/coordinator/examples/nodes/python/printer.py +++ /dev/null @@ -1,8 +0,0 @@ -from dora import Node - -node = Node() - -for id, value in node: - print(f"From Python, id: {id}, value: {value}") if value is not [] else None - -print("printer finished") diff --git a/binaries/coordinator/examples/nodes/python/static_string.py b/binaries/coordinator/examples/nodes/python/static_string.py deleted file mode 100644 index 8b158fd0..00000000 --- a/binaries/coordinator/examples/nodes/python/static_string.py +++ /dev/null @@ -1,11 +0,0 @@ -import time - -from dora import Node - -node = Node() - -for i in range(100): - node.send_output("string", b"Hello World") - time.sleep(0.1) - -print("static string finished") diff --git a/examples/python-operator/op.py b/examples/python-operator/op.py deleted file mode 100644 index bffe8508..00000000 --- a/examples/python-operator/op.py +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Callable -from enum import Enum - -class DoraStatus(Enum): - CONTINUE = 0 - STOP = 1 - -class Operator: - """ - Example operator incrementing a counter every times its been called. - - The current value of the counter is sent back to dora on `counter`. - """ - - def __init__(self, counter=0): - self.counter = counter - - def on_input( - self, - input_id: str, - value: bytes, - send_output: Callable[[str, bytes], None], - ): - """Handle input by incrementing count by one. - - Args: - input_id (str): Id of the input declared in the yaml configuration - value (bytes): Bytes message of the input - send_output (Callable[[str, bytes]]): Function enabling sending output back to dora. - """ - val_len = len(value) - print(f"PYTHON received input {input_id}; value length: {val_len}") - send_output("counter", (self.counter % 256).to_bytes(1, "little")) - self.counter = self.counter + 1 - - return DoraStatus.OK diff --git a/examples/python-operator/op2.py b/examples/python-operator/op2.py deleted file mode 100644 index 0053b1a4..00000000 --- a/examples/python-operator/op2.py +++ /dev/null @@ -1,39 +0,0 @@ -from typing import Callable -from enum import Enum - -class DoraStatus(Enum): - OK = 0 - STOP = 1 - -class Operator: - """ - Example operator incrementing a counter every times its been called. - - The current value of the counter is sent back to dora on `counter`. - """ - - def __init__(self, counter=0): - self.counter = counter - - def on_input( - self, - input_id: str, - value: bytes, - send_output: Callable[[str, bytes], None], - ): - """Handle input by incrementing count by one. - - Args: - input_id (str): Id of the input declared in the yaml configuration - value (bytes): Bytes message of the input - send_output (Callable[[str, bytes]]): Function enabling sending output back to dora. - """ - val_len = len(value) - print(f"PYTHON received input {input_id}; value length: {val_len}") - send_output("counter", (self.counter % 256).to_bytes(1, "little")) - self.counter = self.counter + 1 - - if self.counter > 500: - return DoraStatus.STOP - else: - return DoraStatus.OK