-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add children property to a device #1138
base: main
Are you sure you want to change the base?
Conversation
@olliesilvester could you mention your use case for this here? |
For adding a load/save to devices (bluesky/ophyd-epics-devices#28 (comment)), we need to walk through the device and find all of its |
Ok, sure. This change will mean that instead of using Have a look at the changes in this PR and the tests. Please let me know if this will fix your problem or if you think there's anything missing. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, looks very neat. One minor comment on typing, we can discuss on Tuesday what level of compat we need with v1, which should answer the naming question
Fixes my problem very well, thanks! |
consider adding a |
Co-authored-by: Tom C (DLS) <[email protected]>
It was recently discovered that
get_device_children()
doesn't work for devices that are device_vectors.To fix this issue, this PR removes
get_device_children
,connect_children
andname_children
and instead defines achildren
property on a device which effectively does whatget_device_children
did.This simplifies the code for DeviceVector somewhat, which only needs to define a
children
property and no longer needs to redefineconnect
andname
class methods that it inherits fromDevice
.