ophyd.ophydobj.OphydObject

class ophyd.ophydobj.OphydObject(*, name=None, attr_name='', parent=None, labels=None, kind=None)

The base class for all objects in Ophyd

Handles:

  • Subscription/callback mechanism

Parameters
namestr, optional

The name of the object.

attr_namestr, optional

The attr name on it’s parent (if it has one) ex getattr(self.parent, self.attr_name) is self

parentparent, optional

The object’s parent, if it exists in a hierarchy

kinda member of the Kind IntEnum

(or equivalent integer), optional Default is Kind.normal. See Kind for options.

Attributes
name

name of the device

__init__(*, name=None, attr_name='', parent=None, labels=None, kind=None)

Methods

__init__(*[, name, attr_name, parent, …])

add_instantiation_callback(callback[, …])

Register a callback which will receive each OphydObject instance.

check_value(value, **kwargs)

Check if the value is valid for this object

clear_sub(cb[, event_type])

Remove a subscription, given the original callback function

destroy()

Disconnect the object from the underlying control layer

subscribe(callback[, event_type, run])

Subscribe to events this event_type generates.

unsubscribe(cid)

Remove a subscription

unsubscribe_all()

Attributes

attr_name

connected

If the device is connected.

dotted_name

Return the dotted name

event_types

Events that can be subscribed to via obj.subscribe

kind

name

name of the device

parent

The parent of the ophyd object.

report

A report on the object.

root

Walk parents to find ultimate ancestor (parent’s parent…).