dora-rs 0.3.3rc1__cp37-abi3-macosx_11_0_arm64.whl → 0.3.4rc2__cp37-abi3-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dora-rs might be problematic. Click here for more details.

dora/__init__.py CHANGED
@@ -1,10 +1,7 @@
1
1
  """
2
2
  # dora-rs
3
-
4
3
  This is the dora python client for interacting with dora dataflow.
5
-
6
4
  You can install it via:
7
-
8
5
  ```bash
9
6
  pip install dora-rs
10
7
  ```
@@ -14,14 +11,27 @@ from enum import Enum
14
11
 
15
12
  from .dora import *
16
13
 
17
- __author__ = "Dora-rs Authors"
18
- __version__ = "0.3.3-rc1"
14
+ from .dora import (
15
+ Node,
16
+ PyEvent,
17
+ Ros2Context,
18
+ Ros2Node,
19
+ Ros2NodeOptions,
20
+ Ros2Topic,
21
+ Ros2Publisher,
22
+ Ros2Subscription,
23
+ start_runtime,
24
+ __version__,
25
+ __author__,
26
+ Ros2QosPolicies,
27
+ Ros2Durability,
28
+ Ros2Liveliness,
29
+ )
19
30
 
20
31
 
21
32
  class DoraStatus(Enum):
22
33
  """Dora status to indicate if operator `on_input` loop
23
34
  should be stopped.
24
-
25
35
  Args:
26
36
  Enum (u8): Status signaling to dora operator to
27
37
  stop or continue the operator.
