Skip to content

Commit

Permalink
Merge pull request #501 from dora-rs/python-dataflow-id
Browse files Browse the repository at this point in the history
Add `dataflow_id` getter in python
  • Loading branch information
haixuanTao authored May 18, 2024
2 parents bdecc71 + 0f53090 commit 8e14df4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis/python/node/dora/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ node = Node()
This method returns the parsed dataflow YAML file."""

def dataflow_id(self) -> str:
"""Returns the dataflow id."""

def merge_external_events(self, subscription: dora.Ros2Subscription) -> None:
"""Merge an external event stream with dora main loop.
This currently only work with ROS2."""
Expand Down
7 changes: 7 additions & 0 deletions apis/python/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ impl Node {
pythonize::pythonize(py, self.node.dataflow_descriptor())
}

/// Returns the dataflow id.
///
/// :rtype: str
pub fn dataflow_id(&self) -> String {
self.node.dataflow_id().to_string()
}

/// Merge an external event stream with dora main loop.
/// This currently only work with ROS2.
///
Expand Down

0 comments on commit 8e14df4

Please sign in to comment.