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:
name : str, optional

The name of the object.

attr_name : str, optional

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

parent : parent, optional

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

kind : a member of the Kind IntEnum

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

Attributes:
name

name of the device

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

Methods

__init__(self, \*[, name, attr_name, …])
add_instantiation_callback(callback[, …]) Register a callback which will receive each OphydObject instance.
check_value(self, value, \*\*kwargs) Check if the value is valid for this object
clear_sub(self, cb[, event_type]) Remove a subscription, given the original callback function
destroy(self) Disconnect the object from the underlying control layer
subscribe(self, callback[, event_type, run]) Subscribe to events this event_type generates.
unsubscribe(self, cid) Remove a subscription
unsubscribe_all(self)