cls_luigi.cls_tasks
This file contains the CLSBaseTask implementation, which is used to extend the actual implementation of luigi.Task, luigi.WrapperTask and luigi.ExternalTask with helper methods to make the usage of our framework a bit easier.
Module Contents
Classes
This class is used to implement some helper methods that all tasks in a CLS-Luigi pipeline should have. |
|
Abstract class representing a CLS-Luigi task. It combines the functionality of luigi.Task, LuigiCombinator, and ClsBaseTask. |
|
Abstract class representing a CLS-Luigi wrapper task. It combines the functionality of luigi.WrapperTask, LuigiCombinator, and ClsBaseTask. |
|
Abstract class representing a CLS-Luigi external task. It combines the functionality of luigi.ExternalTask, LuigiCombinator, and ClsBaseTask. |
- class cls_luigi.cls_tasks.ClsBaseTask[source]
This class is used to implement some helper methods that all tasks in a CLS-Luigi pipeline should have.
The key methods are:
get_variant_filename()
- This method creates a unique filename for (intermediate) results, which remains unique across the executed pipelines. For this purpose a hash value is created and persisted to disk, which can be looked up afterwards to trace the executed tasks back to this file.
- __get_flatten_data(data: luigi.target.FileSystemTarget | tuple | dict) list [source]
Helper method to flatten different possible input data types into a flattened list.
- Parameters:
data (luigi.target.FileSystemTarget | tuple | dict) – the data structure that should be flattened to a list.
- Returns:
a flattened list of the data provided.
- Return type:
list
- get_variant_filename(name='') str [source]
Returns a variant filename based on the provided name. Also does hashing of the name, since is has to be unique over every pipeline.
- Parameters:
name (str, optional) – optional name for the variant, defaults to “”
- Returns:
the variant filename.
- Return type:
str
- class cls_luigi.cls_tasks.ClsTask(*args, **kwargs)[source]
Bases:
luigi.Task
,cls_luigi.inhabitation_task.LuigiCombinator
,ClsBaseTask
Abstract class representing a CLS-Luigi task. It combines the functionality of luigi.Task, LuigiCombinator, and ClsBaseTask.
- class cls_luigi.cls_tasks.ClsWrapperTask(*args, **kwargs)[source]
Bases:
luigi.WrapperTask
,cls_luigi.inhabitation_task.LuigiCombinator
,ClsBaseTask
Abstract class representing a CLS-Luigi wrapper task. It combines the functionality of luigi.WrapperTask, LuigiCombinator, and ClsBaseTask.
- class cls_luigi.cls_tasks.ClsExternalTask(*args, **kwargs)[source]
Bases:
luigi.ExternalTask
,cls_luigi.inhabitation_task.LuigiCombinator
,ClsBaseTask
Abstract class representing a CLS-Luigi external task. It combines the functionality of luigi.ExternalTask, LuigiCombinator, and ClsBaseTask.