pelagos_py.pipeline#
- pelagos_py.pipeline.REPORT_STEP_NAME = 'Write Data Report'[source]#
Name of the report step that triggers background diagnostic capture.
- pelagos_py.pipeline.resolve_on_step_fail(value)[source]#
Return the
on_step_failsetting: “skip”, “pause” or “stop” (default “pause”).
- class pelagos_py.pipeline.Pipeline(config_path=None, config=None)[source]#
Bases:
pelagos_py.utils.config_mirror.ConfigMirrorMixinPipeline that manages a sequence of processing steps.
- Config-aware pipeline that can:
Load config YAML into private self._parameters
Keep global_parameters mirrored to _parameters[‘pipeline’]
Build, run, and export steps as before
- Parameters:
ConfigMirrorMixin (Class) – Class to handle configuration
- classmethod load_config(config_path)[source]#
Create a pipeline from a YAML config file (same as
Pipeline(config_path=...)).Pipeline.load_config("my_pipeline.yaml").run()
- classmethod make_config(file_path, ask=False, config_path=None)[source]#
Build a config for an OG1 file from the default template and create a pipeline from it.
The template’s steps are adapted to what the file holds (e.g. the PAR steps are dropped if it has no PAR; Visual QC is left out as it needs the dashboard) and the config is saved to
config_path(default:<file name>.yamlnext to the file), so the run can be edited and repeated withload_config(). Withask=Trueeach choice is asked in the terminal; otherwise the defaults are used and logged.Pipeline.make_config("glider.nc").run() Pipeline.make_config("glider.nc", ask=True) # build and save only
- build_steps(steps_config)[source]#
Build steps from configuration.
Individual steps, including parameters and diagnostics, are saved to self.steps using add_step() for other functions.
- add_step(step_name, parameters=None, diagnostics=False, run_immediately=False)[source]#
Dynamically adds a step and optionally runs it immediately.
- Parameters:
- Raises:
ValueError – If the step name is not recognized.
- run_context()[source]#
Validate and set up report capture around a run; yields whether a report step is present.
- generate_config()[source]#
Generate a configuration dictionary from the current pipeline setup.
- Returns:
Configuration dictionary of the current pipeline.
- Return type:
- export_config(output_path='generated_pipeline.yaml')[source]#
Write current config to file (respects private _parameters)