Repository navigation
feat: Register child devices as top level devices - #1739
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1739 +/- ##
==========================================
+ Coverage 96.46% 96.47% +0.01%
==========================================
Files 49 49
Lines 3787 3804 +17
==========================================
+ Hits 3653 3670 +17
Misses 134 134 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Alexj9837
force-pushed
the
register-child-devices-on-top
branch
from
November 3, 2026 08:35
b4975f8 to
e7797e3
Compare
Alexj9837
force-pushed
the
register-child-devices-on-top
branch
from
November 3, 2026 08:36
e7797e3 to
396a673
Compare
Alexj9837
force-pushed
the
register-child-devices-on-top
branch
from
November 3, 2026 09:10
9fd0086 to
8ee7db7
Compare
tpoliaw
reviewed
Nov 4, 2026
tpoliaw
left a comment
Contributor
There was a problem hiding this comment.
Mostly looks ok, I'm mainly unsure of the required behaviour around handling duplicates.
… on feedback from Peter Drop the identity replacement test as other tests already cover it
tpoliaw
reviewed
Nov 9, 2026
tpoliaw
approved these changes
Nov 9, 2026
ZohebShaikh
pushed a commit
that referenced
this pull request
Nov 9, 2026
Closes #1724 Registering an ophyd-async device now also registers its children, including signals, under their own names at any depth (`stage` also gives `stage-x`, `stage-x-velocity` etc). Dotted access still works. Ophyd v1 devices are left alone. Name clashes: - The first device registered under a name keeps it. Any later device with the same name, top level or child, is not registered and neither are its children. The first clash logs a single warning, and each clash is logged at debug - This includes a motor's `user_readback`, which ophyd-async gives the motor's name. It's still reachable as `motor.user_readback` - Top level devices used to replace an existing device with the same name, now the first one is kept - `/devices` reports each device under its registered name, so a motor registered with an override name doesn't appear twice alongside its readback Things to note: - `/devices` and the plan schemas get a lot bigger (adsim goes from 2 to 117 devices), and low level signals like setpoints now show up as plan argument options.
ZohebShaikh
pushed a commit
to ZohebShaikh/blueapi
that referenced
this pull request
Nov 11, 2026
This PR follows DiamondLightSource#1739. Devices in `BlueskyContext` are now wrapped in a `BlueapiDevice` dataclass. This is similar to DiamondLightSource#1743. Summary of changes: - `BlueskyContext.devices` was `dict[str, Device]` where Device represented bluesky protocols. Now `BlueskyContext.devices` is a `dict[str, BlueapiDevice]` - `DeviceModel` and the REST side are unchanged - `ctx.devices` is a dictionary of `BlueapiDevice` wrappers - `find_device` will look up the first part of the address (`stage` in `stage.x`) in `ctx.devices` and returns a `Device` - `find_component` is no longer a standalone function but has been moved to `BlueapiDevice`. This functions follows from `find_device`, e.g. finds the `x` on `stage` to give `stage.x` --------- Co-authored-by: Peter Holloway <peter.holloway@diamond.ac.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1724
Registering an ophyd-async device now also registers its children, including signals, under their own names at any depth (
stagealso givesstage-x,stage-x-velocityetc). Dotted access still works. Ophyd v1 devices are left alone.Name clashes:
user_readback, which ophyd-async gives the motor's name. It's still reachable asmotor.user_readback/devicesreports each device under its registered name, so a motor registered with an override name doesn't appear twice alongside its readbackThings to note:
/devicesand the plan schemas get a lot bigger (adsim goes from 2 to 117 devices), and low level signals like setpoints now show up as plan argument options.