devctrl.task.base.Task#
- class Task[source]#
Bases:
ABC,SettingsClassBase class for all tasks. Task classes should use the @taskclass decorator.
Methods
Convenience wrapper for dataclasses.asdict(self)
estimate_runtime_sRecursively 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.
load_yamlsave_yaml- as_dict() dict#
Convenience wrapper for dataclasses.asdict(self)
- 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()[source]#
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