Note

Ophyd async is included on a provisional basis until the v1.0 release and may change API on minor release numbers before then

ophyd_async.core.DeviceCollector#

class ophyd_async.core.DeviceCollector(set_name=True, connect=True, mock=False, timeout: float = 10.0)[source]#

Bases: object

Collector of top level Device instances to be used as a context manager

Parameters:
  • set_name – If True, call device.set_name(variable_name) on all collected Devices

  • connect – If True, call device.connect(mock) in parallel on all collected Devices

  • mock – If True, connect Signals in simulation mode

  • timeout – How long to wait for connect before logging an exception

Notes

Example usage:

[async] with DeviceCollector():
    t1x = motor.Motor("BLxxI-MO-TABLE-01:X")
    t1y = motor.Motor("pva://BLxxI-MO-TABLE-01:Y")
    # Names and connects devices here
assert t1x.comm.velocity.source
assert t1x.name == "t1x"

Methods