dora/__init__.pyi ADDED
@@ -0,0 +1,317 @@
1
+ import dora
2
+ import pyarrow
3
+ import typing
4
+
5
+ @typing.final
6
+ class Enum:
7
+ """Generic enumeration.
8
+
9
+ Derive from this class to define new enumerations."""
10
+ __members__: mappingproxy = ...
11
+
12
+ @typing.final
13
+ class Node:
14
+ """The custom node API lets you integrate `dora` into your application.
15
+ It allows you to retrieve input and send output in any fashion you want.
16
+
17
+ Use with:
18
+
19
+ ```python
20
+ from dora import Node
21
+
22
+ node = Node()
23
+ ```"""
24
+
25
+ def __init__(self) -> None:
26
+ """The custom node API lets you integrate `dora` into your application.
27
+ It allows you to retrieve input and send output in any fashion you want.
28
+
29
+ Use with:
30
+
31
+ ```python
32
+ from dora import Node
33
+
34
+ node = Node()
35
+ ```"""
36
+
37
+ def dataflow_descriptor(self) -> dict:
38
+ """Returns the full dataflow descriptor that this node is part of.
39
+
40
+ This method returns the parsed dataflow YAML file."""
41
+
42
+ def merge_external_events(self, subscription: dora.Ros2Subscription) -> None:
43
+ """Merge an external event stream with dora main loop.
44
+ This currently only work with ROS2."""
45
+
46
+ def next(self, timeout: float=None) -> dora.PyEvent:
47
+ """`.next()` gives you the next input that the node has received.
48
+ It blocks until the next event becomes available.
49
+ You can use timeout in seconds to return if no input is available.
50
+ It will return `None` when all senders has been dropped.
51
+
52
+ ```python
53
+ event = node.next()
54
+ ```
55
+
56
+ You can also iterate over the event stream with a loop
57
+
58
+ ```python
59
+ for event in node:
60
+ match event["type"]:
61
+ case "INPUT":
62
+ match event["id"]:
63
+ case "image":
64
+ ```"""
65
+
66
+ def send_output(self, output_id: str, data: pyarrow.Array, metadata: dict=None) -> None:
67
+ """`send_output` send data from the node.
68
+
69
+ ```python
70
+ Args:
71
+ output_id: str,
72
+ data: pyarrow.Array,
73
+ metadata: Option[Dict],
74
+ ```
75
+
76
+ ex:
77
+
78
+ ```python
79
+ node.send_output("string", b"string", {"open_telemetry_context": "7632e76"})
80
+ ```"""
81
+
82
+ def __iter__(self) -> typing.Any:
83
+ """Implement iter(self)."""
84
+
85
+ def __next__(self) -> typing.Any:
86
+ """Implement next(self)."""
87
+
88
+ @typing.final
89
+ class PyEvent:
90
+ """Dora Event"""
91
+
92
+ def inner(self):...
93
+
94
+ def __getitem__(self, key: typing.Any) -> typing.Any:
95
+ """Return self[key]."""
96
+
97
+ @typing.final
98
+ class Ros2Context:
99
+ """ROS2 Context holding all messages definition for receiving and sending messages to ROS2.
100
+
101
+ By default, Ros2Context will use env `AMENT_PREFIX_PATH` to search for message definition.
102
+
103
+ AMENT_PREFIX_PATH folder structure should be the following:
104
+
105
+ - For messages: <namespace>/msg/<name>.msg
106
+ - For services: <namespace>/srv/<name>.srv
107
+
108
+ You can also use `ros_paths` if you don't want to use env variable.
109
+
110
+ warning::
111
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
112
+ at any point without it being considered a breaking change.
113
+
114
+ ```python
115
+ context = Ros2Context()
116
+ ```"""
117
+
118
+ def __init__(self, ros_paths: typing.List[str]=None) -> None:
119
+ """ROS2 Context holding all messages definition for receiving and sending messages to ROS2.
120
+
121
+ By default, Ros2Context will use env `AMENT_PREFIX_PATH` to search for message definition.
122
+
123
+ AMENT_PREFIX_PATH folder structure should be the following:
124
+
125
+ - For messages: <namespace>/msg/<name>.msg
126
+ - For services: <namespace>/srv/<name>.srv
127
+
128
+ You can also use `ros_paths` if you don't want to use env variable.
129
+
130
+ warning::
131
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
132
+ at any point without it being considered a breaking change.
133
+
134
+ ```python
135
+ context = Ros2Context()
136
+ ```"""
137
+
138
+ def new_node(self, name: str, namespace: str, options: dora.Ros2NodeOptions) -> dora.Ros2Node:
139
+ """Create a new ROS2 node
140
+
141
+ ```python
142
+ ros2_node = ros2_context.new_node(
143
+ "turtle_teleop",
144
+ "/ros2_demo",
145
+ Ros2NodeOptions(rosout=True),
146
+ )
147
+ ```
148
+
149
+ warning::
150
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
151
+ at any point without it being considered a breaking change."""
152
+
153
+ @typing.final
154
+ class Ros2Durability:
155
+ """DDS 2.2.3.4 DURABILITY"""
156
+
157
+ def __eq__(self, value: typing.Any) -> bool:
158
+ """Return self==value."""
159
+
160
+ def __ge__(self, value: typing.Any) -> bool:
161
+ """Return self>=value."""
162
+
163
+ def __gt__(self, value: typing.Any) -> bool:
164
+ """Return self>value."""
165
+
166
+ def __int__(self) -> None:
167
+ """int(self)"""
168
+
169
+ def __le__(self, value: typing.Any) -> bool:
170
+ """Return self<=value."""
171
+
172
+ def __lt__(self, value: typing.Any) -> bool:
173
+ """Return self<value."""
174
+
175
+ def __ne__(self, value: typing.Any) -> bool:
176
+ """Return self!=value."""
177
+
178
+ def __repr__(self) -> str:
179
+ """Return repr(self)."""
180
+ Persistent: Ros2Durability = ...
181
+ Transient: Ros2Durability = ...
182
+ TransientLocal: Ros2Durability = ...
183
+ Volatile: Ros2Durability = ...
184
+
185
+ @typing.final
186
+ class Ros2Liveliness:
187
+ """DDS 2.2.3.11 LIVELINESS"""
188
+
189
+ def __eq__(self, value: typing.Any) -> bool:
190
+ """Return self==value."""
191
+
192
+ def __ge__(self, value: typing.Any) -> bool:
193
+ """Return self>=value."""
194
+
195
+ def __gt__(self, value: typing.Any) -> bool:
196
+ """Return self>value."""
197
+
198
+ def __int__(self) -> None:
199
+ """int(self)"""
200
+
201
+ def __le__(self, value: typing.Any) -> bool:
202
+ """Return self<=value."""
203
+
204
+ def __lt__(self, value: typing.Any) -> bool:
205
+ """Return self<value."""
206
+
207
+ def __ne__(self, value: typing.Any) -> bool:
208
+ """Return self!=value."""
209
+
210
+ def __repr__(self) -> str:
211
+ """Return repr(self)."""
212
+ Automatic: Ros2Liveliness = ...
213
+ ManualByParticipant: Ros2Liveliness = ...
214
+ ManualByTopic: Ros2Liveliness = ...
215
+
216
+ @typing.final
217
+ class Ros2Node:
218
+ """ROS2 Node
219
+
220
+ warnings::
221
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
222
+ at any point without it being considered a breaking change.
223
+ - There's a known issue about ROS2 nodes not being discoverable by ROS2
224
+ See: https://github.com/jhelovuo/ros2-client/issues/4"""
225
+
226
+ def create_publisher(self, topic: dora.Ros2Topic, qos: dora.Ros2QosPolicies=None) -> dora.Ros2Publisher:
227
+ """Create a ROS2 publisher
228
+
229
+ ```python
230
+ pose_publisher = ros2_node.create_publisher(turtle_pose_topic)
231
+ ```
232
+ warnings:
233
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
234
+ at any point without it being considered a breaking change."""
235
+
236
+ def create_subscription(self, topic: dora.Ros2Topic, qos: dora.Ros2QosPolicies=None) -> dora.Ros2Subscription:
237
+ """Create a ROS2 subscription
238
+
239
+ ```python
240
+ pose_reader = ros2_node.create_subscription(turtle_pose_topic)
241
+ ```
242
+
243
+ warnings:
244
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
245
+ at any point without it being considered a breaking change."""
246
+
247
+ def create_topic(self, name: str, message_type: str, qos: dora.Ros2QosPolicies) -> dora.Ros2Topic:
248
+ """Create a ROS2 topic to connect to.
249
+
250
+ ```python
251
+ turtle_twist_topic = ros2_node.create_topic(
252
+ "/turtle1/cmd_vel", "geometry_msgs/Twist", topic_qos
253
+ )
254
+ ```"""
255
+
256
+ @typing.final
257
+ class Ros2NodeOptions:
258
+ """ROS2 Node Options"""
259
+
260
+ def __init__(self, rosout: bool=None) -> None:
261
+ """ROS2 Node Options"""
262
+
263
+ @typing.final
264
+ class Ros2Publisher:
265
+ """ROS2 Publisher
266
+
267
+ warnings:
268
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
269
+ at any point without it being considered a breaking change."""
270
+
271
+ def publish(self, data: pyarrow.Array) -> None:
272
+ """Publish a message into ROS2 topic.
273
+
274
+ Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure.
275
+
276
+ ex:
277
+ ```python
278
+ gripper_command.publish(
279
+ pa.array(
280
+ [
281
+ {
282
+ "name": "gripper",
283
+ "cmd": np.float32(5),
284
+ }
285
+ ]
286
+ ),
287
+ )
288
+ ```"""
289
+
290
+ @typing.final
291
+ class Ros2QosPolicies:
292
+ """ROS2 QoS Policy"""
293
+
294
+ def __init__(self, durability: dora.Ros2Durability=None, liveliness: dora.Ros2Liveliness=None, reliable: bool=None, keep_all: bool=None, lease_duration: float=None, max_blocking_time: float=None, keep_last: int=None) -> dora.Ros2QoSPolicies:
295
+ """ROS2 QoS Policy"""
296
+
297
+ @typing.final
298
+ class Ros2Subscription:
299
+ """ROS2 Subscription
300
+
301
+
302
+ warnings:
303
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
304
+ at any point without it being considered a breaking change."""
305
+
306
+ def next(self):...
307
+
308
+ @typing.final
309
+ class Ros2Topic:
310
+ """ROS2 Topic
311
+
312
+ warnings:
313
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
314
+ at any point without it being considered a breaking change."""
315
+
316
+ def start_runtime() -> None:
317
+ """Start a runtime for Operators"""
dora/dora.abi3.so CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dora-rs
3
- Version: 0.3.3rc1
3
+ Version: 0.3.4rc2
4
4
  Requires-Dist: pyarrow
