Добавил модули

This commit is contained in:
2023-12-05 00:10:42 +03:00
parent 249a9e8a63
commit 1d36512756
18 changed files with 507 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
from modules.pipelines.pipes.starter import Starter
class Pipeline:
def __init__(self, name):
self.name = name
self.pipes = [Starter()]
def add(self, pipe):
previous_output_data_type = self.pipes[-1].output_data_type
current_input_data_type = pipe.input_data_type
if previous_output_data_type != current_input_data_type:
raise Exception("Output and input datatypes are different")
self.pipes.append(pipe)
return self
def run(self, data):
for pipe in self.pipes:
data = pipe.do(data)
return data