Skip to content

Make readable format a runtime setting keyed by Device - #22

Draft
coretl wants to merge 1 commit into
split/Ffrom
split/G1
Draft

coretl wants to merge 1 commit into
split/Ffrom
split/G1

Conversation

@coretl

@coretl coretl commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Third of six stacked draft PRs, based on #21. It adds no detector: it gives StandardReadable the equivalent of Kind in ophyd v1. Next: #23

Supersedes bluesky#1400

Fixes bluesky#1394

What changes

How a child contributes to read(), read_configuration() and hints is now a runtime setting of the child, keyed by the child, rather than something fixed when it is registered (ADR 0023):

  • StandardReadable.set_readable_format(), reset_readable_formats(), get_readable_formats() and get_readable_format_changes().
  • Registering a child again replaces its format instead of adding a second contribution, and the order of hints is the order children were first registered. The private _describe_config_funcs, _read_config_funcs and _has_hints tuples are replaced by hooks on _describe_configuration_funcs, _read_configuration_funcs and _hints_funcs.
  • store_settings() writes the changes of a Device tree under the reserved key <READABLE_FORMATS> and apply_settings() resets the tree to its class formats before applying them. Old settings files have no such key and leave formats alone. Settings gains a readable_formats field, and ReadableEntry, ReadableFormats, walk_readable_formats(), apply_readable_formats() and READABLE_FORMATS_KEY are exported from ophyd_async.core.
  • The deprecated ConfigSignal and HintedSignal aliases are removed, and add_readables() is deprecated in favour of set_readable_format().
  • pyright runs with reportMatchNotExhaustive.
  • A how-to, "How to change what a Device reports at runtime", covers the user-facing side.

Breaking changes

A subclass that added to _describe_config_funcs, _read_config_funcs or _has_hints must add a hook to the new tuple instead. ConfigSignal and HintedSignal are gone from ophyd_async.core: use StandardReadableFormat.CONFIG_SIGNAL, HINTED_SIGNAL or HINTED_UNCACHED_SIGNAL. Both are in the CHANGELOG diff.

How to review

Read ADR 0023 first, then core/_readable.py and core/_settings.py, then the how-to.

Position in the stack

Previous: #21. Next: #23

AI Disclaimer

The code and this description were generated with AI and reviewed/tweaked by the author.

…in settings

Split cut G1 (bluesky#1400) of detector-rederive (d0872e185) on split/F:
StandardReadable's per-device format registry and per-verb hook
registries, set/reset/get_readable_format(s), and storing the format
changes with store_settings/apply_settings, with ADR 0023. The
shadowing hook used only by the detector is left to the detector PR.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant