Skip to content

Commit a42d0cf

Browse files
committed
formatting
1 parent 02c1c52 commit a42d0cf

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/pycyphal2/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
66
Supports various transports such as Ethernet (UDP) and CAN FD with optional redundancy.
77
8-
## Installation
8+
# Installation
99
1010
Optional features inside the brackets can be removed if not needed; see `pyproject.toml` for the full list:
1111
1212
```
1313
pip install 'pycyphal2[udp,pythoncan]'
1414
```
1515
16-
## Usage
16+
# Usage
1717
1818
Set up a transport, make a node, publish and subscribe:
1919
@@ -48,7 +48,7 @@ async def main():
4848
4949
There exist 4 kinds of topic names in Cyphal, used effectively they allow the developer to split up complex systems into smaller sub-systems, simplifying development and debugging.
5050
51-
#### 1. Relative Name
51+
### Relative Name
5252
5353
A relative name is a name that does not start with '/' or `~/`.
5454
@@ -77,7 +77,7 @@ async def main():
7777
| `speed` | `motor_3` | `robot` | `motor_3/speed` |
7878
| `speed` | `motor_4` | `robot` | `motor_4/speed` |
7979
80-
#### 2. Absolute Name
80+
### Absolute Name
8181
8282
An absolute name starts with `/`.
8383
@@ -103,7 +103,7 @@ async def main():
103103
| `/log` | `cpu` | `robot` | `/log` |
104104
| `/battery_voltage` | `battery_1` | `robot` | `/battery_voltage` |
105105
106-
#### 3. Homeful Name
106+
### Homeful Name
107107
108108
A homeful name starts with `~` of `~/`.
109109
@@ -123,7 +123,7 @@ async def main():
123123
124124
Example: We want to configure an antenna to transmit at a specific frequency. The antenna node has a `~/config/frequency` topic that we can publish to.
125125
126-
#### 4. Pattern Name
126+
### Pattern Name
127127
128128
A pattern name contains wildcard `*` (matches any _single_ name segment)
129129
@@ -143,7 +143,7 @@ async def main():
143143
Example: `*/battery_pct` to subscribe to all nodes publishing battery data, of which there may be multiple per vehicle.
144144
'logs/>' to subscribe to all topics publishing under '/logs' which may contain 'log_info', 'log_warning', 'log_error' topics.
145145
146-
#### Extra functions
146+
### Extra functions
147147
148148
*Topping* is the process by which a unique subject ID is assigned upon initialization.
149149
For some applications that require a high level of reliability, determinism is required and can be achieved by using `#` to pin a topic to a specific subject ID.
@@ -186,7 +186,7 @@ async def main():
186186
187187
See also :meth:`Node.remap`.
188188
189-
### Publish
189+
## Publish
190190
191191
Publication is best-effort by default. Pass `reliable=True` when publishing to retry delivery until
192192
acknowledged by every known subscriber or until the deadline; if the remote side does not acknowledge in time,
@@ -197,7 +197,7 @@ async def main():
197197
await pub(Instant.now() + 1.0, b"payload", reliable=True)
198198
```
199199
200-
### Subscribe
200+
## Subscribe
201201
202202
Subscriptions normally yield messages as soon as they arrive. Set `reordering_window` [seconds] on
203203
:meth:`Node.subscribe` to allow delaying out-of-order messages to reconstruct the original publication order.
@@ -219,7 +219,7 @@ async def main():
219219
print(topic.name, captures) # [('engine', 1)], where 1 is the pattern segment index
220220
```
221221
222-
### RPC & streaming
222+
## RPC & streaming
223223
224224
RPC is layered directly on top of pub/sub. Use :meth:`Publisher.request` to publish a message that expects
225225
responses, and use :attr:`Arrival.breadcrumb` on the subscriber side to send a unicast reply back to the requester.
@@ -239,7 +239,7 @@ async def main():
239239
await arrival.breadcrumb(Instant.now() + 1.0, b"chunk-2", reliable=True)
240240
```
241241
242-
### Topic pinning
242+
## Topic pinning
243243
244244
Topics may be pinned to a specific subject-ID using `name#1234` to bypass automatic assignment.
245245
This is useful for applications where a high degree of determinism is required and for Cyphal/CAN v1.0 interoperability.
@@ -255,7 +255,7 @@ async def main():
255255
Old Cyphal/CAN v1.0 nodes do not participate in the topic discovery protocol,
256256
so topics joined only by such nodes are not discoverable by pattern subscribers.
257257
258-
## Remarks
258+
# Remarks
259259
260260
Cyphal does not define a serialization format. Previous versions used to define the DSDL format but it has been
261261
extracted into an independent project, and Cyphal was made serialization-agnostic in v1.1+.

0 commit comments

Comments
 (0)