Browse Source

Merge pull request #539 from EricLBuehler/typos

Fix some typos and add automatic typos check to CI
tags/v0.3.5-rc0
Haixuan Xavier Tao GitHub 1 year ago
parent
commit
685b01e8fe
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
24 changed files with 42 additions and 29 deletions
  1. +13
    -0
      .github/workflows/ci.yml
  2. +1
    -1
      Changelog.md
  3. +1
    -1
      README.md
  4. +1
    -1
      apis/c/operator/Cargo.toml
  5. +1
    -1
      apis/python/node/dora/__init__.pyi
  6. +4
    -4
      binaries/cli/src/check.rs
  7. +1
    -1
      binaries/cli/src/template/c/operator/operator-template.c
  8. +1
    -1
      binaries/coordinator/src/lib.rs
  9. +1
    -1
      binaries/daemon/src/pending.rs
  10. +1
    -1
      binaries/runtime/src/operator/python.rs
  11. +1
    -1
      examples/c++-ros2-dataflow/README.md
  12. +1
    -1
      examples/c++-ros2-dataflow/run.rs
  13. +1
    -1
      examples/cmake-dataflow/README.md
  14. +1
    -1
      examples/python-dataflow/README.md
  15. +1
    -1
      examples/python-operator-dataflow/README.md
  16. +1
    -1
      examples/python-operator-dataflow/file_saver_op.py
  17. +2
    -2
      examples/python-operator-dataflow/llm_op.py
  18. +1
    -1
      examples/python-operator-dataflow/object_detection.py
  19. +1
    -1
      examples/rerun-viewer/README.md
  20. +2
    -2
      libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs
  21. +1
    -1
      libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs
  22. +2
    -2
      libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs
  23. +1
    -1
      libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg
  24. +1
    -1
      libraries/extensions/ros2-bridge/python/src/lib.rs

+ 13
- 0
.github/workflows/ci.yml View File

@@ -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

+ 1
- 1
Changelog.md View File

@@ -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<u8>` 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


+ 1
- 1
README.md View File

@@ -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

<a href="http://www.youtube.com/watch?v=NvvTEP8Jak8">
<img align="center" width="600" alt="demo" src=http://img.youtube.com/vi/NvvTEP8Jak8/0.jpg>


+ 1
- 1
apis/c/operator/Cargo.toml View File

@@ -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



+ 1
- 1
apis/python/node/dora/__init__.pyi View File

@@ -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


+ 4
- 4
binaries/cli/src/check.rs View File

@@ -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.");
}



+ 1
- 1
binaries/cli/src/template/c/operator/operator-template.c View File

@@ -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,


+ 1
- 1
binaries/coordinator/src/lib.rs View File

@@ -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() {


+ 1
- 1
binaries/daemon/src/pending.rs View File

@@ -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;



+ 1
- 1
binaries/runtime/src/operator/python.rs View File

@@ -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 {


+ 1
- 1
examples/c++-ros2-dataflow/README.md View File

@@ -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
```


+ 1
- 1
examples/c++-ros2-dataflow/run.rs View File

@@ -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!(


+ 1
- 1
examples/cmake-dataflow/README.md View File

@@ -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.
```


+ 1
- 1
examples/python-dataflow/README.md View File

@@ -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


+ 1
- 1
examples/python-operator-dataflow/README.md View File

@@ -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


+ 1
- 1
examples/python-operator-dataflow/file_saver_op.py View File

@@ -5,7 +5,7 @@ from dora import DoraStatus

class Operator:
"""
Infering object from images
Inferring object from images
"""

def __init__(self):


+ 2
- 2
examples/python-operator-dataflow/llm_op.py View File

@@ -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]



+ 1
- 1
examples/python-operator-dataflow/object_detection.py View File

@@ -14,7 +14,7 @@ model = YOLO("yolov8n.pt")

class Operator:
"""
Infering object from images
Inferring object from images
"""

def on_event(


+ 1
- 1
examples/rerun-viewer/README.md View File

@@ -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



+ 2
- 2
libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs View File

@@ -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]


+ 1
- 1
libraries/extensions/ros2-bridge/msg-gen/src/parser/service.rs View File

@@ -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


+ 2
- 2
libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs View File

@@ -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;

}



+ 1
- 1
libraries/extensions/ros2-bridge/msg-gen/test_msgs/msg/MultiNested.msg View File

@@ -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


+ 1
- 1
libraries/extensions/ros2-bridge/python/src/lib.rs View File

@@ -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


Loading…
Cancel
Save