Skip to content

task

BaseAnalyzer

Bases: ABC

Base class to be implemented as analyzer for DPTask

Source code in catflow/tesla/base/task.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class BaseAnalyzer(ABC):
    """Base class to be implemented as analyzer for `DPTask`
    """

    def __init__(self, dp_task: BaseTask) -> None:
        self.dp_task = dp_task

    def _iteration_dir(self, iteration: int, **kwargs) -> str:
        return ""

    @classmethod
    def setup_task(cls, **kwargs):
        task = BaseTask(**kwargs)
        return cls(task)

BaseTask

Bases: object

BaseTask is a base class reading a directory, where task run.

Source code in catflow/tesla/base/task.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class BaseTask(object):
    """BaseTask is a base class reading a directory, where task run.
    """

    def __init__(self, path: str):
        """Generate a class of tesla task.

        Args:
            path (str): The path of the tesla task.
        """
        self.path = Path(path).resolve()

    @classmethod
    def from_dict(cls, dp_task_dict: dict):
        return cls(**dp_task_dict)

__init__(path)

Generate a class of tesla task.

Parameters:

Name Type Description Default
path str

The path of the tesla task.

required
Source code in catflow/tesla/base/task.py
10
11
12
13
14
15
16
def __init__(self, path: str):
    """Generate a class of tesla task.

    Args:
        path (str): The path of the tesla task.
    """
    self.path = Path(path).resolve()