-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aea441b
commit 0efd740
Showing
13 changed files
with
214 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
nodes: | ||
- id: terminal-input | ||
build: pip install -e ../../node-hub/terminal-input | ||
path: dynamic | ||
outputs: | ||
- data | ||
inputs: | ||
echo: dora-echo/echo | ||
|
||
- id: dora-echo | ||
build: pip install -e ../../node-hub/dora-echo | ||
path: dora-echo | ||
inputs: | ||
input: terminal-input/data | ||
outputs: | ||
- echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dora echo node | ||
|
||
This node will just echo whatever it receives as is. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
# Define the path to the README file relative to the package directory | ||
readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.md") | ||
|
||
# Read the content of the README file | ||
try: | ||
with open(readme_path, "r", encoding="utf-8") as f: | ||
__doc__ = f.read() | ||
except FileNotFoundError: | ||
__doc__ = "README file not found." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import argparse | ||
import os | ||
from dora import Node | ||
|
||
RUNNER_CI = True if os.getenv("CI") == "true" else False | ||
|
||
|
||
def main(): | ||
|
||
# Handle dynamic nodes, ask for the name of the node in the dataflow, and the same values as the ENV variables. | ||
parser = argparse.ArgumentParser(description="Simple arrow sender") | ||
|
||
parser.add_argument( | ||
"--name", | ||
type=str, | ||
required=False, | ||
help="The name of the node in the dataflow.", | ||
default="echo", | ||
) | ||
args = parser.parse_args() | ||
|
||
node = Node( | ||
args.name | ||
) # provide the name to connect to the dataflow if dynamic node | ||
|
||
for event in node: | ||
if event["type"] == "INPUT": | ||
node.send_output("echo", event["value"]) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tool.poetry] | ||
name = "dora-echo" | ||
version = "0.3.5" | ||
authors = [ | ||
"Haixuan Xavier Tao <[email protected]>", | ||
"Enzo Le Van <[email protected]>", | ||
] | ||
description = "Dora echo" | ||
license = "MIT License" | ||
homepage = "https://github.com/dora-rs/dora.git" | ||
documentation = "https://github.com/dora-rs/dora/blob/main/node-hub/dora-echo/README.md" | ||
readme = "README.md" | ||
packages = [{ include = "dora_echo" }] | ||
|
||
[tool.poetry.dependencies] | ||
dora-rs = "0.3.5" | ||
numpy = "< 2.0.0" | ||
pyarrow = ">= 5.0.0" | ||
|
||
[tool.poetry.scripts] | ||
dora-echo = "dora_echo.main:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.8.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[project] | ||
readme = "README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dora Node for sending terminal input data. | ||
|
||
This node send the data that is given to him within a terminal window. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tool.poetry] | ||
name = "terminal-input" | ||
version = "0.3.5" | ||
authors = [ | ||
"Haixuan Xavier Tao <[email protected]>", | ||
"Enzo Le Van <[email protected]>", | ||
] | ||
description = "Dora terminal input" | ||
license = "MIT License" | ||
homepage = "https://github.com/dora-rs/dora.git" | ||
documentation = "https://github.com/dora-rs/dora/blob/main/node-hub/terminal-input/README.md" | ||
readme = "README.md" | ||
packages = [{ include = "terminal_input" }] | ||
|
||
[tool.poetry.dependencies] | ||
dora-rs = "0.3.5" | ||
numpy = "< 2.0.0" | ||
pyarrow = ">= 5.0.0" | ||
|
||
[tool.poetry.scripts] | ||
terminal-input = "terminal_input.main:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.8.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[project] | ||
readme = "README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
# Define the path to the README file relative to the package directory | ||
readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.md") | ||
|
||
# Read the content of the README file | ||
try: | ||
with open(readme_path, "r", encoding="utf-8") as f: | ||
__doc__ = f.read() | ||
except FileNotFoundError: | ||
__doc__ = "README file not found." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import argparse | ||
import os | ||
import ast | ||
|
||
import pyarrow as pa | ||
|
||
from dora import Node | ||
|
||
RUNNER_CI = True if os.getenv("CI") == "true" else False | ||
|
||
|
||
def main(): | ||
|
||
# Handle dynamic nodes, ask for the name of the node in the dataflow, and the same values as the ENV variables. | ||
parser = argparse.ArgumentParser(description="Simple arrow sender") | ||
|
||
parser.add_argument( | ||
"--name", | ||
type=str, | ||
required=False, | ||
help="The name of the node in the dataflow.", | ||
default="terminal-input", | ||
) | ||
parser.add_argument( | ||
"--data", | ||
type=str, | ||
required=False, | ||
help="Arrow Data as string.", | ||
default=None, | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
data = os.getenv("DATA", args.data) | ||
|
||
node = Node( | ||
args.name | ||
) # provide the name to connect to the dataflow if dynamic node | ||
|
||
if data is None and os.getenv("DORA_NODE_CONFIG") is None: | ||
while True: | ||
data = input( | ||
"Provide the data you want to send: ", | ||
) | ||
data = ast.literal_eval(data) | ||
if isinstance(data, list): | ||
data = pa.array(data) # initialize pyarrow array | ||
elif isinstance(data, str): | ||
data = pa.array([data]) | ||
elif isinstance(data, int): | ||
data = pa.array([data]) | ||
elif isinstance(data, float): | ||
data = pa.array([data]) | ||
elif isinstance(data, dict): | ||
data = pa.array([data]) | ||
else: | ||
data = pa.array(data) # initialize pyarrow array | ||
node.send_output("data", data) | ||
event = node.next(timeout=0.2) | ||
if event is not None: | ||
print(f"Received: {event['value'].to_pylist()}") | ||
else: | ||
data = ast.literal_eval(data) | ||
if isinstance(data, list): | ||
data = pa.array(data) # initialize pyarrow array | ||
elif isinstance(data, str): | ||
data = pa.array([data]) | ||
else: | ||
data = pa.array(data) # initialize pyarrow array | ||
node.send_output("data", data) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def test_placeholder(): | ||
pass |