5
5
  Summary: `dora` goal is to be a low latency, composable, and distributed data flow.
6
6
  License: Apache-2.0
@@ -19,3 +19,12 @@ pip install maturin
19
19
  maturin develop
20
20
  ```
21
21
 
22
+ ## Type hinting
23
+
24
+ Type hinting requires to run a second step
25
+
26
+ ```bash
27
+ python generate_stubs.py dora dora/__init__.pyi
28
+ maturin develop
29
+ ```
30
+
@@ -0,0 +1,6 @@
1
+ dora_rs-0.3.4rc2.dist-info/METADATA,sha256=QtQ3-N3SRSflth27u5IZWnoexcJv3DV9BzaBPYRxazM,590
2
+ dora_rs-0.3.4rc2.dist-info/WHEEL,sha256=mr5kArZT1sHmSyQKqoXcetQKMw5B1J8SlpkwcrQCMKs,102
3
+ dora/__init__.pyi,sha256=-Kcqo8fkO-iF9dL7YtOSUOPtLOtDoXPNLR6j0yvjkJ4,8425
4
+ dora/__init__.py,sha256=ahNFD4VpQ0OBOKmgfqz9ZFUvmroLHDVwYzpz2se9a0g,723
5
+ dora/dora.abi3.so,sha256=zaGQZ77p7jfcS7qO99ne91HAbaTHV3K5kmAPlrNFRFI,20351584
6
+ dora_rs-0.3.4rc2.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- dora_rs-0.3.3rc1.dist-info/METADATA,sha256=RrLR1VlWShFYy9iWcOEqLXMa9piAitI5mpLIsw1EC2w,452
2
- dora_rs-0.3.3rc1.dist-info/WHEEL,sha256=mr5kArZT1sHmSyQKqoXcetQKMw5B1J8SlpkwcrQCMKs,102
3
- dora/__init__.py,sha256=j8M_oCPB_QpEAScXzUY9XJ_hzc-kh82vJKT1mAbjD2w,518
4
- dora/dora.abi3.so,sha256=wi9st_WMSMmUgpB5qyErNvR2IbhXpLnIxBMCxssDE_c,18871321
5
- dora_rs-0.3.3rc1.dist-info/RECORD,,