scirodev 0.5.5__tar.gz → 0.5.6__tar.gz
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.
- {scirodev-0.5.5/scirodev.egg-info → scirodev-0.5.6}/PKG-INFO +1 -1
- {scirodev-0.5.5 → scirodev-0.5.6}/pyproject.toml +1 -1
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/hubs.py +31 -1
- {scirodev-0.5.5 → scirodev-0.5.6/scirodev.egg-info}/PKG-INFO +1 -1
- {scirodev-0.5.5 → scirodev-0.5.6}/LICENSE +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/README.md +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/__init__.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/_common.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/floorpro.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/iodevices.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/parameters.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/pump.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/py.typed +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/robotics.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/sciro/tools.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev/__init__.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev/cli.py +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev.egg-info/SOURCES.txt +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev.egg-info/dependency_links.txt +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev.egg-info/entry_points.txt +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev.egg-info/requires.txt +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/scirodev.egg-info/top_level.txt +0 -0
- {scirodev-0.5.5 → scirodev-0.5.6}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scirodev"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.6"
|
|
8
8
|
description = "PeakHub / sciro extensions to Pybricks: typed API stubs (sciro.*) and hub tooling on top of pybricksdev"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""sciro.hubs -- the PeakHub.
|
|
2
2
|
|
|
3
3
|
On the hub this module re-exports ``pybricks.hubs`` unchanged; the stub adds what
|
|
4
|
-
the upstream stubs lack: the ``PeakHub`` class
|
|
4
|
+
the upstream stubs lack: the ``PeakHub`` class, its ``display.device()``, and the
|
|
5
|
+
``ThisHub`` alias.
|
|
5
6
|
"""
|
|
6
7
|
|
|
7
8
|
from __future__ import annotations
|
|
@@ -150,3 +151,32 @@ class PeakHub:
|
|
|
150
151
|
broadcast_channel: Channel for broadcasting data (0 .. 255).
|
|
151
152
|
observe_channels: Channels to observe.
|
|
152
153
|
"""
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
#: The hub this program is running on.
|
|
157
|
+
#:
|
|
158
|
+
#: Every Pybricks firmware compiles in exactly one hub class and exports it
|
|
159
|
+
#: under several names: the generic ``ThisHub``, the hub's own name, and any
|
|
160
|
+
#: aliases. On PeakHub firmware ``ThisHub``, :class:`PeakHub`, ``PrimeHub`` and
|
|
161
|
+
#: ``InventorHub`` are therefore all the *same* class object -- this is resolved
|
|
162
|
+
#: when the firmware is built, not by detecting anything at run time.
|
|
163
|
+
#:
|
|
164
|
+
#: Use it for code that should run unchanged on whichever hub is in front of
|
|
165
|
+
#: you, which is mostly bench and test scripts::
|
|
166
|
+
#:
|
|
167
|
+
#: from sciro.hubs import ThisHub
|
|
168
|
+
#:
|
|
169
|
+
#: hub = ThisHub()
|
|
170
|
+
#: print(hub.imu.heading(), hub.imu.tilt())
|
|
171
|
+
#:
|
|
172
|
+
#: Prefer :class:`PeakHub` when a program is specific to this hub anyway: it
|
|
173
|
+
#: says so, and it reads better than a generic name.
|
|
174
|
+
#:
|
|
175
|
+
#: Note the difference between the REPL and a downloaded program. The REPL is
|
|
176
|
+
#: started with everything auto-imported and with a ready-made ``hub`` instance
|
|
177
|
+
#: already created, so there ``hub.imu.heading()`` just works. A downloaded
|
|
178
|
+
#: program gets neither: it must import what it uses and construct the hub, as
|
|
179
|
+
#: above, and ``print(hub)`` there raises ``NameError``. (In the firmware this
|
|
180
|
+
#: is ``pb_package_pybricks_init(true)`` for the REPL versus ``false`` for
|
|
181
|
+
#: everything else.)
|
|
182
|
+
ThisHub = PeakHub
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|