From ffc251f1355ede252448183743ecd6d01bec9621 Mon Sep 17 00:00:00 2001 From: Mati-ur-rehman-017 Date: Mon, 17 Mar 2025 04:23:16 +0500 Subject: [PATCH] Applied pyupgrade style --- apis/python/node/dora/__init__.pyi | 2 +- apis/python/node/pyproject.toml | 1 + binaries/cli/pyproject.toml | 1 + .../python/__node-name__/pyproject.toml | 3 +- examples/python-operator-dataflow/webcam.py | 2 +- node-hub/dora-argotranslate/pyproject.toml | 1 + node-hub/dora-distil-whisper/pyproject.toml | 2 +- node-hub/dora-echo/pyproject.toml | 1 + node-hub/dora-internvl/pyproject.toml | 1 + node-hub/dora-ios-lidar/pyproject.toml | 1 + node-hub/dora-keyboard/pyproject.toml | 1 + node-hub/dora-kit-car/pyproject.toml | 1 + node-hub/dora-kokoro-tts/pyproject.toml | 1 + .../dora_llama_cpp_python/__init__.py | 4 ++- .../dora_llama_cpp_python/__main__.py | 2 ++ .../dora_llama_cpp_python/main.py | 3 ++ node-hub/dora-llama-cpp-python/pyproject.toml | 6 ++++ .../tests/test_dora_llama_cpp_python.py | 3 ++ node-hub/dora-magma/pyproject.toml | 1 + node-hub/dora-microphone/pyproject.toml | 1 + node-hub/dora-object-to-pose/pyproject.toml | 1 + node-hub/dora-openai-server/pyproject.toml | 5 +++- node-hub/dora-opus/pyproject.toml | 1 + node-hub/dora-outtetts/pyproject.toml | 1 + node-hub/dora-parler/pyproject.toml | 1 + node-hub/dora-phi4/dora_phi4/__init__.py | 2 ++ node-hub/dora-phi4/dora_phi4/__main__.py | 2 ++ node-hub/dora-phi4/dora_phi4/main.py | 3 ++ node-hub/dora-phi4/pyproject.toml | 6 ++++ node-hub/dora-phi4/tests/test_dora_phi4.py | 3 ++ node-hub/dora-piper/pyproject.toml | 1 + node-hub/dora-pyaudio/pyproject.toml | 1 + node-hub/dora-pyorbbecksdk/pyproject.toml | 2 +- node-hub/dora-pyrealsense/pyproject.toml | 1 + node-hub/dora-qwen/pyproject.toml | 1 + node-hub/dora-qwen2-5-vl/pyproject.toml | 2 +- node-hub/dora-qwenvl/pyproject.toml | 2 +- node-hub/dora-rdt-1b/pyproject.toml | 4 +-- node-hub/dora-reachy1/dora_reachy1/main.py | 5 ++++ .../dora-reachy1/dora_reachy1_vision/main.py | 4 ++- node-hub/dora-reachy1/pyproject.toml | 6 ++++ .../dora-reachy1/tests/test_dora_reachy1.py | 3 ++ .../tests/test_dora_reachy1_vision.py | 3 ++ node-hub/dora-reachy2/pyproject.toml | 2 +- node-hub/dora-rerun/pyproject.toml | 1 + node-hub/dora-sam2/pyproject.toml | 1 + node-hub/dora-ugv/pyproject.toml | 2 +- node-hub/dora-vad/pyproject.toml | 2 +- node-hub/dora-yolo/pyproject.toml | 1 + .../dynamixel_client/__init__.py | 1 + .../dynamixel-client/dynamixel_client/bus.py | 28 ++++++++++++++--- .../dynamixel-client/dynamixel_client/main.py | 17 ++++++++--- node-hub/dynamixel-client/pyproject.toml | 6 ++++ .../tests/test_dynamixel_client.py | 2 ++ .../feetech-client/feetech_client/__init__.py | 1 + node-hub/feetech-client/feetech_client/bus.py | 30 +++++++++++++++---- .../feetech-client/feetech_client/main.py | 15 ++++++---- node-hub/feetech-client/pyproject.toml | 7 ++++- .../tests/test_feetech_client.py | 2 ++ node-hub/lebai-client/lebai_client/main.py | 4 ++- node-hub/lebai-client/pyproject.toml | 6 ++++ node-hub/lebai-client/test/test.py | 2 ++ .../lebai-client/tests/test_lebai_client.py | 2 ++ .../lerobot_dashboard/__init__.py | 1 + .../lerobot_dashboard/main.py | 6 ++-- node-hub/lerobot-dashboard/pyproject.toml | 6 ++++ .../tests/test_lerobot_dashboard.py | 2 ++ .../llama-factory-recorder/pyproject.toml | 2 +- .../mujoco-client/mujoco_client/__init__.py | 1 + node-hub/mujoco-client/mujoco_client/main.py | 14 +++++---- node-hub/mujoco-client/pyproject.toml | 6 ++++ .../mujoco-client/tests/test_mujoco_client.py | 2 ++ node-hub/opencv-plot/pyproject.toml | 2 +- node-hub/opencv-video-capture/pyproject.toml | 1 + node-hub/pyarrow-assert/pyproject.toml | 1 + node-hub/pyarrow-sender/pyproject.toml | 2 +- node-hub/replay-client/pyproject.toml | 6 ++++ .../replay-client/replay_client/__init__.py | 1 + node-hub/replay-client/replay_client/main.py | 11 +++++-- .../replay-client/tests/test_replay_client.py | 2 ++ node-hub/terminal-input/pyproject.toml | 2 +- node-hub/video-encoder/pyproject.toml | 6 ++++ .../video-encoder/tests/test_video_encoder.py | 2 ++ .../video-encoder/video_encoder/__init__.py | 1 + node-hub/video-encoder/video_encoder/main.py | 3 +- 85 files changed, 256 insertions(+), 54 deletions(-) diff --git a/apis/python/node/dora/__init__.pyi b/apis/python/node/dora/__init__.pyi index 88d656c1..abdf5793 100644 --- a/apis/python/node/dora/__init__.pyi +++ b/apis/python/node/dora/__init__.pyi @@ -124,7 +124,7 @@ class Ros2Context: ``` """ - def __init__(self, ros_paths: typing.List[str]=None) -> None: + def __init__(self, ros_paths: list[str]=None) -> None: """ROS2 Context holding all messages definition for receiving and sending messages to ROS2. By default, Ros2Context will use env `AMENT_PREFIX_PATH` to search for message definition. diff --git a/apis/python/node/pyproject.toml b/apis/python/node/pyproject.toml index afe52a64..49e4ba32 100644 --- a/apis/python/node/pyproject.toml +++ b/apis/python/node/pyproject.toml @@ -20,4 +20,5 @@ features = ["pyo3/extension-module"] [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP" ] diff --git a/binaries/cli/pyproject.toml b/binaries/cli/pyproject.toml index bb8bd86e..1ef4af39 100644 --- a/binaries/cli/pyproject.toml +++ b/binaries/cli/pyproject.toml @@ -16,4 +16,5 @@ features = ["python", "pyo3/extension-module"] [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP" ] diff --git a/binaries/cli/src/template/python/__node-name__/pyproject.toml b/binaries/cli/src/template/python/__node-name__/pyproject.toml index ad65125a..6a46a879 100644 --- a/binaries/cli/src/template/python/__node-name__/pyproject.toml +++ b/binaries/cli/src/template/python/__node-name__/pyproject.toml @@ -17,5 +17,6 @@ __node-name__ = "__node_name__.main:main" [tool.ruff.lint] extend-select = [ - "D", + "D", # pydocstyle + "UP" ] diff --git a/examples/python-operator-dataflow/webcam.py b/examples/python-operator-dataflow/webcam.py index db363455..30d72a78 100755 --- a/examples/python-operator-dataflow/webcam.py +++ b/examples/python-operator-dataflow/webcam.py @@ -44,7 +44,7 @@ class Operator: frame = np.zeros((CAMERA_HEIGHT, CAMERA_WIDTH, 3), dtype=np.uint8) cv2.putText( frame, - "No Webcam was found at index %d" % (CAMERA_INDEX), + f"No Webcam was found at index {CAMERA_INDEX}", (30, 30), font, 0.75, diff --git a/node-hub/dora-argotranslate/pyproject.toml b/node-hub/dora-argotranslate/pyproject.toml index 863e2b62..7f16d002 100644 --- a/node-hub/dora-argotranslate/pyproject.toml +++ b/node-hub/dora-argotranslate/pyproject.toml @@ -22,4 +22,5 @@ dora-argotranslate = "dora_argotranslate.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-distil-whisper/pyproject.toml b/node-hub/dora-distil-whisper/pyproject.toml index 7cabce79..adb7c7d7 100644 --- a/node-hub/dora-distil-whisper/pyproject.toml +++ b/node-hub/dora-distil-whisper/pyproject.toml @@ -21,7 +21,6 @@ dependencies = [ "mlx-whisper >= 0.4.1; sys_platform == 'darwin'", ] - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -31,4 +30,5 @@ dora-distil-whisper = "dora_distil_whisper.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-echo/pyproject.toml b/node-hub/dora-echo/pyproject.toml index 42b810c7..468aac3b 100644 --- a/node-hub/dora-echo/pyproject.toml +++ b/node-hub/dora-echo/pyproject.toml @@ -21,4 +21,5 @@ dora-echo = "dora_echo.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP" ] diff --git a/node-hub/dora-internvl/pyproject.toml b/node-hub/dora-internvl/pyproject.toml index 336b6a80..8f212ddb 100644 --- a/node-hub/dora-internvl/pyproject.toml +++ b/node-hub/dora-internvl/pyproject.toml @@ -34,4 +34,5 @@ dora-internvl = "dora_internvl.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-ios-lidar/pyproject.toml b/node-hub/dora-ios-lidar/pyproject.toml index 0534dab7..0542bac1 100644 --- a/node-hub/dora-ios-lidar/pyproject.toml +++ b/node-hub/dora-ios-lidar/pyproject.toml @@ -18,4 +18,5 @@ dora-ios-lidar = "dora_ios_lidar.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-keyboard/pyproject.toml b/node-hub/dora-keyboard/pyproject.toml index b8c941d7..b89810d4 100644 --- a/node-hub/dora-keyboard/pyproject.toml +++ b/node-hub/dora-keyboard/pyproject.toml @@ -27,4 +27,5 @@ dora-keyboard = "dora_keyboard.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-kit-car/pyproject.toml b/node-hub/dora-kit-car/pyproject.toml index 4522f091..22a7d666 100644 --- a/node-hub/dora-kit-car/pyproject.toml +++ b/node-hub/dora-kit-car/pyproject.toml @@ -19,4 +19,5 @@ features = ["python", "pyo3/extension-module"] [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-kokoro-tts/pyproject.toml b/node-hub/dora-kokoro-tts/pyproject.toml index 1ada9672..19b2adc0 100644 --- a/node-hub/dora-kokoro-tts/pyproject.toml +++ b/node-hub/dora-kokoro-tts/pyproject.toml @@ -18,4 +18,5 @@ dora-kokoro-tts = "dora_kokoro_tts.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__init__.py b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__init__.py index ac3cbef9..79cbf370 100644 --- a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__init__.py +++ b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__init__.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + import os # Define the path to the README file relative to the package directory @@ -5,7 +7,7 @@ readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.m # Read the content of the README file try: - with open(readme_path, "r", encoding="utf-8") as f: + with open(readme_path, encoding="utf-8") as f: __doc__ = f.read() except FileNotFoundError: __doc__ = "README file not found." diff --git a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__main__.py b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__main__.py index bcbfde6d..7bc8a1f1 100644 --- a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__main__.py +++ b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/__main__.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + from .main import main diff --git a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/main.py b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/main.py index 05a7bd24..ec9c888d 100644 --- a/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/main.py +++ b/node-hub/dora-llama-cpp-python/dora_llama_cpp_python/main.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + import os import pyarrow as pa from dora import Node @@ -59,6 +61,7 @@ ACTIVATION_WORDS = os.getenv("ACTIVATION_WORDS", "what how who where you").split def main(): + """TODO: Add docstring.""" # Initialize model model = get_model() node = Node() diff --git a/node-hub/dora-llama-cpp-python/pyproject.toml b/node-hub/dora-llama-cpp-python/pyproject.toml index 8b832f72..fd4715a1 100644 --- a/node-hub/dora-llama-cpp-python/pyproject.toml +++ b/node-hub/dora-llama-cpp-python/pyproject.toml @@ -39,3 +39,9 @@ dev = ["pytest >=8.1.1", "ruff >=0.9.1"] [project.scripts] dora-llama-cpp-python = "dora_llama_cpp_python.main:main" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/dora-llama-cpp-python/tests/test_dora_llama_cpp_python.py b/node-hub/dora-llama-cpp-python/tests/test_dora_llama_cpp_python.py index a4b11758..a9b0a9e5 100644 --- a/node-hub/dora-llama-cpp-python/tests/test_dora_llama_cpp_python.py +++ b/node-hub/dora-llama-cpp-python/tests/test_dora_llama_cpp_python.py @@ -1,7 +1,10 @@ +"""TODO: Add docstring.""" + import pytest def test_import_main(): + """TODO: Add docstring.""" from dora_llama_cpp_python.main import main # Check that everything is working, and catch dora Runtime Exception as we're not running in a dora dataflow. diff --git a/node-hub/dora-magma/pyproject.toml b/node-hub/dora-magma/pyproject.toml index e983b127..642ab054 100644 --- a/node-hub/dora-magma/pyproject.toml +++ b/node-hub/dora-magma/pyproject.toml @@ -43,4 +43,5 @@ extend.exclude = "dora_magma/Magma" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-microphone/pyproject.toml b/node-hub/dora-microphone/pyproject.toml index 5210d284..d1c0aaec 100644 --- a/node-hub/dora-microphone/pyproject.toml +++ b/node-hub/dora-microphone/pyproject.toml @@ -27,4 +27,5 @@ dora-microphone = "dora_microphone.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-object-to-pose/pyproject.toml b/node-hub/dora-object-to-pose/pyproject.toml index 77494fc0..1eb059bc 100644 --- a/node-hub/dora-object-to-pose/pyproject.toml +++ b/node-hub/dora-object-to-pose/pyproject.toml @@ -18,4 +18,5 @@ features = ["python", "pyo3/extension-module"] [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-openai-server/pyproject.toml b/node-hub/dora-openai-server/pyproject.toml index 79068f63..0ee85030 100644 --- a/node-hub/dora-openai-server/pyproject.toml +++ b/node-hub/dora-openai-server/pyproject.toml @@ -28,5 +28,8 @@ dev = ["pytest >=8.1.1", "ruff >=0.9.1"] dora-openai-server = "dora_openai_server.main:main" [tool.ruff.lint] -extend-select = ["I","D"] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/dora-opus/pyproject.toml b/node-hub/dora-opus/pyproject.toml index f0fa8505..6e5e8c8f 100644 --- a/node-hub/dora-opus/pyproject.toml +++ b/node-hub/dora-opus/pyproject.toml @@ -31,4 +31,5 @@ dora-opus = "dora_opus.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-outtetts/pyproject.toml b/node-hub/dora-outtetts/pyproject.toml index fbb4e533..faf660a1 100644 --- a/node-hub/dora-outtetts/pyproject.toml +++ b/node-hub/dora-outtetts/pyproject.toml @@ -31,4 +31,5 @@ dora-outtetts = "dora_outtetts.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-parler/pyproject.toml b/node-hub/dora-parler/pyproject.toml index 34cb148f..1ec01e24 100644 --- a/node-hub/dora-parler/pyproject.toml +++ b/node-hub/dora-parler/pyproject.toml @@ -33,4 +33,5 @@ dora-parler = "dora_parler.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-phi4/dora_phi4/__init__.py b/node-hub/dora-phi4/dora_phi4/__init__.py index cde7a377..79cbf370 100644 --- a/node-hub/dora-phi4/dora_phi4/__init__.py +++ b/node-hub/dora-phi4/dora_phi4/__init__.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + import os # Define the path to the README file relative to the package directory diff --git a/node-hub/dora-phi4/dora_phi4/__main__.py b/node-hub/dora-phi4/dora_phi4/__main__.py index 40e2b013..51a1554d 100644 --- a/node-hub/dora-phi4/dora_phi4/__main__.py +++ b/node-hub/dora-phi4/dora_phi4/__main__.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + from .main import main if __name__ == "__main__": diff --git a/node-hub/dora-phi4/dora_phi4/main.py b/node-hub/dora-phi4/dora_phi4/main.py index 5e9944a8..8932a48f 100644 --- a/node-hub/dora-phi4/dora_phi4/main.py +++ b/node-hub/dora-phi4/dora_phi4/main.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + import pyarrow as pa import torch from accelerate import infer_auto_device_map @@ -56,6 +58,7 @@ prompt_suffix = "<|end|>" def main(): + """TODO: Add docstring.""" node = Node() for event in node: diff --git a/node-hub/dora-phi4/pyproject.toml b/node-hub/dora-phi4/pyproject.toml index b1c05cfb..d7cd0ce6 100644 --- a/node-hub/dora-phi4/pyproject.toml +++ b/node-hub/dora-phi4/pyproject.toml @@ -30,3 +30,9 @@ dev = ["pytest >=8.1.1", "ruff >=0.9.1"] [project.scripts] dora-phi4 = "dora_phi4.main:main" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/dora-phi4/tests/test_dora_phi4.py b/node-hub/dora-phi4/tests/test_dora_phi4.py index fc0a3883..ab280144 100644 --- a/node-hub/dora-phi4/tests/test_dora_phi4.py +++ b/node-hub/dora-phi4/tests/test_dora_phi4.py @@ -1,7 +1,10 @@ +"""TODO: Add docstring.""" + import pytest def test_import_main(): + """TODO: Add docstring.""" from dora_phi4.main import main # Check that everything is working, and catch dora Runtime Exception as we're not running in a dora dataflow. diff --git a/node-hub/dora-piper/pyproject.toml b/node-hub/dora-piper/pyproject.toml index f12d589b..c7087b9c 100644 --- a/node-hub/dora-piper/pyproject.toml +++ b/node-hub/dora-piper/pyproject.toml @@ -18,4 +18,5 @@ dora-piper = "dora_piper.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-pyaudio/pyproject.toml b/node-hub/dora-pyaudio/pyproject.toml index 5aee6c44..7d14dd5a 100644 --- a/node-hub/dora-pyaudio/pyproject.toml +++ b/node-hub/dora-pyaudio/pyproject.toml @@ -23,4 +23,5 @@ dora-pyaudio = "dora_pyaudio.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-pyorbbecksdk/pyproject.toml b/node-hub/dora-pyorbbecksdk/pyproject.toml index c9563869..5b909082 100644 --- a/node-hub/dora-pyorbbecksdk/pyproject.toml +++ b/node-hub/dora-pyorbbecksdk/pyproject.toml @@ -12,7 +12,6 @@ requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9", "numpy < 2.0.0", "opencv-python >= 4.1.1"] - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -22,4 +21,5 @@ dora-pyorbbecksdk = "dora_pyorbbecksdk.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-pyrealsense/pyproject.toml b/node-hub/dora-pyrealsense/pyproject.toml index 31f02624..a05c0ad0 100644 --- a/node-hub/dora-pyrealsense/pyproject.toml +++ b/node-hub/dora-pyrealsense/pyproject.toml @@ -24,4 +24,5 @@ dora-pyrealsense = "dora_pyrealsense.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-qwen/pyproject.toml b/node-hub/dora-qwen/pyproject.toml index 7f27c11b..2f775303 100644 --- a/node-hub/dora-qwen/pyproject.toml +++ b/node-hub/dora-qwen/pyproject.toml @@ -45,4 +45,5 @@ dora-qwen = "dora_qwen.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-qwen2-5-vl/pyproject.toml b/node-hub/dora-qwen2-5-vl/pyproject.toml index 00ee58a0..5654661f 100644 --- a/node-hub/dora-qwen2-5-vl/pyproject.toml +++ b/node-hub/dora-qwen2-5-vl/pyproject.toml @@ -35,7 +35,6 @@ dependencies = [ # [tool.uv] # no-build-isolation-package = ['flash-attn'] - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -52,4 +51,5 @@ build-backend = "setuptools.build_meta" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-qwenvl/pyproject.toml b/node-hub/dora-qwenvl/pyproject.toml index 9f774db4..b13b5638 100644 --- a/node-hub/dora-qwenvl/pyproject.toml +++ b/node-hub/dora-qwenvl/pyproject.toml @@ -26,7 +26,6 @@ dependencies = [ # flash_attn = "^2.6.1" # Install using: pip install -U flash-attn --no-build-isolation - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -39,4 +38,5 @@ dora-qwenvl = "dora_qwenvl.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-rdt-1b/pyproject.toml b/node-hub/dora-rdt-1b/pyproject.toml index 127ae5e4..ee5c7258 100644 --- a/node-hub/dora-rdt-1b/pyproject.toml +++ b/node-hub/dora-rdt-1b/pyproject.toml @@ -29,18 +29,15 @@ dependencies = [ # flash_attn = "^2.6.1" # Install using: pip install -U flash-attn --no-build-isolation - [tool.black] extend-exclude = 'dora_rdt_1b/RoboticsDiffusionTransformer' - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] [project.scripts] dora-rdt-1b = "dora_rdt_1b.main:main" - [tool.ruff] exclude = ["dora_rdt_1b/RoboticsDiffusionTransformer"] @@ -51,4 +48,5 @@ build-backend = "poetry.core.masonry.api" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-reachy1/dora_reachy1/main.py b/node-hub/dora-reachy1/dora_reachy1/main.py index e05c37c7..f13129be 100644 --- a/node-hub/dora-reachy1/dora_reachy1/main.py +++ b/node-hub/dora-reachy1/dora_reachy1/main.py @@ -1,3 +1,4 @@ +"""TODO: Add docstring.""" import os import time @@ -8,6 +9,7 @@ from reachy_sdk.trajectory import goto def r_arm_inverse_kinematics(reachy, pose, action) -> list: + """TODO: Add docstring.""" A = np.array( [ [0, 0, -1, pose[0] + action[0]], @@ -20,6 +22,7 @@ def r_arm_inverse_kinematics(reachy, pose, action) -> list: def happy_antennas(reachy): + """TODO: Add docstring.""" reachy.head.l_antenna.speed_limit = 480.0 reachy.head.r_antenna.speed_limit = 480.0 @@ -39,6 +42,7 @@ def happy_antennas(reachy): def sad_antennas(reachy): + """TODO: Add docstring.""" reachy.head.l_antenna.speed_limit = 360.0 reachy.head.r_antenna.speed_limit = 360.0 @@ -47,6 +51,7 @@ def sad_antennas(reachy): def main(): + """TODO: Add docstring.""" node = Node() ROBOT_IP = os.getenv("ROBOT_IP", "10.42.0.24") diff --git a/node-hub/dora-reachy1/dora_reachy1_vision/main.py b/node-hub/dora-reachy1/dora_reachy1_vision/main.py index 52f368f9..1ab20b21 100644 --- a/node-hub/dora-reachy1/dora_reachy1_vision/main.py +++ b/node-hub/dora-reachy1/dora_reachy1_vision/main.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + from reachy_sdk import ReachySDK import os from dora import Node @@ -5,7 +7,7 @@ import pyarrow as pa def main(): - + """TODO: Add docstring.""" node = Node() ROBOT_IP = os.getenv("ROBOT_IP", "10.42.0.24") diff --git a/node-hub/dora-reachy1/pyproject.toml b/node-hub/dora-reachy1/pyproject.toml index 752c4924..e3735417 100644 --- a/node-hub/dora-reachy1/pyproject.toml +++ b/node-hub/dora-reachy1/pyproject.toml @@ -26,3 +26,9 @@ dora-reachy1-vision = "dora_reachy1_vision.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/dora-reachy1/tests/test_dora_reachy1.py b/node-hub/dora-reachy1/tests/test_dora_reachy1.py index 127b8eb4..02a19b80 100644 --- a/node-hub/dora-reachy1/tests/test_dora_reachy1.py +++ b/node-hub/dora-reachy1/tests/test_dora_reachy1.py @@ -1,7 +1,10 @@ +"""TODO: Add docstring.""" + # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/dora-reachy1/tests/test_dora_reachy1_vision.py b/node-hub/dora-reachy1/tests/test_dora_reachy1_vision.py index bcfe9b07..76eedcf1 100644 --- a/node-hub/dora-reachy1/tests/test_dora_reachy1_vision.py +++ b/node-hub/dora-reachy1/tests/test_dora_reachy1_vision.py @@ -1,7 +1,10 @@ +"""TODO: Add docstring.""" + import pytest def test_import_main(): + """TODO: Add docstring.""" from dora_reachy1_vision.main import main # Check that everything is working, and catch dora Runtime Exception as we're not running in a dora dataflow. diff --git a/node-hub/dora-reachy2/pyproject.toml b/node-hub/dora-reachy2/pyproject.toml index d1218e8f..846b8b18 100644 --- a/node-hub/dora-reachy2/pyproject.toml +++ b/node-hub/dora-reachy2/pyproject.toml @@ -24,8 +24,8 @@ dora-reachy2-right-arm = "dora_reachy2.right_arm:main" dora-reachy2-mobile-base = "dora_reachy2.mobile_base:main" dora-reachy2-head = "dora_reachy2.head:main" - [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-rerun/pyproject.toml b/node-hub/dora-rerun/pyproject.toml index 792a59ad..b402d579 100644 --- a/node-hub/dora-rerun/pyproject.toml +++ b/node-hub/dora-rerun/pyproject.toml @@ -22,4 +22,5 @@ features = ["python", "pyo3/extension-module"] [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-sam2/pyproject.toml b/node-hub/dora-sam2/pyproject.toml index c04e7419..82250266 100644 --- a/node-hub/dora-sam2/pyproject.toml +++ b/node-hub/dora-sam2/pyproject.toml @@ -23,4 +23,5 @@ dora-sam2 = "dora_sam2.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-ugv/pyproject.toml b/node-hub/dora-ugv/pyproject.toml index f5374ba9..93e5d0a9 100644 --- a/node-hub/dora-ugv/pyproject.toml +++ b/node-hub/dora-ugv/pyproject.toml @@ -9,7 +9,6 @@ requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9"] - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -19,4 +18,5 @@ dora-ugv = "dora_ugv.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-vad/pyproject.toml b/node-hub/dora-vad/pyproject.toml index 1c16831a..82e7cc5a 100644 --- a/node-hub/dora-vad/pyproject.toml +++ b/node-hub/dora-vad/pyproject.toml @@ -9,7 +9,6 @@ requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9", "numpy < 2.0.0", "silero-vad >= 5.1"] - [dependency-groups] dev = ["pytest >=8.1.1", "ruff >=0.9.1"] @@ -19,4 +18,5 @@ dora-vad = "dora_vad.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dora-yolo/pyproject.toml b/node-hub/dora-yolo/pyproject.toml index 929612d7..a9d64334 100644 --- a/node-hub/dora-yolo/pyproject.toml +++ b/node-hub/dora-yolo/pyproject.toml @@ -21,4 +21,5 @@ dora-yolo = "dora_yolo.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/dynamixel-client/dynamixel_client/__init__.py b/node-hub/dynamixel-client/dynamixel_client/__init__.py index e69de29b..a9cca0f7 100644 --- a/node-hub/dynamixel-client/dynamixel_client/__init__.py +++ b/node-hub/dynamixel-client/dynamixel_client/__init__.py @@ -0,0 +1 @@ +"""TODO: Add docstring.""" diff --git a/node-hub/dynamixel-client/dynamixel_client/bus.py b/node-hub/dynamixel-client/dynamixel_client/bus.py index d123fa67..a1d7f167 100644 --- a/node-hub/dynamixel-client/dynamixel_client/bus.py +++ b/node-hub/dynamixel-client/dynamixel_client/bus.py @@ -1,3 +1,5 @@ +"""TODO: Add docstring.""" + import enum import pyarrow as pa @@ -22,8 +24,7 @@ def wrap_joints_and_values( joints: Union[list[str], pa.Array], values: Union[int, list[int], pa.Array], ) -> pa.StructArray: - """ - Wraps joints and their corresponding values into a structured array. + """Wrap joints and their corresponding values into a structured array. :param joints: A list, numpy array, or pyarrow array of joint names. :type joints: Union[list[str], np.array, pa.Array] @@ -39,7 +40,7 @@ def wrap_joints_and_values( :raises ValueError: If lengths of joints and values do not match. Example: - -------- + ------- joints = ["shoulder_pan", "shoulder_lift", "elbow_flex"] values = [100, 200, 300] struct_array = wrap_joints_and_values(joints, values) @@ -52,8 +53,8 @@ def wrap_joints_and_values( struct_array = wrap_joints_and_values(joints, value) This example broadcasts the single integer value to all joints and wraps them into a structured array. - """ + """ if isinstance(values, int): values = [values] * len(joints) @@ -74,11 +75,15 @@ def wrap_joints_and_values( class TorqueMode(enum.Enum): + """TODO: Add docstring.""" + ENABLED = pa.scalar(1, pa.uint32()) DISABLED = pa.scalar(0, pa.uint32()) class OperatingMode(enum.Enum): + """TODO: Add docstring.""" + VELOCITY = pa.scalar(1, pa.uint32()) POSITION = pa.scalar(3, pa.uint32()) EXTENDED_POSITION = pa.scalar(4, pa.uint32()) @@ -152,8 +157,10 @@ MODEL_CONTROL_TABLE = { class DynamixelBus: + """TODO: Add docstring.""" def __init__(self, port: str, description: dict[str, (int, str)]): + """TODO: Add docstring.""" self.port = port self.descriptions = description self.motor_ctrl = {} @@ -184,9 +191,11 @@ class DynamixelBus: self.group_writers = {} def close(self): + """TODO: Add docstring.""" self.port_handler.closePort() def write(self, data_name: str, data: pa.StructArray): + """TODO: Add docstring.""" motor_ids = [ self.motor_ctrl[motor_name.as_py()]["id"] for motor_name in data.field("joints") @@ -255,6 +264,7 @@ class DynamixelBus: ) def read(self, data_name: str, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" motor_ids = [ self.motor_ctrl[motor_name.as_py()]["id"] for motor_name in motor_names ] @@ -298,31 +308,41 @@ class DynamixelBus: return wrap_joints_and_values(motor_names, values) def write_torque_enable(self, torque_mode: pa.StructArray): + """TODO: Add docstring.""" self.write("Torque_Enable", torque_mode) def write_operating_mode(self, operating_mode: pa.StructArray): + """TODO: Add docstring.""" self.write("Operating_Mode", operating_mode) def read_position(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Position", motor_names) def read_velocity(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Velocity", motor_names) def read_current(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Current", motor_names) def write_goal_position(self, goal_position: pa.StructArray): + """TODO: Add docstring.""" self.write("Goal_Position", goal_position) def write_goal_current(self, goal_current: pa.StructArray): + """TODO: Add docstring.""" self.write("Goal_Current", goal_current) def write_position_p_gain(self, position_p_gain: pa.StructArray): + """TODO: Add docstring.""" self.write("Position_P_Gain", position_p_gain) def write_position_i_gain(self, position_i_gain: pa.StructArray): + """TODO: Add docstring.""" self.write("Position_I_Gain", position_i_gain) def write_position_d_gain(self, position_d_gain: pa.StructArray): + """TODO: Add docstring.""" self.write("Position_D_Gain", position_d_gain) diff --git a/node-hub/dynamixel-client/dynamixel_client/main.py b/node-hub/dynamixel-client/dynamixel_client/main.py index e1a565fa..c54c1b22 100644 --- a/node-hub/dynamixel-client/dynamixel_client/main.py +++ b/node-hub/dynamixel-client/dynamixel_client/main.py @@ -1,6 +1,6 @@ -""" -Dynamixel Client: This node is used to represent a chain of dynamixel motors. It can be used to read positions, -velocities, currents, and set goal positions and currents. +"""Dynamixel Client: This node is used to represent a chain of dynamixel motors. + +It can be used to read positions, velocities, currents, and set goal positions and currents. """ import os @@ -16,8 +16,10 @@ from .bus import DynamixelBus, TorqueMode, wrap_joints_and_values class Client: + """TODO: Add docstring.""" def __init__(self, config: dict[str, any]): + """TODO: Add docstring.""" self.config = config description = {} @@ -45,6 +47,7 @@ class Client: self.node = Node(config["name"]) def run(self): + """TODO: Add docstring.""" for event in self.node: event_type = event["type"] @@ -68,6 +71,7 @@ class Client: raise ValueError("An error occurred in the dataflow: " + event["error"]) def close(self): + """TODO: Add docstring.""" self.bus.write_torque_enable( wrap_joints_and_values( self.config["joints"], @@ -76,6 +80,7 @@ class Client: ) def pull_position(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "position", @@ -87,6 +92,7 @@ class Client: print("Error reading position:", e) def pull_velocity(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "velocity", @@ -97,6 +103,7 @@ class Client: print("Error reading velocity:", e) def pull_current(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "current", @@ -107,12 +114,14 @@ class Client: print("Error reading current:", e) def write_goal_position(self, goal_position: pa.StructArray): + """TODO: Add docstring.""" try: self.bus.write_goal_position(goal_position) except ConnectionError as e: print("Error writing goal position:", e) def write_goal_current(self, goal_current: pa.StructArray): + """TODO: Add docstring.""" try: self.bus.write_goal_current(goal_current) except ConnectionError as e: @@ -120,7 +129,7 @@ class Client: def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="Dynamixel Client: This node is used to represent a chain of dynamixel motors. It can be used to " "read positions, velocities, currents, and set goal positions and currents." diff --git a/node-hub/dynamixel-client/pyproject.toml b/node-hub/dynamixel-client/pyproject.toml index 8eb0b725..6658d647 100644 --- a/node-hub/dynamixel-client/pyproject.toml +++ b/node-hub/dynamixel-client/pyproject.toml @@ -21,3 +21,9 @@ dynamixel-client = "dynamixel_client.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/dynamixel-client/tests/test_dynamixel_client.py b/node-hub/dynamixel-client/tests/test_dynamixel_client.py index 2388f99f..7b8b9b4c 100644 --- a/node-hub/dynamixel-client/tests/test_dynamixel_client.py +++ b/node-hub/dynamixel-client/tests/test_dynamixel_client.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/feetech-client/feetech_client/__init__.py b/node-hub/feetech-client/feetech_client/__init__.py index e69de29b..b8973a5a 100644 --- a/node-hub/feetech-client/feetech_client/__init__.py +++ b/node-hub/feetech-client/feetech_client/__init__.py @@ -0,0 +1 @@ +"""TODO: Add docstring.""" \ No newline at end of file diff --git a/node-hub/feetech-client/feetech_client/bus.py b/node-hub/feetech-client/feetech_client/bus.py index 77662788..bca6030a 100644 --- a/node-hub/feetech-client/feetech_client/bus.py +++ b/node-hub/feetech-client/feetech_client/bus.py @@ -1,3 +1,4 @@ +"""TODO: Add docstring.""" import enum from typing import Union @@ -24,6 +25,7 @@ def wrap_joints_and_values( joints: Union[list[str], pa.Array], values: Union[list[int], pa.Array], ) -> pa.StructArray: + """TODO: Add docstring.""" return pa.StructArray.from_arrays( arrays=[joints, values], names=["joints", "values"], @@ -31,11 +33,15 @@ def wrap_joints_and_values( class TorqueMode(enum.Enum): + """TODO: Add docstring.""" + ENABLED = pa.scalar(1, pa.uint32()) DISABLED = pa.scalar(0, pa.uint32()) class OperatingMode(enum.Enum): + """TODO: Add docstring.""" + ONE_TURN = pa.scalar(0, pa.uint32()) @@ -93,15 +99,16 @@ MODEL_CONTROL_TABLE = { class FeetechBus: + """TODO: Add docstring.""" def __init__(self, port: str, description: dict[str, (np.uint8, str)]): - """ - Args: - port: the serial port to connect to the Feetech bus - description: a dictionary containing the description of the motors connected to the bus. The keys are the - motor names and the values are tuples containing the motor id and the motor model. - """ + """Args:-. + + port: the serial port to connect to the Feetech bus + description: a dictionary containing the description of the motors connected to the bus. The keys are the + motor names and the values are tuples containing the motor id and the motor model. + """ self.port = port self.descriptions = description self.motor_ctrl = {} @@ -132,9 +139,11 @@ class FeetechBus: self.group_writers = {} def close(self): + """TODO: Add docstring.""" self.port_handler.closePort() def write(self, data_name: str, data: pa.StructArray): + """TODO: Add docstring.""" motor_ids = [ self.motor_ctrl[motor_name.as_py()]["id"] for motor_name in data.field("joints") @@ -201,6 +210,7 @@ class FeetechBus: ) def read(self, data_name: str, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" motor_ids = [ self.motor_ctrl[motor_name.as_py()]["id"] for motor_name in motor_names ] @@ -251,25 +261,33 @@ class FeetechBus: return wrap_joints_and_values(motor_names, values) def write_torque_enable(self, torque_mode: pa.StructArray): + """TODO: Add docstring.""" self.write("Torque_Enable", torque_mode) def write_operating_mode(self, operating_mode: pa.StructArray): + """TODO: Add docstring.""" self.write("Mode", operating_mode) def read_position(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Position", motor_names) def read_velocity(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Velocity", motor_names) def read_current(self, motor_names: pa.Array) -> pa.StructArray: + """TODO: Add docstring.""" return self.read("Present_Current", motor_names) def write_goal_position(self, goal_position: pa.StructArray): + """TODO: Add docstring.""" self.write("Goal_Position", goal_position) def write_max_angle_limit(self, max_angle_limit: pa.StructArray): + """TODO: Add docstring.""" self.write("Max_Angle_Limit", max_angle_limit) def write_min_angle_limit(self, min_angle_limit: pa.StructArray): + """TODO: Add docstring.""" self.write("Min_Angle_Limit", min_angle_limit) diff --git a/node-hub/feetech-client/feetech_client/main.py b/node-hub/feetech-client/feetech_client/main.py index 1e5cfdd2..c1f26d60 100644 --- a/node-hub/feetech-client/feetech_client/main.py +++ b/node-hub/feetech-client/feetech_client/main.py @@ -1,7 +1,4 @@ -""" -Feetech Client: This node is used to represent a chain of feetech motors. It can be used to read positions, -velocities, currents, and set goal positions and currents. -""" +"""Feetech Client: This node is used to represent a chain of feetech motors. It can be used to read positions, velocities, currents, and set goal positions and currents.""" import os import argparse @@ -15,8 +12,10 @@ from .bus import FeetechBus, TorqueMode, wrap_joints_and_values class Client: + """TODO: Add docstring.""" def __init__(self, config: dict[str, any]): + """TODO: Add docstring.""" self.config = config description = {} @@ -34,6 +33,7 @@ class Client: self.node = Node(config["name"]) def run(self): + """TODO: Add docstring.""" for event in self.node: event_type = event["type"] @@ -55,6 +55,7 @@ class Client: raise ValueError("An error occurred in the dataflow: " + event["error"]) def close(self): + """TODO: Add docstring.""" self.bus.write_torque_enable( wrap_joints_and_values( self.config["joints"], @@ -63,6 +64,7 @@ class Client: ) def pull_position(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "position", @@ -74,6 +76,7 @@ class Client: print("Error reading position:", e) def pull_velocity(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "velocity", @@ -84,6 +87,7 @@ class Client: print("Error reading velocity:", e) def pull_current(self, node, metadata): + """TODO: Add docstring.""" try: node.send_output( "current", @@ -94,6 +98,7 @@ class Client: print("Error reading current:", e) def write_goal_position(self, goal_position: pa.StructArray): + """TODO: Add docstring.""" try: self.bus.write_goal_position(goal_position) except ConnectionError as e: @@ -101,7 +106,7 @@ class Client: def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="Feetech Client: This node is used to represent a chain of feetech motors. " "It can be used to read " diff --git a/node-hub/feetech-client/pyproject.toml b/node-hub/feetech-client/pyproject.toml index d1135c27..ae1f1347 100644 --- a/node-hub/feetech-client/pyproject.toml +++ b/node-hub/feetech-client/pyproject.toml @@ -7,7 +7,6 @@ license = { text = "MIT" } readme = "README.md" requires-python = ">=3.9" - dependencies = [ "dora-rs == 0.3.5", "numpy <= 2.0.0", @@ -23,3 +22,9 @@ feetech-client = "feetech_client.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/feetech-client/tests/test_feetech_client.py b/node-hub/feetech-client/tests/test_feetech_client.py index 4a3e19c9..b57c9bbb 100644 --- a/node-hub/feetech-client/tests/test_feetech_client.py +++ b/node-hub/feetech-client/tests/test_feetech_client.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/lebai-client/lebai_client/main.py b/node-hub/lebai-client/lebai_client/main.py index 25c75a78..e66b3e78 100644 --- a/node-hub/lebai-client/lebai_client/main.py +++ b/node-hub/lebai-client/lebai_client/main.py @@ -1,3 +1,4 @@ +"""TODO: Add docstring.""" import lebai_sdk import numpy as np from dora import Node @@ -9,7 +10,7 @@ import time def load_json_file(file_path): """Load JSON file and return the dictionary.""" if os.path.exists(file_path): - with open(file_path, "r") as file: + with open(file_path) as file: data = json.load(file) else: # Return an empty dictionary if file does not exist @@ -32,6 +33,7 @@ ROBOT_IP = os.getenv( def main(): + """TODO: Add docstring.""" # Load the JSON file pose_library = load_json_file(SAVED_POSE_PATH) lebai = lebai_sdk.connect(ROBOT_IP, False) # 创建实例 diff --git a/node-hub/lebai-client/pyproject.toml b/node-hub/lebai-client/pyproject.toml index 4e83ae15..53c4835b 100644 --- a/node-hub/lebai-client/pyproject.toml +++ b/node-hub/lebai-client/pyproject.toml @@ -21,3 +21,9 @@ lebai-client = "lebai_client.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/lebai-client/test/test.py b/node-hub/lebai-client/test/test.py index f8711c19..0239ff15 100644 --- a/node-hub/lebai-client/test/test.py +++ b/node-hub/lebai-client/test/test.py @@ -1,3 +1,4 @@ +"""TODO: Add docstring.""" import lebai_sdk @@ -5,6 +6,7 @@ lebai_sdk.init() def main(): + """TODO: Add docstring.""" # print(lebai_sdk.discover_devices(2)) #发现同一局域网内的机器人 robot_ip = "10.20.17.1" # 设定机器人ip地址,需要根据机器人实际ip地址修改 diff --git a/node-hub/lebai-client/tests/test_lebai_client.py b/node-hub/lebai-client/tests/test_lebai_client.py index 6def8e51..6bb9c958 100644 --- a/node-hub/lebai-client/tests/test_lebai_client.py +++ b/node-hub/lebai-client/tests/test_lebai_client.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/lerobot-dashboard/lerobot_dashboard/__init__.py b/node-hub/lerobot-dashboard/lerobot_dashboard/__init__.py index e69de29b..b8973a5a 100644 --- a/node-hub/lerobot-dashboard/lerobot_dashboard/__init__.py +++ b/node-hub/lerobot-dashboard/lerobot_dashboard/__init__.py @@ -0,0 +1 @@ +"""TODO: Add docstring.""" \ No newline at end of file diff --git a/node-hub/lerobot-dashboard/lerobot_dashboard/main.py b/node-hub/lerobot-dashboard/lerobot_dashboard/main.py index 7d56bd65..1856bb97 100644 --- a/node-hub/lerobot-dashboard/lerobot_dashboard/main.py +++ b/node-hub/lerobot-dashboard/lerobot_dashboard/main.py @@ -1,6 +1,4 @@ -""" -This Dora node is a minimalistic interface that shows two images and text in a Pygame window. -""" +"""Following Dora node is a minimalistic interface that shows two images and text in a Pygame window.""" import os import argparse @@ -13,7 +11,7 @@ from dora import Node def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="LeRobot Record: This node is used to record episodes of a robot interacting with the environment." ) diff --git a/node-hub/lerobot-dashboard/pyproject.toml b/node-hub/lerobot-dashboard/pyproject.toml index 1be3bd26..863f5e56 100644 --- a/node-hub/lerobot-dashboard/pyproject.toml +++ b/node-hub/lerobot-dashboard/pyproject.toml @@ -23,3 +23,9 @@ lerobot-dashboard = "lerobot_dashboard.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/lerobot-dashboard/tests/test_lerobot_dashboard.py b/node-hub/lerobot-dashboard/tests/test_lerobot_dashboard.py index 4ba8028b..c5ef139a 100644 --- a/node-hub/lerobot-dashboard/tests/test_lerobot_dashboard.py +++ b/node-hub/lerobot-dashboard/tests/test_lerobot_dashboard.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/llama-factory-recorder/pyproject.toml b/node-hub/llama-factory-recorder/pyproject.toml index cf1dd1ff..af29d6ed 100644 --- a/node-hub/llama-factory-recorder/pyproject.toml +++ b/node-hub/llama-factory-recorder/pyproject.toml @@ -7,7 +7,6 @@ authors = [ ] description = "Dora Node for VLM" - requires-python = ">=3.8" dependencies = [ @@ -25,4 +24,5 @@ llama-factory-recorder = "llama_factory_recorder.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/mujoco-client/mujoco_client/__init__.py b/node-hub/mujoco-client/mujoco_client/__init__.py index e69de29b..b8973a5a 100644 --- a/node-hub/mujoco-client/mujoco_client/__init__.py +++ b/node-hub/mujoco-client/mujoco_client/__init__.py @@ -0,0 +1 @@ +"""TODO: Add docstring.""" \ No newline at end of file diff --git a/node-hub/mujoco-client/mujoco_client/main.py b/node-hub/mujoco-client/mujoco_client/main.py index 7ab8bd38..1c2d80f1 100644 --- a/node-hub/mujoco-client/mujoco_client/main.py +++ b/node-hub/mujoco-client/mujoco_client/main.py @@ -1,7 +1,4 @@ -""" -Mujoco Client: This node is used to represent simulated robot, it can be used to read virtual positions, -or can be controlled -""" +"""Mujoco Client: This node is used to represent simulated robot, it can be used to read virtual positions, or can be controlled.""" import os import argparse @@ -17,8 +14,10 @@ import mujoco.viewer class Client: + """TODO: Add docstring.""" def __init__(self, config: dict[str, any]): + """TODO: Add docstring.""" self.config = config self.m = mujoco.MjModel.from_xml_path(filename=config["scene"]) @@ -27,6 +26,7 @@ class Client: self.node = Node(config["name"]) def run(self): + """TODO: Add docstring.""" with mujoco.viewer.launch_passive(self.m, self.data) as viewer: for event in self.node: event_type = event["type"] @@ -72,15 +72,19 @@ class Client: self.node.send_output("end", pa.array([])) def pull_position(self, node, metadata): + """TODO: Add docstring.""" pass def pull_velocity(self, node, metadata): + """TODO: Add docstring.""" pass def pull_current(self, node, metadata): + """TODO: Add docstring.""" pass def write_goal_position(self, goal_position_with_joints): + """TODO: Add docstring.""" joints = goal_position_with_joints.field("joints") goal_position = goal_position_with_joints.field("values") @@ -89,7 +93,7 @@ class Client: def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="MujoCo Client: This node is used to represent a MuJoCo simulation. It can be used instead of a " "follower arm to test the dataflow." diff --git a/node-hub/mujoco-client/pyproject.toml b/node-hub/mujoco-client/pyproject.toml index 893568d7..edc3d5ae 100644 --- a/node-hub/mujoco-client/pyproject.toml +++ b/node-hub/mujoco-client/pyproject.toml @@ -22,3 +22,9 @@ mujoco-client = "mujoco_client.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/mujoco-client/tests/test_mujoco_client.py b/node-hub/mujoco-client/tests/test_mujoco_client.py index 085fcc41..603a1e20 100644 --- a/node-hub/mujoco-client/tests/test_mujoco_client.py +++ b/node-hub/mujoco-client/tests/test_mujoco_client.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/opencv-plot/pyproject.toml b/node-hub/opencv-plot/pyproject.toml index 1180bfb2..263b1cb4 100644 --- a/node-hub/opencv-plot/pyproject.toml +++ b/node-hub/opencv-plot/pyproject.toml @@ -7,7 +7,6 @@ authors = [ ] description = "Dora Node for plotting text and bbox on image with OpenCV" - requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9", "numpy < 2.0.0", "opencv-python >= 4.1.1"] @@ -21,4 +20,5 @@ opencv-plot = "opencv_plot.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/opencv-video-capture/pyproject.toml b/node-hub/opencv-video-capture/pyproject.toml index 7dce80c5..67060644 100644 --- a/node-hub/opencv-video-capture/pyproject.toml +++ b/node-hub/opencv-video-capture/pyproject.toml @@ -21,4 +21,5 @@ opencv-video-capture = "opencv_video_capture.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/pyarrow-assert/pyproject.toml b/node-hub/pyarrow-assert/pyproject.toml index b1683b52..273be3cd 100644 --- a/node-hub/pyarrow-assert/pyproject.toml +++ b/node-hub/pyarrow-assert/pyproject.toml @@ -22,4 +22,5 @@ pyarrow-assert = "pyarrow_assert.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/pyarrow-sender/pyproject.toml b/node-hub/pyarrow-sender/pyproject.toml index ce6f8f2a..3ae5f3b5 100644 --- a/node-hub/pyarrow-sender/pyproject.toml +++ b/node-hub/pyarrow-sender/pyproject.toml @@ -9,7 +9,6 @@ description = "Dora pyarrow Sender" license = { text = "MIT" } readme = "README.md" - requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9", "numpy < 2.0.0", "pyarrow >= 5.0.0"] @@ -23,4 +22,5 @@ pyarrow-sender = "pyarrow_sender.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/replay-client/pyproject.toml b/node-hub/replay-client/pyproject.toml index 725e2e94..eeae03b1 100644 --- a/node-hub/replay-client/pyproject.toml +++ b/node-hub/replay-client/pyproject.toml @@ -21,3 +21,9 @@ replay-client = "replay_client.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/replay-client/replay_client/__init__.py b/node-hub/replay-client/replay_client/__init__.py index e69de29b..b8973a5a 100644 --- a/node-hub/replay-client/replay_client/__init__.py +++ b/node-hub/replay-client/replay_client/__init__.py @@ -0,0 +1 @@ +"""TODO: Add docstring.""" \ No newline at end of file diff --git a/node-hub/replay-client/replay_client/main.py b/node-hub/replay-client/replay_client/main.py index 901d3daa..eca1931e 100644 --- a/node-hub/replay-client/replay_client/main.py +++ b/node-hub/replay-client/replay_client/main.py @@ -1,5 +1,5 @@ -""" -Replay Client: This node is used to represent a leader robot and send a sequence of goals to the dataflow, +"""Replay Client: This node is used to represent a leader robot and send a sequence of goals to the dataflow,. + reading a dataset of actions and joints from a specific episode. """ @@ -13,6 +13,7 @@ from dora import Node def joints_values_to_arrow(joints, values): + """TODO: Add docstring.""" return pa.StructArray.from_arrays( arrays=[joints, values], names=["joints", "values"], @@ -23,8 +24,10 @@ def joints_values_to_arrow(joints, values): class Client: + """TODO: Add docstring.""" def __init__(self, config: dict[str, any]): + """TODO: Add docstring.""" self.config = config self.node = Node(config["name"]) @@ -39,6 +42,7 @@ class Client: self.frame = 0 def run(self): + """TODO: Add docstring.""" for event in self.node: event_type = event["type"] @@ -57,6 +61,7 @@ class Client: self.node.send_output("end", pa.array([])) def pull_position(self, node, metadata) -> bool: + """TODO: Add docstring.""" if self.frame >= len(self.action): return True @@ -71,7 +76,7 @@ class Client: def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="Replay Client: This node is used to replay a sequence of goals for a followee robot." ) diff --git a/node-hub/replay-client/tests/test_replay_client.py b/node-hub/replay-client/tests/test_replay_client.py index f82dbdad..6e30406e 100644 --- a/node-hub/replay-client/tests/test_replay_client.py +++ b/node-hub/replay-client/tests/test_replay_client.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/terminal-input/pyproject.toml b/node-hub/terminal-input/pyproject.toml index 3b406605..a8392144 100644 --- a/node-hub/terminal-input/pyproject.toml +++ b/node-hub/terminal-input/pyproject.toml @@ -9,7 +9,6 @@ description = "Dora terminal input" license = { text = "MIT" } readme = "README.md" - requires-python = ">=3.8" dependencies = ["dora-rs >= 0.3.9", "numpy < 2.0.0", "pyarrow >= 5.0.0"] @@ -23,4 +22,5 @@ terminal-input = "terminal_input.main:main" [tool.ruff.lint] extend-select = [ "D", # pydocstyle + "UP", ] diff --git a/node-hub/video-encoder/pyproject.toml b/node-hub/video-encoder/pyproject.toml index de8a0919..a1f04880 100644 --- a/node-hub/video-encoder/pyproject.toml +++ b/node-hub/video-encoder/pyproject.toml @@ -23,3 +23,9 @@ video-encoder = "video_encoder.main:main" [build-system] requires = ["poetry-core>=1.8.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff.lint] +extend-select = [ + "D", # pydocstyle + "UP" +] diff --git a/node-hub/video-encoder/tests/test_video_encoder.py b/node-hub/video-encoder/tests/test_video_encoder.py index 1976f479..b8b4c3da 100644 --- a/node-hub/video-encoder/tests/test_video_encoder.py +++ b/node-hub/video-encoder/tests/test_video_encoder.py @@ -1,7 +1,9 @@ +"""TODO: Add docstring.""" # import pytest def test_pass(): + """TODO: Add docstring.""" pass diff --git a/node-hub/video-encoder/video_encoder/__init__.py b/node-hub/video-encoder/video_encoder/__init__.py index e69de29b..42a8a3b2 100644 --- a/node-hub/video-encoder/video_encoder/__init__.py +++ b/node-hub/video-encoder/video_encoder/__init__.py @@ -0,0 +1 @@ +"""TODO: Doc String.""" \ No newline at end of file diff --git a/node-hub/video-encoder/video_encoder/main.py b/node-hub/video-encoder/video_encoder/main.py index 26f528f1..8ccb0fa3 100644 --- a/node-hub/video-encoder/video_encoder/main.py +++ b/node-hub/video-encoder/video_encoder/main.py @@ -1,3 +1,4 @@ +"""TODO : Doc String.""" import os from pathlib import Path @@ -12,7 +13,7 @@ from ffmpeg import FFmpeg def main(): - # Handle dynamic nodes, ask for the name of the node in the dataflow + """Handle dynamic nodes, ask for the name of the node in the dataflow.""" parser = argparse.ArgumentParser( description="Video Encoder: This node is used to record episodes of a robot interacting with the environment." )