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


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

  • 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


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"