DiamondLightSource / DiamondLightSource/fastcs

[ophyd-async] Embedded FastCS connector (fastcs-embed extra)

Open
#399 1 comment 0 reactions 0 assignees View on GitHub
api-convergence
Dominant language
Python
Stars
6
Forks
8
Avg merge
2d 12h
Merged PRs (30d)
3

Description

## Scope
- `ophyd_async.fastcs` `embedded_fastcs_connector(controller)` behind an `ophyd-async[fastcs-embed]` extra. `create_children_from_annotations` via `DeviceFiller` + `FastCSSignalBackend`/`FastCSCommandBackend` factories, `filled=False`.
- `connect_real`: start the `ControllerRunner` (#395), walk the `ControllerAPI` tree, fill children, `check_filled`, `set_name`; idempotent across reconnects. `connect_mock` never touches the controller.
- Backend mappings per ADR 0019 table (get/set/callback/setpoint/datakey/command).
- **Enums:** un-hinted → introspect at runtime, drop to string datatype retaining choices as metadata; hinted → require duplication (`StrictEnum`/`Subset`/`Superset`) for now, revisit (0019 L149).
- **Table converter IS in scope for the first cut** — use it to bring FastCS and ophyd-async `Table` implementations closer (0019 L153).
- FastCS gains `ConnectionFailedError` (raised when the device doesn't respond) → connector converts to `NotConnectedError` and retries in background; all other errors surfaced unconverted (0019 L163).

## ⚠️ Investigate (needs @shihab-dls)
0019 L159: is `@scan` just driving updates into `Attr`s (→ `Signal`s), or is there more to map? Resolve before finalising the backend surface.

## Acceptance
`uv run --locked tox -e pre-commit,type-checking,tests` green (this work lands in the ophyd-async repo / a coordination branch — see #388 §4; scope here is the FastCS-side stable interface + any FastCS additions).

ADR: 0019
Parent: #388
Blocked by: #392, #395, #413

## get_datakey source — folded in from review
`get_datakey` now reads metadata from `attr.meta` (units/precision/limits) + python-type/enum choices, not from a removed `DataType` object.

Contributor guide

Open the contributing guide

Research direction

Start with ADR 0019 and the existing `ophyd_async.fastcs` connector and `ControllerAPI` interfaces, then review the dependencies in issues #392, #395, and #413. Resolve the `@scan` mapping question with @shihab-dls before finalising the backend surface. Done means the FastCS-side interface and additions satisfy the stated acceptance command and support the listed real/mock connection, backend, enum, table, and error behaviours.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.