dora-rs 0.3.3rc1__cp37-abi3-win32.whl → 0.3.4__cp37-abi3-win32.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,320 @@
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 dataflow_id(self) -> str:
43
+ """Returns the dataflow id."""
44
+
45
+ def merge_external_events(self, subscription: dora.Ros2Subscription) -> None:
46
+ """Merge an external event stream with dora main loop.
47
+ This currently only work with ROS2."""
48
+
49
+ def next(self, timeout: float=None) -> dora.PyEvent:
50
+ """`.next()` gives you the next input that the node has received.
51
+ It blocks until the next event becomes available.
52
+ You can use timeout in seconds to return if no input is available.
53
+ It will return `None` when all senders has been dropped.
54
+
55
+ ```python
56
+ event = node.next()
57
+ ```
58
+
59
+ You can also iterate over the event stream with a loop
60
+
61
+ ```python
62
+ for event in node:
63
+ match event["type"]:
64
+ case "INPUT":
65
+ match event["id"]:
66
+ case "image":
67
+ ```"""
68
+
69
+ def send_output(self, output_id: str, data: pyarrow.Array, metadata: dict=None) -> None:
70
+ """`send_output` send data from the node.
71
+
72
+ ```python
73
+ Args:
74
+ output_id: str,
75
+ data: pyarrow.Array,
76
+ metadata: Option[Dict],
77
+ ```
78
+
79
+ ex:
80
+
81
+ ```python
82
+ node.send_output("string", b"string", {"open_telemetry_context": "7632e76"})
83
+ ```"""
84
+
85
+ def __iter__(self) -> typing.Any:
86
+ """Implement iter(self)."""
87
+
88
+ def __next__(self) -> typing.Any:
89
+ """Implement next(self)."""
90
+
91
+ @typing.final
92
+ class PyEvent:
93
+ """Dora Event"""
94
+
95
+ def inner(self):...
96
+
97
+ def __getitem__(self, key: typing.Any) -> typing.Any:
98
+ """Return self[key]."""
99
+
100
+ @typing.final
101
+ class Ros2Context:
102
+ """ROS2 Context holding all messages definition for receiving and sending messages to ROS2.
103
+
104
+ By default, Ros2Context will use env `AMENT_PREFIX_PATH` to search for message definition.
105
+
106
+ AMENT_PREFIX_PATH folder structure should be the following:
107
+
108
+ - For messages: <namespace>/msg/<name>.msg
109
+ - For services: <namespace>/srv/<name>.srv
110
+
111
+ You can also use `ros_paths` if you don't want to use env variable.
112
+
113
+ warning::
114
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
115
+ at any point without it being considered a breaking change.
116
+
117
+ ```python
118
+ context = Ros2Context()
119
+ ```"""
120
+
121
+ def __init__(self, ros_paths: typing.List[str]=None) -> None:
122
+ """ROS2 Context holding all messages definition for receiving and sending messages to ROS2.
123
+
124
+ By default, Ros2Context will use env `AMENT_PREFIX_PATH` to search for message definition.
125
+
126
+ AMENT_PREFIX_PATH folder structure should be the following:
127
+
128
+ - For messages: <namespace>/msg/<name>.msg
129
+ - For services: <namespace>/srv/<name>.srv
130
+
131
+ You can also use `ros_paths` if you don't want to use env variable.
132
+
133
+ warning::
134
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
135
+ at any point without it being considered a breaking change.
136
+
137
+ ```python
138
+ context = Ros2Context()
139
+ ```"""
140
+
141
+ def new_node(self, name: str, namespace: str, options: dora.Ros2NodeOptions) -> dora.Ros2Node:
142
+ """Create a new ROS2 node
143
+
144
+ ```python
145
+ ros2_node = ros2_context.new_node(
146
+ "turtle_teleop",
147
+ "/ros2_demo",
148
+ Ros2NodeOptions(rosout=True),
149
+ )
150
+ ```
151
+
152
+ warning::
153
+ dora Ros2 bridge functionality is considered **unstable**. It may be changed
154
+ at any point without it being considered a breaking change."""
155
+
156
+ @typing.final
157
+ class Ros2Durability:
158
+ """DDS 2.2.3.4 DURABILITY"""
159
+
160
+ def __eq__(self, value: typing.Any) -> bool:
161
+ """Return self==value."""
162
+
163
+ def __ge__(self, value: typing.Any) -> bool:
164
+ """Return self>=value."""
165
+
166
+ def __gt__(self, value: typing.Any) -> bool:
167
+ """Return self>value."""
168
+
169
+ def __int__(self) -> None:
170
+ """int(self)"""
171
+
172
+ def __le__(self, value: typing.Any) -> bool:
173
+ """Return self<=value."""
174
+
175
+ def __lt__(self, value: typing.Any) -> bool:
176
+ """Return self<value."""
177
+
178
+ def __ne__(self, value: typing.Any) -> bool:
179
+ """Return self!=value."""
180
+
181
+ def __repr__(self) -> str:
182
+ """Return repr(self)."""
183
+ Persistent: Ros2Durability = ...
184
+ Transient: Ros2Durability = ...
185
+ TransientLocal: Ros2Durability = ...
186
+ Volatile: Ros2Durability = ...
187
+
188
+ @typing.final
189
+ class Ros2Liveliness:
190
+ """DDS 2.2.3.11 LIVELINESS"""
191
+
192
+ def __eq__(self, value: typing.Any) -> bool:
193
+ """Return self==value."""
194
+
195
+ def __ge__(self, value: typing.Any) -> bool:
196
+ """Return self>=value."""
197
+
198
+ def __gt__(self, value: typing.Any) -> bool:
199
+ """Return self>value."""
200
+
201
+ def __int__(self) -> None:
202
+ """int(self)"""
203
+
204
+ def __le__(self, value: typing.Any) -> bool:
205
+ """Return self<=value."""
206
+
207
+ def __lt__(self, value: typing.Any) -> bool:
208
+ """Return self<value."""
209
+
210
+ def __ne__(self, value: typing.Any) -> bool:
211
+ """Return self!=value."""
212
+
213
+ def __repr__(self) -> str:
214
+ """Return repr(self)."""
215
+ Automatic: Ros2Liveliness = ...
216
+ ManualByParticipant: Ros2Liveliness = ...
217
+ ManualByTopic: Ros2Liveliness = ...
218
+
219
+ @typing.final
220
+ class Ros2Node:
221
+ """ROS2 Node
222
+
223
+ warnings::
224
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
225
+ at any point without it being considered a breaking change.
226
+ - There's a known issue about ROS2 nodes not being discoverable by ROS2
227
+ See: https://github.com/jhelovuo/ros2-client/issues/4"""
228
+
229
+ def create_publisher(self, topic: dora.Ros2Topic, qos: dora.Ros2QosPolicies=None) -> dora.Ros2Publisher:
230
+ """Create a ROS2 publisher
231
+
232
+ ```python
233
+ pose_publisher = ros2_node.create_publisher(turtle_pose_topic)
234
+ ```
235
+ warnings:
236
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
237
+ at any point without it being considered a breaking change."""
238
+
239
+ def create_subscription(self, topic: dora.Ros2Topic, qos: dora.Ros2QosPolicies=None) -> dora.Ros2Subscription:
240
+ """Create a ROS2 subscription
241
+
242
+ ```python
243
+ pose_reader = ros2_node.create_subscription(turtle_pose_topic)
244
+ ```
245
+
246
+ warnings:
247
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
248
+ at any point without it being considered a breaking change."""
249
+
250
+ def create_topic(self, name: str, message_type: str, qos: dora.Ros2QosPolicies) -> dora.Ros2Topic:
251
+ """Create a ROS2 topic to connect to.
252
+
253
+ ```python
254
+ turtle_twist_topic = ros2_node.create_topic(
255
+ "/turtle1/cmd_vel", "geometry_msgs/Twist", topic_qos
256
+ )
257
+ ```"""
258
+
259
+ @typing.final
260
+ class Ros2NodeOptions:
261
+ """ROS2 Node Options"""
262
+
263
+ def __init__(self, rosout: bool=None) -> None:
264
+ """ROS2 Node Options"""
265
+
266
+ @typing.final
267
+ class Ros2Publisher:
268
+ """ROS2 Publisher
269
+
270
+ warnings:
271
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
272
+ at any point without it being considered a breaking change."""
273
+
274
+ def publish(self, data: pyarrow.Array) -> None:
275
+ """Publish a message into ROS2 topic.
276
+
277
+ Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure.
278
+
279
+ ex:
280
+ ```python
281
+ gripper_command.publish(
282
+ pa.array(
283
+ [
284
+ {
285
+ "name": "gripper",
286
+ "cmd": np.float32(5),
287
+ }
288
+ ]
289
+ ),
290
+ )
291
+ ```"""
292
+
293
+ @typing.final
294
+ class Ros2QosPolicies:
295
+ """ROS2 QoS Policy"""
296
+
297
+ 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:
298
+ """ROS2 QoS Policy"""
299
+
300
+ @typing.final
301
+ class Ros2Subscription:
302
+ """ROS2 Subscription
303
+
304
+
305
+ warnings:
306
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
307
+ at any point without it being considered a breaking change."""
308
+
309
+ def next(self):...
310
+
311
+ @typing.final
312
+ class Ros2Topic:
313
+ """ROS2 Topic
314
+
315
+ warnings:
316
+ - dora Ros2 bridge functionality is considered **unstable**. It may be changed
317
+ at any point without it being considered a breaking change."""
318
+
319
+ def start_runtime() -> None:
320
+ """Start a runtime for Operators"""
dora/dora.pyd 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.4
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
@@ -18,4 +18,13 @@ source .env/bin/activate
18
18
  pip install maturin
