rail.projects.pipeline_factory module

class rail.projects.pipeline_factory.RailPipelineFactory[source]

Bases: RailFactoryMixin

Factory class to make pipelines

Expected usage is that user will define a yaml file with the various datasets that they wish to use with the following example syntax:

Pipelines:
  - PipelineTemplate:
      name: pz:
      pipeline_class: rail.pipelines.estimation.pz_all.PzPipeline
        input_catalog_template: degraded
      output_catalog_template: degraded
      input_file_templates:
        input_train:
          flavor: baseline
          tag: train
        input_test:
          flavor: baseline
          tag: test
      kwargs:
        algorithms: ['all']
classmethod add_pipeline_instance(pipeline_instance)[source]

Add a particular PipelineInstance to the factory

Return type:

None

Parameters:

pipeline_instance (RailPipelineInstance)

classmethod add_pipeline_template(pipeline_template)[source]

Add a particular PipelineTemplate to the factory

Return type:

None

Parameters:

pipeline_template (RailPipelineTemplate)

client_classes: list[type[Configurable]] = [<class 'rail.projects.pipeline_holder.RailPipelineTemplate'>, <class 'rail.projects.pipeline_holder.RailPipelineInstance'>]
classmethod get_pipeline_instance(name)[source]

Get a pipeline instance by its assigned name

Return type:

RailPipelineInstance

Parameters:

name (str) – Name of the pipeline instance list to return

Returns:

pipeline instance in question

Return type:

RailProjectPipelineInstance

classmethod get_pipeline_instance_names()[source]

Return the names of the pipeline instances lists

Return type:

list[str]

classmethod get_pipeline_instances()[source]

Return the dict of all the pipeline instances

Return type:

dict[str, RailPipelineInstance]

classmethod get_pipeline_template(name)[source]

Get pipeline templates by it’s assigned name

Return type:

RailPipelineTemplate

Parameters:

name (str) – Name of the pipeline templates to return

Returns:

pipeline templates in question

Return type:

RailProjectPipelineTemplate

classmethod get_pipeline_template_names()[source]

Return the names of the pipeline templates

Return type:

list[str]

classmethod get_pipeline_templates()[source]

Return the dict of all the pipeline templates

Return type:

dict[str, RailPipelineTemplate]

property pipeline_instances: dict[str, RailPipelineInstance]

Return the dictionary of pipeline instances

property pipeline_templates: dict[str, RailPipelineTemplate]

Return the dictionary of pipeline templates

print_instance_contents()[source]

Print the contents of the factory

Return type:

None

yaml_tag: str = 'Pipelines'