devctrl.task.tasks.DebugTask#
- class DebugTask(msg: str = 'None')[source]#
Bases:
TaskDebug Task, prints a log message
Methods
Convenience wrapper for dataclasses.asdict(self)
Recursively construct a SettingsClass from a dictionary.
Get formatted task name with settings
Return relevant settings as a formatted string for GUI display
Return the human-readable name of the task.
Attributes
- __abstractmethods__ = frozenset({})#
- __annotations__ = {'msg': <class 'str'>}#
- __dataclass_fields__ = {'msg': Field(name='msg',type=<class 'str'>,default='None',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.task.tasks', '__firstlineno__': 12, '__annotations__': {'msg': <class 'str'>}, '__doc__': 'Debug Task, prints a log message', 'msg': 'None', 'get_settings_name': <function DebugTask.get_settings_name>, '__static_attributes__': (), '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '__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__': {'msg': Field(name='msg',type=<class 'str'>,default='None',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 DebugTask.__init__>, '__repr__': <function DebugTask.__repr__>, '__eq__': <function DebugTask.__eq__>, '__match_args__': ('msg',)})#
- __eq__(other)#
Return self==value.
- __firstlineno__ = 12#
- __hash__ = None#
- __init__(msg: str = 'None') None#
- __match_args__ = ('msg',)#
- __module__ = 'devctrl.task.tasks'#
- __or__(other)#
Merge with another settings class or a dictionary.
- __replace__(**changes)#
- __repr__()#
Get formatted task name with settings
- Returns:
Formatted string as ‘typename (settings_name)’
- __slots__ = ()#
- __static_attributes__ = ()#
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- _children: Dict[str, Type[Task]] = {'DebugTask': <class 'devctrl.task.tasks.DebugTask'>, 'MeasurementTask': <class 'prsctrl_gui.task.measurement.MeasurementTask'>, 'UserConfirmTask': <class 'devctrl.task.tasks.UserConfirmTask'>, 'WaitTask': <class 'devctrl.task.tasks.WaitTask'>}#
- as_dict() dict#
Convenience wrapper for dataclasses.asdict(self)
- estimate_runtime_s() int#
- classmethod from_dict(data: dict)#
Recursively construct a SettingsClass from a dictionary. If the value of a field is another SettingsClass, from_dict will be called for that field as well. Handled are: - SettingsClass - list[SettingsClass] - dict[<any>, SettingsClass] - all of the above as Optional
- Raises:
ValueError – If data contains a value that has the wrong type for the field of cls (ONLY if the type is a subclass of SettingsClass! Other types are not enforced)
KeyError – If data contains a key that is not a field name of cls
- get_name()#
Get formatted task name with settings
- Returns:
Formatted task name including settings
- get_settings_name() str[source]#
Return relevant settings as a formatted string for GUI display
Iterates through task fields and returns a string representation of non-default values that can be used for displaying the task in the GUI.
- Returns:
Formatted string of settings, or empty string if no settings differ from defaults
- classmethod get_type_name() str#
Return the human-readable name of the task.
- classmethod load_yaml(yaml_path: str, loader=<class 'yaml.loader.Loader'>)#
- msg: str = 'None'#
- save_yaml(yaml_path: str)#