ophyd.device.DynamicDeviceComponent

class ophyd.device.DynamicDeviceComponent(defn, *, clsname=None, doc=None, kind=<Kind.normal: 1>, default_read_attrs=None, default_configuration_attrs=None, component_class=<class 'ophyd.device.Component'>, base_class=None)

An Device component that dynamically creates an ophyd Device

Parameters:
defn : OrderedDict

The definition of all attributes to be created, in the form of:

defn['attribute_name'] = (SignalClass, pv_suffix, keyword_arg_dict)

This will create an attribute on the sub-device of type SignalClass, with a suffix of pv_suffix, which looks something like this:

parent.sub.attribute_name = Cpt(SignalClass, pv_suffix, **keyword_arg_dict)

Keep in mind that this is actually done in the metaclass creation, and not exactly as written above.

clsname : str, optional

The name of the class to be generated This defaults to {parent_name}{this_attribute_name.capitalize()}

doc : str, optional

The docstring to put on the dynamically generated class

default_read_attrs : list, optional

A class attribute to put on the dynamically generated class

default_configuration_attrs : list, optional

A class attribute to put on the dynamically generated class

component_class : class, optional

Defaults to Component

base_class : class, optional

Defaults to Device

__init__(defn, *, clsname=None, doc=None, kind=<Kind.normal: 1>, default_read_attrs=None, default_configuration_attrs=None, component_class=<class 'ophyd.device.Component'>, base_class=None)

Methods

__init__(defn, *[, clsname, doc, kind, …])
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)