fosanalysis
A framework to evaluate distributed fiber optic sensor data
Toggle main menu visibility
Loading...
Searching...
No Matches
base.py
Go to the documentation of this file.
1
2
r"""
3
Contains abstract base classes.
4
\author Bertram Richter
5
\date 2023
6
"""
7
8
from
abc
import
ABC
9
import
warnings
10
11
class
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
26
class
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
38
class
Workflow
(
Base
):
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)
fosanalysis.utils.base.Base
Abstract base class, which deals with superflous constructor arguments.
Definition
base.py:11
fosanalysis.utils.base.Base.__init__
__init__(self, *args, **kwargs)
Construct the object and warn about unused/unknown arguments.
Definition
base.py:15
fosanalysis.utils.base.Task
This intermediate class indicates, that a sub-class is implementing a task.
Definition
base.py:26
fosanalysis.utils.base.Task.__init__
__init__(self, *args, **kwargs)
Definition
base.py:35
fosanalysis.utils.base.Workflow
This intermediate class indicates, that a sub-class is implementing a workflow.
Definition
base.py:38
fosanalysis.utils.base.Workflow.__init__
__init__(self, *args, **kwargs)
Definition
base.py:46
src
fosanalysis
utils
base.py
Generated by
1.18.0