Open rosesyrett opened 1 year ago
@olliesilvester could you mention your use case for this here?
For adding a load/save to devices (https://github.com/bluesky/ophyd-epics-devices/issues/28#event-9812353107), we need to walk through the device and find all of its SignalRW
's, including those within sub-devices. It makes sense to use get_device_children()
for this, however the Panda device has its SignalRW
's within device_vectors
so this currently doesn't work
Ok, sure. This change will mean that instead of using get_device_children
, each Device
has a children
property that you can iterate through instead. DeviceVector
now has this property also.
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!
Ok, sure. This change will mean that instead of using
get_device_children
, eachDevice
has achildren
property that you can iterate through instead.DeviceVector
now has this property also.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!
Fixes my problem very well, thanks!
consider adding a HasChildren
property to bluesky protocols, analogy to existing HasParent
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
.