fluidml.task¶
- class fluidml.task.TaskInfo(*, project_name, run_name, state=None, started=None, ended=None, duration=None, run_history=None, sweep_counter=None, unique_config_hash=None, id=None)[source]¶
Bases:
BaseModel
A wrapper class to store important task information.
Used for serializing the information to the results store.
- Parameters:
- id: Optional[str]¶
A combination of the run-name and the sweep counter or unique config hash if the former does not exist.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'use_enum_values': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'duration': FieldInfo(annotation=Union[timedelta, NoneType], required=False), 'ended': FieldInfo(annotation=Union[datetime, NoneType], required=False), 'id': FieldInfo(annotation=Union[str, NoneType], required=False), 'project_name': FieldInfo(annotation=str, required=True), 'run_history': FieldInfo(annotation=Union[Dict, NoneType], required=False), 'run_name': FieldInfo(annotation=str, required=True), 'started': FieldInfo(annotation=Union[datetime, NoneType], required=False), 'state': FieldInfo(annotation=Union[TaskState, NoneType], required=False), 'sweep_counter': FieldInfo(annotation=Union[str, NoneType], required=False), 'unique_config_hash': FieldInfo(annotation=Union[str, NoneType], required=False)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fluidml.task.TaskState(value)[source]¶
-
The state of a task.
- FAILED = 'failed'¶
Task failed due to an unexpected error.
- FINISHED = 'finished'¶
Task finished successfully.
- KILLED = 'killed'¶
Task has been killed by the user via KeyBoardInterrupt.
- PENDING = 'pending'¶
Task has not been scheduled and processed, yet.
- RUNNING = 'running'¶
Task is currently running.
- SCHEDULED = 'scheduled'¶
Task has been scheduled for processing.
- UPSTREAM_FAILED = 'upstream_failed'¶
Task failed/could not be executed due to one or more upstream task failures.