19
19
  maturin develop
20
20
  ```
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
+ ```
21
30
 
@@ -0,0 +1,6 @@
1
+ dora_rs-0.3.4.dist-info/METADATA,sha256=zjME3nBQgyySoIHcxBxp-M-puaqK2XU-9WeOjB_OPHg,608
2
+ dora_rs-0.3.4.dist-info/WHEEL,sha256=6OJYZIM2Dk4eAjI82h1dKfIeHAb4_0-YRQodIDqhP8I,90
3
+ dora/__init__.py,sha256=H5A6xt4pNoc1rDSn42hZFXXv3-hNZ1aCpP92Djwh0F0,765
4
+ dora/__init__.pyi,sha256=zv7C-UQFG_MXiGndQSLFSZc7YIeTGRhuEpHJtiXEX28,8818
5
+ dora/dora.pyd,sha256=HBR-5eUUIDkybw2zr0XrruIAOFrAhq3UAmMTsTJz5Z4,13421056
6
+ dora_rs-0.3.4.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- dora_rs-0.3.3rc1.dist-info/METADATA,sha256=SEOtmjYDSMC8BnrBuvxkMAW3yow-JgTMjKrEKtOqgws,464
2
- dora_rs-0.3.3rc1.dist-info/WHEEL,sha256=6OJYZIM2Dk4eAjI82h1dKfIeHAb4_0-YRQodIDqhP8I,90
3
- dora/__init__.py,sha256=9ZRoq90yBGe2zy7pwOGeQ39qwzSQPtTbY-udIcqB4Eo,550
4
- dora/dora.pyd,sha256=Prh1-Vj-El2mJRxt3K8Algfd_uIo0Z9IowugDlOJAGg,13326336
5
- dora_rs-0.3.3rc1.dist-info/RECORD,,