poprox_recommender.lkpipeline.state#

Classes

PipelineState([state, aliases, default, meta])

Full results of running a pipeline.

class poprox_recommender.lkpipeline.state.PipelineState(state=None, aliases=None, default=None, meta=None)#

Bases: Mapping[str, Any]

Full results of running a pipeline. A pipeline state is a dictionary mapping node names to their results; it is implemented as a separate class instead of directly using a dictionary to allow data to be looked up by node aliases in addition to original node names (and to be read-only).

Client code will generally not construct this class directly.

Parameters:
  • state (dict[str, Any] | None) – The pipeline state to wrap. The state object stores a reference to this dictionary.

  • aliases (dict[str, str] | None) – Dictionary of node aliases.

  • default (str | None) – The name of the default node (whose data should be returned by default ).

  • meta (PipelineMeta | None) – The metadata for the pipeline generating this state.

meta: PipelineMeta | None#

Pipeline metadata.

property default: Any#

Return the data from of the default node (typically the last node run).

Returns:

The data associated with the default node.

Raises:

ValueError – if there is no specified default node.

property default_node: str | None#

Return the name of the default node (typically the last node run).