devctrl.devices.device_info.DeviceInfo#

class DeviceInfo(key: str, name: str, device_type: Type[Device], global_varname: str, connect_priority: int)[source]#

Bases: object

Small data class for device management. A DeviceInfo should provide information about a device instance that is optinally managed by a DeviceManager and can be seen as describing the ‘role’ of a device.

Parameters:
  • key – Device key. This is used with the DeviceManager and in config files. Should not contain spaces.

  • name – A descriptive device name, like Shutter for the blue laser.

  • device_type – The subclass of Device that the device belongs to.

  • global_varname – Name of a global variable that the connected device can be assigned to. Must be a valid python variable name.

  • connect_priority – A higher priority means the device should be connected before others (eg. a power switch) and disconnected after others.

Methods

Attributes

__annotations__ = {'connect_priority': <class 'int'>, 'device_type': typing.Type[devctrl.devices.device.Device], 'global_varname': <class 'str'>, 'key': <class 'str'>, 'name': <class 'str'>}#
__dataclass_fields__ = {'connect_priority': Field(name='connect_priority',type=<class 'int'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'device_type': Field(name='device_type',type=typing.Type[devctrl.devices.device.Device],default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'global_varname': Field(name='global_varname',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'key': Field(name='key',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'name': Field(name='name',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}#
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)#
__dict__ = mappingproxy({'__module__': 'devctrl.devices.device_info', '__firstlineno__': 5, '__annotations__': {'key': <class 'str'>, 'name': <class 'str'>, 'device_type': typing.Type[devctrl.devices.device.Device], 'global_varname': <class 'str'>, 'connect_priority': <class 'int'>}, '__doc__': "\nSmall data class for device management.\nA `DeviceInfo` should provide information about a device instance that is optinally managed by a `DeviceManager` and can be seen as describing the 'role' of a device.\n\n:param key: Device key. This is used with the `DeviceManager` and in config files. Should not contain spaces.\n:param name: A descriptive device name, like `Shutter for the blue laser`.\n:param device_type: The subclass of `Device` that the device belongs to.\n:param global_varname: Name of a global variable that the connected device can be assigned to. Must be a valid python variable name.\n:param connect_priority: A higher priority means the device should be connected before others (eg. a power switch) and disconnected after others.\n", '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'DeviceInfo' objects>, '__weakref__': <attribute '__weakref__' of 'DeviceInfo' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'key': Field(name='key',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'name': Field(name='name',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'device_type': Field(name='device_type',type=typing.Type[devctrl.devices.device.Device],default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'global_varname': Field(name='global_varname',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'connect_priority': Field(name='connect_priority',type=<class 'int'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function DeviceInfo.__init__>, '__repr__': <function DeviceInfo.__repr__>, '__eq__': <function DeviceInfo.__eq__>, '__match_args__': ('key', 'name', 'device_type', 'global_varname', 'connect_priority')})#
__eq__(other)#

Return self==value.

__firstlineno__ = 5#
__hash__ = None#
__init__(key: str, name: str, device_type: Type[Device], global_varname: str, connect_priority: int) None#
__match_args__ = ('key', 'name', 'device_type', 'global_varname', 'connect_priority')#
__module__ = 'devctrl.devices.device_info'#
__replace__(**changes)#
__repr__()#

Return repr(self).

__static_attributes__ = ()#
__weakref__#

list of weak references to the object

connect_priority: int#
device_type: Type[Device]#
global_varname: str#
key: str#
name: str#