ska_sdp_piper.piper.stage.stages module

class ska_sdp_piper.piper.stage.stages.Stage(name, stage_definition, optional=False)[source]

Bases: object

Represents an individual processing step within a pipeline.

property config: dict[str, dict[str, Any]]

Get the stage configuration as a dictionary.

Returns:

Mapping of the stage name to its JSON-serialized parameters.

Return type:

dict[str, dict[str, Any]]

update_parameters(**kwargs)[source]

Update the configuration parameters for this stage.

Parameters:

**kwargs -- Mapping of configuration parameter names to their new values.

add_additional_parameters(_cli_args_, **piper_args)[source]

Update additional parameters provided by the pipeline.

Parameters:
  • _cli_args_ (dict) -- Dictionary of command-line interface arguments.

  • **piper_args -- Additional keyword arguments for internal pipeline parameters.

validate_stage_args()[source]

Validate that all required arguments and parameters are initialized.

Raises:
  • AssertionError -- If CLI or Piper arguments contain uninitialized values.

  • ValidationError -- If the configuration does not match the expected model schema.

generate_config_rows_for_stage()[source]

Generate configuration table rows for the stage.

Returns:

A list of rows representing the stage's configuration metadata.

Return type:

list[ConfigTableRow]

class ska_sdp_piper.piper.stage.stages.Stages(*stages)[source]

Bases: object

Pipeline stages

__stages

List of pipeline stages

Type:

list[Stage]

property executable_stages: list[Stage]

Get the list of currently enabled stages.

Return type:

The subset of stages where is_enabled is True.

update_stage_parameters(stage_parameters)[source]

Update the configurable parameters of stages

Parameters:

stage_parameters (dict[str, dict]) -- A mapping between stage name and its dictionary of configuration parameters

update_stage_state(stage_names)[source]

Enable stages by name and disable all others.

Parameters:

stage_names (list[str]) -- List of stage names that should be enabled.

validate()[source]

Validate all executable stages and their arguments.

Raises:

NoStageToExecuteException -- If no stages are enabled for execution.

add_additional_parameters(**kwargs)[source]

Apply additional parameters to every stage in the collection.

Parameters:

**kwargs -- The keyword arguments to pass to each stage.