Resonance is a Python package for the ALS-RSOXS Beamline Control System. It provides a high-level API for motor control, analog inputs, NEXAFS scans, and an MCP server for beamline access.
Requires uv and Python 3.13+.
uv sync --all-groupsTo include the optional BCS group (beamline control dependencies):
uv sync --all-groups --group bcsRun the MCP beamline server:
uv run mcp-beamlineOr after installing:
mcp-beamlineUse the API from Python:
from resonance.api import RsoxsServer, nexafs_scan
from resonance.api.types import AI, Motormake install
make verify
make testmake verifyruns lint, format-check, and type-check.make fixauto-fixes Ruff lint and format.make test-covruns tests with coverage.
Install pre-commit hooks (prek or pre-commit):
pre-commit installSee CHANGELOG.md for release history. Architecture decisions are in docs/adr/.
- Read AIs
- Read motor positions
- Move motor positions
- Motor scan scheduling
- Build default NEXAFS scans
- Get feedback logic
- Build auto alignment
- Install BLS API into venv to avoid sys.path.append
- Type motors and AIs
- Formatting and type hinting (Ruff, ty)