scirodev 0.3.1__tar.gz → 0.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scirodev
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: PeakHub / sciro extensions to Pybricks: typed API stubs (sciro.*) and hub tooling on top of pybricksdev
5
5
  Author: Thomas Schank
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scirodev"
7
- version = "0.3.1"
7
+ version = "0.4.0"
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"
@@ -4,6 +4,7 @@ class lives now). Kept so older programs keep type-checking.
4
4
 
5
5
  from .pump import ( # noqa: F401 (re-exports)
6
6
  IMU as IMU,
7
+ Gyro as Gyro,
7
8
  ColorSensor as ColorSensor,
8
9
  FloorPro as FloorPro,
9
10
  IRCalib as IRCalib,
@@ -153,24 +153,24 @@ class ColorSensor(_Stream):
153
153
  """set_integration(atime) -- TCS3400 ATIME register 0 .. 255: (256 - atime) * 2.78 ms."""
154
154
 
155
155
 
156
- class IMU(_Stream):
157
- """BNO086 IMU on an extension port of a PUMP device: roll, pitch, yaw in degrees.
156
+ class Gyro(_Stream):
157
+ """Gyro (BNO086) on an extension port of a PUMP device: roll, pitch, yaw in degrees.
158
158
 
159
- ``IMU(port, ext_port)`` opens it directly; :meth:`FloorPro.imu` returns the
160
- same class. The heading offset lives on the hub: :meth:`reset_heading` makes
161
- the current yaw read as the given angle.
159
+ ``Gyro(port, ext_port)`` opens it directly; :meth:`FloorPro.gyro` returns the
160
+ same class (``IMU`` is an alias). The heading offset lives on the hub:
161
+ :meth:`reset_heading` makes the current yaw read as the given angle.
162
162
  """
163
163
 
164
164
  ext_port: int
165
165
 
166
166
  def __init__(self, port: Union[_Port, PUMPDevice], ext_port: int = 2):
167
- """IMU(port, ext_port=ExtPort.EXT2)
167
+ """Gyro(port, ext_port=ExtPort.EXT2)
168
168
 
169
169
  Arguments:
170
- port (Port): Hub port of the PUMP device carrying the IMU (or the
170
+ port (Port): Hub port of the PUMP device carrying the gyro (or the
171
171
  opened ``PUMPDevice`` itself).
172
- ext_port (ExtPort): Extension port the IMU is plugged into. Raises
173
- ``OSError`` if there is no IMU there.
172
+ ext_port (ExtPort): Extension port the gyro is plugged into. Raises
173
+ ``OSError`` if there is no gyro there.
174
174
  """
175
175
 
176
176
  def read(self) -> MaybeAwaitableEuler:
@@ -183,6 +183,10 @@ class IMU(_Stream):
183
183
  """reset_heading(angle=0) -- make the current heading read as ``angle``."""
184
184
 
185
185
 
186
+ IMU = Gyro
187
+ """Alias of :class:`Gyro`."""
188
+
189
+
186
190
  class FloorPro:
187
191
  """LP-FloorPro connected to a PeakHub port, speaking PUMP."""
188
192
 
@@ -210,8 +214,11 @@ class FloorPro:
210
214
  The TCS3400 on extension port 1 or 2; raises ``OSError`` if none.
211
215
  """
212
216
 
213
- def imu(self, ext_port: int = 2) -> IMU:
214
- """imu(ext_port=2) -> IMU -- the BNO086 on extension port 1 or 2; raises ``OSError`` if none."""
217
+ def gyro(self, ext_port: int = 2) -> Gyro:
218
+ """gyro(ext_port=2) -> Gyro -- the gyro on extension port 1 or 2; raises ``OSError`` if none."""
219
+
220
+ def imu(self, ext_port: int = 2) -> Gyro:
221
+ """imu(ext_port=2) -> Gyro -- alias of :meth:`gyro`."""
215
222
 
216
223
  def streams(self) -> Tuple[StreamInfo, ...]:
217
224
  """streams() -> Tuple -- the enumerated streams ``(id, url, ext_port, state_len)``."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scirodev
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: PeakHub / sciro extensions to Pybricks: typed API stubs (sciro.*) and hub tooling on top of pybricksdev
5
5
  Author: Thomas Schank
6
6
  License: MIT
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