muse-driver-framework
Shared pure-Python runtime framework for AMX MUSE Script-as-Device programs.
The package contains the transport-independent pieces shared by the Precis Driver and Meter Validation programs:
- asynchronous TCP connection lifecycle and reconnect handling;
- descriptor control registry and control type inference;
- bounded, latest-only
MeterStreamframe delivery; - bounded, latest-only
XYSeriesStreamdelivery for complete[x, y]frames.
XYSeriesStream accepts a variable-length array of finite pairs, including an
empty array. Each frame is atomic and only the newest complete frame is kept,
so a slow chart cannot create a backlog or mix points from different frames.
It has no third-party runtime dependencies and supports the Python 3.10 runtime used by current MUSE firmware.
Runtime use in MUSE
Each Script-as-Device program declares the exact framework version in its own
requirements.txt:
muse-driver-framework==1.1.2
The program imports the package, never a copied local driver_framework.py:
from muse_driver_framework import AsyncTcpDeviceClient, AsyncTcpDeviceManager
MUSE must have internet access when it installs the requirements file. Keep the version exact so a framework release cannot silently change an existing driver.
Local verification
Build and install the wheel into an isolated environment before testing a driver. The driver directories should not contain a local framework copy.
To test unpublished source changes, run python3 -m unittest discover -s tests -v
here, or the parent project's local-validation/test-source.sh. The latter
uses PYTHONPATH for source testing only; MUSE still installs the pinned public
version, not these local edits. Tests and builds do not publish or deploy code.
Numeric commands and configuration timers reject nonfinite values before
clamping or scheduling. Realtime Meter/XY-series descriptors are read-only and
cannot declare both delivery types on one parameter. Driver entry points
should call manager.stop() from their normal stop/exit cleanup.
Performance and ownership
The control registry compiles path, protocol-channel and feedback-route indexes once at construction. Treat the descriptor and registered controls as a startup snapshot; create a new registry after changing their mapping. Lookup results do not expose mutable internal sets or path lists.
Continuous commands are also coalesced by device/key before crossing into the
TCP event loop, so a burst does not create one scheduled task per intermediate
value. Pending keys per device are bounded by command_queue_size; stopping
discards them. FIFO commands are not coalesced, and new continuous keys retain
their scheduling positions relative to FIFO requests.
Meter and XY-series caches own their accepted frames. snapshot() and
take_frame() capture a complete frame under the producer lock, then copy it
outside the lock; callers still receive independent mutable arrays. This reduces
producer contention without removing validation or changing the wire format.
run(publish) includes copying and synchronous/asynchronous publishing time in
the rate-limit period, rather than sleeping an extra full period after publishing.
Slow callbacks still reduce achieved throughput. Missed periods are not replayed,
and idle streams wait instead of spinning. These are limits, not a promise that
every configuration or MUSE host sustains the declared rate.
The parent project's local-validation/benchmark-driver.py measures source CPU
costs; local-validation/stress-driver.py tests 50 loopback TCP processors and
multiple complete telemetry streams with a mock SDK. Neither tests actual MUSE
SDK transport or physical devices. Unpublished source changes require a new
framework release and updated pinned driver requirements before deployment.
Metadata
Release files for muse-driver-framework 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| muse_driver_framework-1.1.2.tar.gz | 27.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| muse_driver_framework-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.8 kB
Release files / muse_driver_framework-1.1.2.tar.gz
| Download URL | muse_driver_framework-1.1.2.tar.gz |
|---|---|
| Size | 27.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5810cae7afceb8c6bcd8894a41ade3ed593e6358c8681fed47ab9c95dfe9ec8
|
|
BLAKE2b-256 checksum How to use checksums |
90c789e4b7b1609b68a4491735ca1eaac056ca0e73318e1ce3d879b17833148d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / muse_driver_framework-1.1.2-py3-none-any.whl
| Download URL | muse_driver_framework-1.1.2-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
163e8afc07865438d117bcf929cf6c874b1277296bcdc78cd6f6555959e3e1aa
|
|
BLAKE2b-256 checksum How to use checksums |
347c31226afd9c8006bddf259279cf3e23e4446809613ec8048c2b5ca0d95818
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|