pycsamt.pipeline._config#

Config-file loaders for the pyCSAMT pipeline.

Supports three config formats:

YAML

Pipeline.from_yaml("workflow.yaml")

JSON

Pipeline.from_json("workflow.json")

Python module

Pipeline.from_py("workflow.py")

The Python file must expose a module-level variable named pipeline_config that is a dict with the same schema as the YAML/JSON format.

Config schema#

name: "My Workflow"        # optional pipeline label
output_dir: "results/"     # default outdir when Pipeline.run() is called
preset: "basic_qc"         # optional: seed steps from a preset before
                           # applying the steps list below
steps:
  - name: notch            # user label for the step (optional)
    code: NR001            # step registry code OR name
    params:                # keyword arguments (optional)
      mains_hz: 50
      n_harm: 30
  - name: select_band
    code: FREQ001
    params:
      band_hz: [0.001, 10000]
  - code: FREQ004          # name is optional — auto-set from registry
  - code: SS001

The steps list is processed in order; if preset is specified, its steps come first and the explicit steps entries are appended.

Functions

load_json(path)

Parse a JSON pipeline config file and return the raw dict.

load_py(path)

Import a Python config file and return its pipeline_config dict.

load_yaml(path)

Parse a YAML pipeline config file and return the raw dict.

pipeline_to_yaml(steps[, name, output_dir])

Serialise a list of (label, Step) tuples to a YAML string.

pycsamt.pipeline._config.load_yaml(path)[source]#

Parse a YAML pipeline config file and return the raw dict.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

pycsamt.pipeline._config.load_json(path)[source]#

Parse a JSON pipeline config file and return the raw dict.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

pycsamt.pipeline._config.load_py(path)[source]#

Import a Python config file and return its pipeline_config dict.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

pycsamt.pipeline._config.pipeline_to_yaml(steps, name='pipeline', output_dir=None)[source]#

Serialise a list of (label, Step) tuples to a YAML string.

Produces the canonical format that load_yaml() can reload. Falls back to a plain-text representation when PyYAML is unavailable.

Parameters:
Return type:

str