From 6c62246e538182deb90b15d024a201976f285558 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Thu, 6 Jun 2024 20:38:49 -0400 Subject: [PATCH 1/2] Fix typos --- Changelog.md | 2 +- README.md | 2 +- apis/c/operator/Cargo.toml | 2 +- apis/python/node/dora/__init__.pyi | 2 +- binaries/cli/src/check.rs | 8 ++++---- binaries/cli/src/template/c/operator/operator-template.c | 2 +- binaries/coordinator/src/lib.rs | 2 +- binaries/daemon/src/pending.rs | 2 +- binaries/runtime/src/operator/python.rs | 2 +- examples/c++-ros2-dataflow/README.md | 2 +- examples/c++-ros2-dataflow/run.rs | 2 +- examples/cmake-dataflow/README.md | 2 +- examples/python-dataflow/README.md | 2 +- examples/python-operator-dataflow/README.md | 2 +- examples/python-operator-dataflow/file_saver_op.py | 2 +- examples/python-operator-dataflow/llm_op.py | 4 ++-- examples/python-operator-dataflow/object_detection.py | 2 +- examples/rerun-viewer/README.md | 2 +- .../extensions/ros2-bridge/msg-gen/src/parser/ident.rs | 4 ++-- .../extensions/ros2-bridge/msg-gen/src/parser/service.rs | 2 +- .../extensions/ros2-bridge/msg-gen/src/types/action.rs | 4 ++-- .../ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg | 2 +- libraries/extensions/ros2-bridge/python/src/lib.rs | 2 +- 23 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8663b2d4..8f0ca9cd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -140,7 +140,7 @@ - Use read_line instead of next_line in stderr by @haixuanTao in https://github.com/dora-rs/dora/pull/325 - Add a `rust-ros2-dataflow` example using the dora-ros2-bridge by @phil-opp in https://github.com/dora-rs/dora/pull/324 - Removing patchelf by @haixuanTao in https://github.com/dora-rs/dora/pull/333 -- Improving python example readibility by @haixuanTao in https://github.com/dora-rs/dora/pull/334 +- Improving python example readability by @haixuanTao in https://github.com/dora-rs/dora/pull/334 - Use `serde_bytes` to serialize `Vec` by @haixuanTao in https://github.com/dora-rs/dora/pull/336 - Adding support for `Arrow List(*)` for Python by @haixuanTao in https://github.com/dora-rs/dora/pull/337 - Bump rustls-webpki from 0.100.1 to 0.100.2 by @dependabot in https://github.com/dora-rs/dora/pull/340 diff --git a/README.md b/README.md index 047b4cc1..1a6909da 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Opentelemetry is language independent, backend agnostic, and easily collect dist dora-rs implements Hot-Reloading for python which means you can change code at runtime in Python while keeping your state intact. Using the feature flag: `--attach --hot-reload`, dora-rs watch for code change and reload nodes that has been modified. -You can check fail-safe mecanism at: https://github.com/dora-rs/dora/pull/239 +You can check fail-safe mechanism at: https://github.com/dora-rs/dora/pull/239 demo diff --git a/apis/c/operator/Cargo.toml b/apis/c/operator/Cargo.toml index e1746964..ddac79ed 100644 --- a/apis/c/operator/Cargo.toml +++ b/apis/c/operator/Cargo.toml @@ -2,7 +2,7 @@ name = "dora-operator-api-c" version.workspace = true edition = "2021" -description = "C API implemetation for Dora Operator" +description = "C API implementation for Dora Operator" documentation.workspace = true license.workspace = true diff --git a/apis/python/node/dora/__init__.pyi b/apis/python/node/dora/__init__.pyi index b083d4f9..3dc33676 100644 --- a/apis/python/node/dora/__init__.pyi +++ b/apis/python/node/dora/__init__.pyi @@ -274,7 +274,7 @@ at any point without it being considered a breaking change.""" def publish(self, data: pyarrow.Array) -> None: """Publish a message into ROS2 topic. -Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure. +Remember that the data format should respect the structure of the ROS2 message using an arrow Structure. ex: ```python diff --git a/binaries/cli/src/check.rs b/binaries/cli/src/check.rs index 14a3cd35..49bc948e 100644 --- a/binaries/cli/src/check.rs +++ b/binaries/cli/src/check.rs @@ -9,7 +9,7 @@ use std::{ use termcolor::{Color, ColorChoice, ColorSpec, WriteColor}; pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> { - let mut error_occured = false; + let mut error_occurred = false; let color_choice = if std::io::stdout().is_terminal() { ColorChoice::Auto @@ -29,7 +29,7 @@ pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> { Err(_) => { let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red))); writeln!(stdout, "not running")?; - error_occured = true; + error_occurred = true; None } }; @@ -49,13 +49,13 @@ pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> { } else { let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red))); writeln!(stdout, "not running")?; - error_occured = true; + error_occurred = true; } let _ = stdout.reset(); writeln!(stdout)?; - if error_occured { + if error_occurred { bail!("Environment check failed."); } diff --git a/binaries/cli/src/template/c/operator/operator-template.c b/binaries/cli/src/template/c/operator/operator-template.c index 7639cfc6..d8dde979 100644 --- a/binaries/cli/src/template/c/operator/operator-template.c +++ b/binaries/cli/src/template/c/operator/operator-template.c @@ -41,7 +41,7 @@ OnEventResult_t dora_on_event( int data_alloc_size = 10; void *out_data = malloc(data_alloc_size); - // TODO intialize out_data + // TODO initialize out_data Output_t output = {.id = { .ptr = (uint8_t *)out_id_heap, diff --git a/binaries/coordinator/src/lib.rs b/binaries/coordinator/src/lib.rs index 5032d6a5..bfbe6f10 100644 --- a/binaries/coordinator/src/lib.rs +++ b/binaries/coordinator/src/lib.rs @@ -103,7 +103,7 @@ fn resolve_name( } else if let [uuid] = archived_uuids.as_slice() { Ok(*uuid) } else { - // TOOD: Index the archived dataflows in order to return logs based on the index. + // TODO: Index the archived dataflows in order to return logs based on the index. bail!("multiple archived dataflows found with name `{name}`, Please provide the UUID instead."); } } else if let [uuid] = uuids.as_slice() { diff --git a/binaries/daemon/src/pending.rs b/binaries/daemon/src/pending.rs index 9ba907ff..ccba1a56 100644 --- a/binaries/daemon/src/pending.rs +++ b/binaries/daemon/src/pending.rs @@ -92,7 +92,7 @@ impl PendingNodes { let external_error = if success { None } else { - Some("some nodes failed to initalize on remote machines".to_string()) + Some("some nodes failed to initialize on remote machines".to_string()) }; self.answer_subscribe_requests(external_error).await; diff --git a/binaries/runtime/src/operator/python.rs b/binaries/runtime/src/operator/python.rs index 8ebbbfc2..d4bebf66 100644 --- a/binaries/runtime/src/operator/python.rs +++ b/binaries/runtime/src/operator/python.rs @@ -310,7 +310,7 @@ mod callback_impl { /// Send an output from the operator: /// - the first argument is the `output_id` as defined in your dataflow. /// - the second argument is the data as either bytes or pyarrow.Array for zero copy. - /// - the third argument is dora metadata if you want ot link the tracing from one input into an output. + /// - the third argument is dora metadata if you want to link the tracing from one input into an output. /// `e.g.: send_output("bbox", pa.array([100], type=pa.uint8()), dora_event["metadata"])` #[pymethods] impl SendOutputCallback { diff --git a/examples/c++-ros2-dataflow/README.md b/examples/c++-ros2-dataflow/README.md index 2f8b3561..f70b50d6 100644 --- a/examples/c++-ros2-dataflow/README.md +++ b/examples/c++-ros2-dataflow/README.md @@ -14,7 +14,7 @@ This examples requires a sourced ROS2 installation. ## Running pub/sub example -A ROS2 client to pubish turtlesim ROS2 messages and a DORA node can subscribe and visualize it. +A ROS2 client to publish turtlesim ROS2 messages and a DORA node can subscribe and visualize it. From terminal 1 , sourcing the ROS2 installation and start ROS2 turtlesim window ``` diff --git a/examples/c++-ros2-dataflow/run.rs b/examples/c++-ros2-dataflow/run.rs index 4d5d242f..918158c2 100644 --- a/examples/c++-ros2-dataflow/run.rs +++ b/examples/c++-ros2-dataflow/run.rs @@ -4,7 +4,7 @@ use std::{env::consts::EXE_SUFFIX, path::Path}; #[tokio::main] async fn main() -> eyre::Result<()> { - set_up_tracing("c++-ros2-dataflow-exaple").wrap_err("failed to set up tracing")?; + set_up_tracing("c++-ros2-dataflow-example").wrap_err("failed to set up tracing")?; if cfg!(windows) { tracing::error!( diff --git a/examples/cmake-dataflow/README.md b/examples/cmake-dataflow/README.md index f2833b0d..4fd187cf 100644 --- a/examples/cmake-dataflow/README.md +++ b/examples/cmake-dataflow/README.md @@ -8,7 +8,7 @@ See also [c++-example](https://github.com/dora-rs/dora/blob/main/examples/c%2B%2 To try it out, you can use the [`run.rs`](./run.rs) binary. It performs all required build steps and then starts the dataflow. Use the following command to run it: `cargo run --example cmake-dataflow`. -## Out-of-tree complie +## Out-of-tree compile This example also can be ran in a separate root directory. ``` diff --git a/examples/python-dataflow/README.md b/examples/python-dataflow/README.md index 69074bd7..2211a721 100644 --- a/examples/python-dataflow/README.md +++ b/examples/python-dataflow/README.md @@ -7,7 +7,7 @@ This examples shows how to create and connect dora operators and custom nodes in The [`dataflow.yml`](./dataflow.yml) defines a simple dataflow graph with the following three nodes: - a webcam node, that connects to your webcam and feed the dataflow with webcam frame as jpeg compressed bytearray. -- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bouding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/ +- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bounding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/ - a window plotting node, that will retrieve the webcam image and the Yolov5 bounding box and join the two together. ## Getting started diff --git a/examples/python-operator-dataflow/README.md b/examples/python-operator-dataflow/README.md index 767e1c10..30b04e61 100644 --- a/examples/python-operator-dataflow/README.md +++ b/examples/python-operator-dataflow/README.md @@ -7,7 +7,7 @@ This examples shows how to create and connect dora operators and custom nodes in The [`dataflow.yml`](./dataflow.yml) defines a simple dataflow graph with the following three nodes: - a webcam node, that connects to your webcam and feed the dataflow with webcam frame as jpeg compressed bytearray. -- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bouding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/ +- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bounding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/ - a window plotting node, that will retrieve the webcam image and the Yolov5 bounding box and join the two together. ## Getting started diff --git a/examples/python-operator-dataflow/file_saver_op.py b/examples/python-operator-dataflow/file_saver_op.py index df1128f8..592e10f5 100644 --- a/examples/python-operator-dataflow/file_saver_op.py +++ b/examples/python-operator-dataflow/file_saver_op.py @@ -5,7 +5,7 @@ from dora import DoraStatus class Operator: """ - Infering object from images + Inferring object from images """ def __init__(self): diff --git a/examples/python-operator-dataflow/llm_op.py b/examples/python-operator-dataflow/llm_op.py index 5f595768..0e8d484a 100644 --- a/examples/python-operator-dataflow/llm_op.py +++ b/examples/python-operator-dataflow/llm_op.py @@ -13,7 +13,7 @@ MODEL_NAME_OR_PATH = "TheBloke/deepseek-coder-6.7B-instruct-GPTQ" CODE_MODIFIER_TEMPLATE = """ ### Instruction -Respond with the small modified code only. No explaination. +Respond with the small modified code only. No explanation. ```python {code} @@ -27,7 +27,7 @@ Respond with the small modified code only. No explaination. MESSAGE_SENDER_TEMPLATE = """ ### Instruction -You're a json expert. Format your response as a json with a topic and a data field in a ```json block. No explaination needed. No code needed. +You're a json expert. Format your response as a json with a topic and a data field in a ```json block. No explanation needed. No code needed. The schema for those json are: - line: Int[4] diff --git a/examples/python-operator-dataflow/object_detection.py b/examples/python-operator-dataflow/object_detection.py index 087dfc27..c542e2c3 100755 --- a/examples/python-operator-dataflow/object_detection.py +++ b/examples/python-operator-dataflow/object_detection.py @@ -14,7 +14,7 @@ model = YOLO("yolov8n.pt") class Operator: """ - Infering object from images + Inferring object from images """ def on_event( diff --git a/examples/rerun-viewer/README.md b/examples/rerun-viewer/README.md index b16c12aa..0f481bf6 100644 --- a/examples/rerun-viewer/README.md +++ b/examples/rerun-viewer/README.md @@ -16,7 +16,7 @@ cargo install --git https://github.com/dora-rs/dora dora-rerun dora start dataflow.yml --attach ``` -You will see two visualizations. One from matplotlib and one from rerun for comparaison. +You will see two visualizations. One from matplotlib and one from rerun for comparison. ## CI/CD diff --git a/libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs b/libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs index 8f1fbb2a..76e59a8f 100644 --- a/libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs +++ b/libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs @@ -60,12 +60,12 @@ mod test { #[test] fn parse_member_name_should_fail_if_starting_with_underscore() { - assert!(member_name("_invalid_indentifier").is_err()); + assert!(member_name("_invalid_identifier").is_err()); } #[test] fn parse_member_name_should_fail_if_starting_with_number() { - assert!(member_name("0invalid_indentifier").is_err()); + assert!(member_name("0invalid_identifier").is_err()); } #[test] diff --git a/libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs b/libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs index 5ac6a522..033b5b10 100644 --- a/libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs +++ b/libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs @@ -26,7 +26,7 @@ fn parse_service_string(pkg_name: &str, srv_name: &str, service_string: &str) -> let service_blocks: Vec<_> = re.split(service_string).collect(); if service_blocks.len() != 2 { return Err(RclMsgError::InvalidServiceSpecification(format!( - "Expect one '---' seperator in {}/{} service definition, but get {}", + "Expect one '---' separator in {}/{} service definition, but get {}", pkg_name, srv_name, service_blocks.len() - 1 diff --git a/libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs b/libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs index 0e4ab74e..9338abf8 100644 --- a/libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs +++ b/libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs @@ -150,7 +150,7 @@ impl Action { let feedback_type = format_ident!("{}_Feedback", self.name); let send_goal_type = format_ident!("{}_SendGoal", self.name); let get_result_type = format_ident!("{}_GetResult", self.name); - let feeback_message_type = format_ident!("{}_FeedbackMessage", self.name); + let feedback_message_type = format_ident!("{}_FeedbackMessage", self.name); let goal_body = self.goal.token_stream(); let result_body = self.result.token_stream(); @@ -180,7 +180,7 @@ impl Action { type Feedback = #feedback_type; type SendGoal = #send_goal_type; type GetResult = #get_result_type; - type FeedbackMessage = #feeback_message_type; + type FeedbackMessage = #feedback_message_type; } diff --git a/libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg b/libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg index cf324dc8..4cfb10c3 100644 --- a/libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg +++ b/libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg @@ -1,4 +1,4 @@ -# Mulitple levels of nested messages +# Multiple levels of nested messages Arrays[3] array_of_arrays BoundedSequences[3] array_of_bounded_sequences UnboundedSequences[3] array_of_unbounded_sequences diff --git a/libraries/extensions/ros2-bridge/python/src/lib.rs b/libraries/extensions/ros2-bridge/python/src/lib.rs index b335a4e8..a3637591 100644 --- a/libraries/extensions/ros2-bridge/python/src/lib.rs +++ b/libraries/extensions/ros2-bridge/python/src/lib.rs @@ -303,7 +303,7 @@ pub struct Ros2Publisher { impl Ros2Publisher { /// Publish a message into ROS2 topic. /// - /// Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure. + /// Remember that the data format should respect the structure of the ROS2 message using an arrow Structure. /// /// ex: /// ```python From 8adb6e0cf45dd61ecf5fb07c4531254dd8421e49 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Thu, 6 Jun 2024 20:40:03 -0400 Subject: [PATCH 2/2] Add typos check to ci --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9aee930..0ba144e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -359,3 +359,16 @@ jobs: - run: cargo install cargo-lichking - name: "Check dependency licenses" run: cargo lichking check + + typos: + name: Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Typos check with custom config file + uses: crate-ci/typos@master