Esempio n. 1
0
 def factory(saved=False):
     nonlocal counter
     counter += 1
     pipeline = Pipeline('Test Pipeline-{}'.format(counter), [], None, None)
     if saved:
         task = task_factory(True)
         task.add_pipeline(pipeline)
     return pipeline
Esempio n. 2
0
 def to_obj(self) -> Pipeline:
     pipeline = Pipeline(name=self.name,
                         steps=safe_loads(self.steps, List[PipelineStep]),
                         input_data=safe_loads(self.input_data, DatasetType),
                         output_data=safe_loads(self.output_data, DatasetType),
                         author=self.author,
                         creation_date=self.creation_date,
                         id=self.id,
                         task_id=self.task_id)
     return self.attach(pipeline)
Esempio n. 3
0
    def create_pipeline(self, pipeline: Pipeline) -> Pipeline:
        self._validate_pipeline(pipeline)

        existing_task = self.get_task_by_id(pipeline.task_id)
        if existing_task is None:
            raise NonExistingTaskError(pipeline.task_id)

        if self.get_pipeline_by_name(pipeline.name, existing_task) is not None:
            raise ExistingPipelineError(pipeline)

        pipeline._id = self.data.get_and_increment('next_pipeline_id')
        self.data.add_pipeline(copy.deepcopy(pipeline))
        self.save()
        return pipeline
Esempio n. 4
0
def pipeline():
    return Pipeline('Test Pipeline', [PipelineStep('a', 'b'), PipelineStep('c', 'd')], NumpyNdarrayDatasetType,
                    NumpyNdarrayDatasetType)
Esempio n. 5
0
 def delete_pipeline(self, pipeline: Pipeline):
     if pipeline.id is None:
         raise NonExistingPipelineError(pipeline)
     self.data.remove_pipeline(pipeline.id)
     self.save()
     pipeline.unbind_meta_repo()
Esempio n. 6
0
def pipeline():
    return Pipeline('Test Pipeline', [PipelineStep('a', 'b'), PipelineStep('c', 'd')], None, None)
Esempio n. 7
0
def pipeline2():
    return Pipeline('Test Pipeline2', [PipelineStep('b', 'c')], None, None)
Esempio n. 8
0
 def delete_pipeline(self, pipeline: Pipeline):
     self._delete_object(self.pipelines, pipeline, NonExistingPipelineError,
                         AssertionError)
     pipeline.unbind_meta_repo()