evalquiz_pipeline_server.pipeline_execution package

Submodules

evalquiz_pipeline_server.pipeline_execution.internal_pipeline_module module

class evalquiz_pipeline_server.pipeline_execution.internal_pipeline_module.InternalPipelineModule(pipeline_module: PipelineModule, split: bool = False, merge: bool = False)[source]

Bases: PipelineModule, ABC

An implementation of a PipelineModule.

cast_to_pipeline_module() PipelineModule[source]

Casts self object to object of superclass: PipelineModule. This method is required, as Python does not feature object type casting.

Returns:

Self object casted into PipelineModule.

Return type:

PipelineModule

abstract async run(input: Any) Any[source]

The execution logic of the pipeline module. Checks IO-types on runtime.

Parameters:

input (Any) – Input to pipeline implementation.

Returns:

Output of pipeline implementation.

Return type:

Any

evalquiz_pipeline_server.pipeline_execution.pipeline module

class evalquiz_pipeline_server.pipeline_execution.pipeline.Pipeline(reference: str, pipeline_modules: list[evalquiz_pipeline_server.pipeline_execution.internal_pipeline_module.InternalPipelineModule])[source]

Bases: object

validate_io_composition() bool[source]

Validates IO compatibility types of successive InternalPipelineModules.

Returns:

True, if IO is compatible.

Return type:

bool

validate_split_merge_composition() bool[source]

Validates split-merge compatibility of Pipeline.

Returns:

True, if split-merge flags are compatible.

Return type:

bool

evalquiz_pipeline_server.pipeline_execution.pipeline_execution module

class evalquiz_pipeline_server.pipeline_execution.pipeline_execution.PipelineExecution(input: Any, pipeline: Pipeline)[source]

Bases: object

async run() AsyncIterator[PipelineStatus][source]

Execution logic that chains InternalPipelineModules together and executes their run() method.

Returns:

Iterator with PipelineStatus of the current execution.

Return type:

AsyncIterator[PipelineStatus]

evalquiz_pipeline_server.pipeline_execution.pipeline_executor module

class evalquiz_pipeline_server.pipeline_execution.pipeline_executor.PipelineExecutor(pipelines: defaultdict[str, Pipeline] = {})[source]

Bases: object

add_pipeline(reference: str, pipeline_modules: list[evalquiz_pipeline_server.pipeline_execution.internal_pipeline_module.InternalPipelineModule]) None[source]

Adds a pipeline to self.pipelines

Parameters:
  • reference (str) – Reference that the pipeline can be accessed under.

  • pipeline_modules (list[InternalPipelineModule]) – Implementations of pipeline modules describing the pipeline module execution order.

delete_pipeline(reference: str) None[source]

Deletes a pipeline from self.pipelines

Parameters:

reference (str) – Reference of pipeline that should be deleted.

run_pipeline(reference: str, input: Any) AsyncIterator[PipelineStatus][source]

Creates and runs a new PipelineExecution on specified pipeline.

Parameters:
  • reference (str) – Reference of pipeline that should be executed.

  • input (Any) – Input of PipelineExecution.

Returns:

Iterator with PipelineStatus of the current execution.

Return type:

AsyncIterator[PipelineStatus]

Module contents