pelagos_py.steps.base_step#

pelagos_py.steps.base_step.REGISTERED_STEPS[source]#

Registry of explicitly registered step classes.

pelagos_py.steps.base_step.register_step(cls)[source]#

Decorator to mark a step class for inclusion in the pipeline.

class pelagos_py.steps.base_step.BaseStep(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.utils.config_mirror.ConfigMirrorMixin

Base class for pipeline steps with config-mirroring support. Every concrete subclass (registered via @register_step) inherits this.

classmethod describe_parameters()[source]#

Return a JSON-serialisable description of this step’s parameters.

Introspection surface for external tools (e.g. a dashboard) that need to render a parameter form without instantiating the step. See pelagos_py.utils.parameter_spec.describe().

classmethod output_variables(parameters)[source]#

Variables this step writes for the given config parameters (read by the config validator).

resolve(var)[source]#

var’s _ADJUSTED version if it exists in self.data, else the raw one.

adjusted_copy(var)[source]#

Name of var’s _ADJUSTED version, created (with its _QC) as a copy of the raw variable if missing.

values_at_rows_of(var, rows_of)[source]#

var time-interpolated onto the rows where rows_of has data, as (values, flags).

For a step needing another sensor’s values at its own rows; the result is for the calculation only and never written to the data. Samples flagged in the calculation flags (default 3/4/9) are not interpolated from, and each row’s flag is the merged flag of the samples it came from (9 where no value).

mark_intermediate(*names)[source]#

Record pipeline-made working variables that Data Export leaves out unless asked to keep them.

selected_figures()[source]#

Figure names this run draws, resolved from the diagnostics setting.

log(message, console=True)[source]#

Log an info-level message. console=False keeps it in the log file only.

log_generating_diagnostics()[source]#

Log that diagnostics are being produced, distinguishing report-capture runs from diagnostics: true.

log_progress(iterable=None, *, desc, total=None, unit='it', leave=False)[source]#

Wrap a countable sub-loop as a standard pipeline progress bar; drop-in for tqdm(iterable, ...).

log_warn(message, warning_type=UserWarning)[source]#

Log a warning-level message.

check_data()[source]#

Check for data in context for transformer steps.

halt(message)[source]#

Stop the pipeline cleanly for an unrecoverable misconfiguration.

Logs message (the detail and any fix/install hint) at ERROR level, then a terminal STOP line marking the deliberate halt, and exits. Use this instead of raising for config problems discovered at run time, so the user sees one actionable error rather than a wrapped traceback.

update_parameters(**kwargs)[source]#

Update parameter values both in attributes and in private store.

Example:

self.update_parameters(file_path='newfile.nc', add_meta=False)
generate_config()[source]#

Return this step’s config dict (suitable for saving to YAML).

save_config(path: str | None = None)[source]#

Save this step’s config to YAML (for standalone debugging).