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.epics.motion.Motor#

class ophyd_async.epics.motion.Motor(prefix: str, name='')[source]#

Bases: StandardReadable, Movable, Stoppable, Flyable, Preparable

Device that moves a motor record

Methods

add_children_as_readables

Context manager to wrap adding Devices

add_readables

Add the given devices to the lists of known Devices

children

complete

Mark as complete once motor reaches completed position.

connect

Connect self and all child Devices.

describe

describe_configuration

kickoff

Begin moving motor from prepared position to final position.

prepare

Calculate required velocity and run-up distance, then if motor limits aren't breached, move to start position minus run-up distance

read

read_configuration

set

set_name

set_readable_signals

param read:

Signals to make up read()

stage

stop

unstage

Attributes

hints

log

name

Return the name of the Device

parent

The parent Device if it exists

set_name(name: str)[source]#
prepare(value: FlyMotorInfo)[source]#

Calculate required velocity and run-up distance, then if motor limits aren’t breached, move to start position minus run-up distance

kickoff()[source]#

Begin moving motor from prepared position to final position.

complete() WatchableAsyncStatus[source]#

Mark as complete once motor reaches completed position.

set(new_position: float, timeout: float | None | ~typing.Type[~ophyd_async.core.utils.CalculateTimeout] = <class 'ophyd_async.core.utils.CalculateTimeout'>)[source]#
async stop(success=False)[source]#
add_children_as_readables(wrapper: Callable[[AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints], AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints] | Type[ConfigSignal] | Type[HintedSignal] | None = None) Generator[None, None, None]#

Context manager to wrap adding Devices

Add Devices to this class instance inside the Context Manager to automatically add them to the correct fields, based on the Device’s interfaces.

The provided wrapper class will be applied to all Devices and can be used to specify their behaviour.

Parameters:

wrapper – Wrapper class to apply to all Devices created inside the context manager.

See also

add_readables(), ConfigSignal, HintedSignal, HintedSignal.uncached()

add_readables(devices: Sequence[Device], wrapper: Callable[[AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints], AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints] | Type[ConfigSignal] | Type[HintedSignal] | None = None) None#

Add the given devices to the lists of known Devices

Add the provided Devices to the relevant fields, based on the Signal’s interfaces.

The provided wrapper class will be applied to all Devices and can be used to specify their behaviour.

Parameters:
  • devices – The devices to be added

  • wrapper – Wrapper class to apply to all Devices created inside the context manager.

See also

add_children_as_readables(), ConfigSignal, HintedSignal, HintedSignal.uncached()

children() Iterator[Tuple[str, Device]]#
async connect(mock: bool = False, timeout: float = 10.0, force_reconnect: bool = False)#

Connect self and all child Devices.

Contains a timeout that gets propagated to child.connect methods.

Parameters:
  • mock – If True then use MockSignalBackend for all Signals

  • timeout – Time to wait before failing with a TimeoutError.

async describe() Dict[str, DataKey]#
async describe_configuration() Dict[str, DataKey]#
property hints: Hints#
property log#
property name: str#

Return the name of the Device

parent: 'Device' | None = None#

The parent Device if it exists

async read() Dict[str, Reading]#
async read_configuration() Dict[str, Reading]#
set_readable_signals(read: Sequence[SignalR] = (), config: Sequence[SignalR] = (), read_uncached: Sequence[SignalR] = ())#
Parameters:
  • read – Signals to make up read()

  • conf – Signals to make up read_configuration()

  • read_uncached – Signals to make up read() that won’t be cached

stage() None#
unstage() None#