ophyd.device.Component

class ophyd.device.Component(cls, suffix=None, *, lazy=False, trigger_value=None, add_prefix=None, doc=None, kind=<Kind.normal: 1>, **kwargs)

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters
clsclass

Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

def __init__(self, pv_name, parent=None, **kwargs):

or (if suffix is None)

def __init__(self, parent=None, **kwargs):

The class may have a wait_for_connection() which is called during the component instance creation.

suffixstr, optional

The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

lazybool, optional

Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation

trigger_valueany, optional

Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

add_prefixsequence, optional

Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

docstr, optional

string to attach to component DvcClass.component.__doc__

__init__(cls, suffix=None, *, lazy=False, trigger_value=None, add_prefix=None, doc=None, kind=<Kind.normal: 1>, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(cls[, suffix, lazy, trigger_value, …])

Initialize self.

create_component(instance)

Instantiate the object described by this Component for a Device

make_docstring(parent_class)

Create a docstring for the Component

maybe_add_prefix(instance, kw, suffix)

Add prefix to a suffix if kw is in self.add_prefix

sub_default(func)

Default subscription decorator

sub_meta(func)

Metadata subscription decorator

sub_value(func)

Value subscription decorator

subscriptions(event_type)

(Decorator) Specify subscriptions callbacks in the Device definition

Attributes

is_device

Does this Component contain a Device?

is_signal

Does this Component contain a Signal?