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.5.7

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.5.7
File Size Uploaded Provenance
adelpha-0.5.7.tar.gz 487.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / adelpha-0.5.7.tar.gz

Download URL adelpha-0.5.7.tar.gz
Size 487.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7de8254a203586bc2cefe8212ee3fb26c4e2ab4ed8e0d9ffe74f9a8c69b4aec8
BLAKE2b-256 checksum
How to use checksums
5c342bcddc1e32313248488a93aee9f790e52e3bc2f3f014100631339e1facd7
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.5.7-py3-none-any.whl

Download URL adelpha-0.5.7-py3-none-any.whl
Size 576.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
664718198f7104752a2fa7521bf531c83a279ab0115a30a02789b7120d15cfa9
BLAKE2b-256 checksum
How to use checksums
2b245c2bd2a6ab7a17caa9df349a3835f9d6e53d84636bf8dac85000e096f416
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.5.7

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.5.7 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