Pipeline

class ionworkspipeline.Pipeline(elements, output_file=None, name=None, description=None)

A pipeline is a sequence of pipeline elements, each of which takes a set of parameters as input and returns a set of parameters as output. The output of one element is the input of the next. The pipeline can be run to generate a set of parameters, and a report can be generated to document the pipeline.

Parameters

elementsdict of {str: _PipelineElement}

A dictionary of pipeline elements. The name is used to identify the element in the report.

output_filestr, optional

The file to save the parameters to. If None, the parameters are not saved.

namestr, optional

A name for the pipeline. Useful for identification and reporting.

descriptionstr, optional

A description of what the pipeline does.

Extends: ionworkspipeline.controllers.ConfigMixin

run() ParameterValues

Execute all pipeline elements sequentially to generate parameters.

Each element receives the accumulated ParameterValues and returns new parameters to add. Results are combined and optionally saved to a file.

Returns

iwp.ParameterValues

Complete set of parameters generated by the pipeline.

Examples

Build and run a parameter pipeline:

>>> geom_params = iwp.ParameterValues({
...     "Positive electrode capacity [A.h]": 3.0,
...     "Positive electrode active material volume fraction": 0.65,
...     "Positive electrode thickness [m]": 80e-6,
...     "Electrode area [m2]": 0.1,
... })
>>> pipeline = iwp.Pipeline({
...     "geometry": iwp.direct_entries.DirectEntry(geom_params, "Datasheet"),
...     "capacity": iwp.calculations.ElectrodeCapacity(
...         "positive", use_stoich_window=False
...     ),
... })
>>> result = pipeline.run()
>>> float(result["Maximum concentration in positive electrode [mol.m-3]"]) > 0
True
to_config() dict

Convert the Pipeline back to parser configuration format.

Returns

dict

Configuration dictionary that can be passed to parse_pipeline

Common pipelines

Collections of pre-defined pipelines for common tasks.