fosanalysis
A framework to evaluate distributed fiber optic sensor data
Loading...
Searching...
No Matches
base.py
Go to the documentation of this file.
2r"""
3Contains abstract base classes.
4\author Bertram Richter
5\date 2023
6"""
7
8from abc import ABC
9import warnings
10
11class Base(ABC):
12 r"""
13 Abstract base class, which deals with superflous constructor arguments.
14 """
15 def __init__(self, *args, **kwargs):
16 r"""
17 Construct the object and warn about unused/unknown arguments.
18 \param *args Additional positional arguments, will be discarded and warned about.
19 \param **kwargs Additional keyword arguments, will be discarded and warned about.
20 """
21 if len(args) > 0:
22 warnings.warn("Unused positional arguments for {c}: {a}".format(c=type(self), a=args))
23 if len(kwargs) > 0:
24 warnings.warn("Unknown keyword arguments for {c}: {k}".format(c=type(self), k=kwargs))
25
26class Task(Base):
27 r"""
28 This intermediate class indicates, that a sub-class is implementing a task.
29 A task object implements an algorithm to solve specific problem.
30 Alternative solution approaches/algorithms, solve the same problem in a different way.
31 But task objects for the same problem share the same interface.
32 Hence, they are interchangable and enable fine-grained configurability.
33 Complex algorithms are composed of several Task objects in Workflow objects.
34 """
35 def __init__(self, *args, **kwargs):
36 super().__init__(*args, **kwargs)
37
39 r"""
40 This intermediate class indicates, that a sub-class is implementing a workflow.
41 Workflow objects implement the order of working steps to solve complex problems.
42 The individual working steps are dealt with by Task objects.
43 (A Workflow object can serve as a Task object itself in a larger Workflow.)
44
45 """
46 def __init__(self, *args, **kwargs):
47 super().__init__(*args, **kwargs)
Abstract base class, which deals with superflous constructor arguments.
Definition base.py:11
__init__(self, *args, **kwargs)
Construct the object and warn about unused/unknown arguments.
Definition base.py:15
This intermediate class indicates, that a sub-class is implementing a task.
Definition base.py:26
__init__(self, *args, **kwargs)
Definition base.py:35
This intermediate class indicates, that a sub-class is implementing a workflow.
Definition base.py:38
__init__(self, *args, **kwargs)
Definition base.py:46