-
Notifications
You must be signed in to change notification settings - Fork 3
/
abstract.py
80 lines (56 loc) · 1.61 KB
/
abstract.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from abc import ABC, abstractmethod
# Abstract Class
class AbstractInputReader(ABC):
"""Abstract class for reading data depending on given source type and method"""
@abstractmethod
def is_db_exists(self):
pass
@abstractmethod
def connect_db(self):
pass
@abstractmethod
def render_sql(self):
pass
@abstractmethod
def is_model_exist(self):
pass
@abstractmethod
def list_model_in_path(self):
pass
@abstractmethod
def find_latest_model(self):
pass
@abstractmethod
def read_interpreter(self):
pass
@abstractmethod
def read_data(self):
pass
@abstractmethod
def read(self):
pass
class AbstractOutputWriter(ABC):
"""Abstract class for writing data depending on given source type and method"""
@abstractmethod
def write_element(self):
pass
@abstractmethod
def write(self):
pass
class AbstractIOProcessor(ABC):
"""Abstract class as an entrypoint for choosing a type of Reader/Writer, then parse parameters to them"""
@abstractmethod
def process(self):
pass
class AbstractMLService(ABC):
"""Abstract class for managing ml-related processes"""
@abstractmethod
def process(self):
"""Orchestrate all the processes within a service"""
pass
class AbstractMLProcessor(ABC):
"""Abstract class as an entrypoint to orchestrateall services, then parse parameters to them"""
@abstractmethod
def process(self):
"""Orchestrate all the processes between ML services"""
pass