Skip to main content

Adelpha

Python library for Adelpha MRI: connect sensors, run control handlers, and call Engineering Studio design functions.

pip install adelpha
from adelpha import telemetry, feedback

Adelpha is the WebSocket server. Your Raspberry Pi, or a Python process that talks to an Arduino, is the client. Arduino never opens a serial session to Adelpha.

Telemetry (sensors)

import asyncio
import os

from adelpha import telemetry

client = telemetry.connect(
    os.environ["ADELPHA_URL"],
    os.environ["ADELPHA_DEVICE_ID"],
    os.environ["ADELPHA_DEVICE_TOKEN"],
)


async def acquire(device):
    while True:
        await telemetry.publish(
            device,
            temperature=[
                {
                    "sensor_id": 1,
                    "value": 28.4,
                    "unit": "degC",
                    "role": "magnet",
                    "quality": "valid",
                }
            ],
        )
        await asyncio.sleep(1)


asyncio.run(client.run(acquire))

ADELPHA_URL is ws://<host>:8765/ws/<device_id>. Put the token in the environment, never in the URL. Missing sensors use value: null with quality missing or invalid, never zero.

Feedback (control)

from adelpha import feedback, telemetry

client = telemetry.DeviceClient(
    os.environ["ADELPHA_URL"],
    os.environ["ADELPHA_DEVICE_ID"],
    os.environ["ADELPHA_DEVICE_TOKEN"],
    journal_path="./commands.sqlite3",
)


@feedback.register(
    client,
    "cooling-01",
    "set_enabled",
    argument_schema={
        "type": "object",
        "properties": {"enabled": {"type": "boolean"}},
        "required": ["enabled"],
        "additionalProperties": False,
    },
)
async def cooling(enabled):
    return {"enabled": enabled}

Adelpha rejects actuator commands until a hardware scanner profile is selected, allow_control is true in devices.json, and Settings → Devices → Physical control is on. Device-local interlocks remain authoritative.

Other modules

Import Purpose
adelpha.twin Digital-twin estimators, state, bootstrap()
adelpha.magnet Halbach array geometry (design, export_cad)
adelpha.coil Gradient-coil request builders (pyCoilGen to run)
adelpha.rfcoil Solenoid RF coil request builders
adelpha.shim Passive shim request builders
adelpha.fem STEP magnetostatics (Gmsh + Elmer to run)
adelpha.domain Measurements, units, scanner identity
adelpha.scanners Simulated and hardware adapters
adelpha.config Profile loading
adelpha.acquisition Sensor readers
adelpha.simulation Virtual plant models
adelpha.agents Agent specialists (pip install adelpha[agents])
adelpha.tools Agent tool registry
adelpha.api Twin HTTP create_app (pip install adelpha[twin])

Optional extras: adelpha[twin], adelpha[agents], adelpha[pinn].

The imaging console is not part of this package.

Publish (maintainers)

From the repository root, after tests pass:

uv build
uv publish

Or python -m build and twine upload dist/*.

Metadata

Release files for adelpha 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adelpha 0.1.0
File Size Uploaded Provenance
adelpha-0.1.0.tar.gz 487.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for adelpha 0.1.0
File Interpreter ABI Platform
adelpha-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / adelpha-0.1.0.tar.gz

Download URL adelpha-0.1.0.tar.gz
Size 487.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7d2d6d2a809c8e7c8b49b4231ce7ed864d62edd840dce9403aa36b60afa153bd
BLAKE2b-256 checksum
How to use checksums
a523aa08e082675f9bf90f2c0227202aeb085ce6ffcecf7a12c59f2b272b24d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / adelpha-0.1.0-py3-none-any.whl

Download URL adelpha-0.1.0-py3-none-any.whl
Size 576.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8cf2076c5f55f02f281bfcb8c02fa87fdd991b58e28cdb45f377b748ca01116
BLAKE2b-256 checksum
How to use checksums
15426e82b9b8245253f3c24d38bf392489b83a46d7e6970e3b844f01e13772a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for adelpha 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page