2.2.3.11. pycsamt.api.pipe#

Pipeline API configuration for pyCSAMT.

class pycsamt.api.pipe.PipelineAPIConfig(output_root='pipe_results', processed_subdir='processed', plots_subdir='plots', on_step_error='warn', save_intermediate=False, show_progress=True, progress_style='bar', repr_width=80, plot_dpi=150, plot_fmt='png', report_formats=<factory>, cache_root=None, history_path=None)

Bases: object

Runtime configuration for the pyCSAMT pipeline engine.

Variables:
  • output_root (str) – Default root directory when no outdir is passed to run().

  • processed_subdir (str) – Sub-directory inside output_root that receives the processed EDI files.

  • plots_subdir (str) – Sub-directory inside output_root that receives all QC figures, organised into one sub-folder per pipeline step.

  • on_step_error (str) – Behaviour when a step raises an exception. "raise" re-raises immediately; "warn" logs a warning and continues with the previous sites; "skip" is silent.

  • save_intermediate (bool) – If True, EDI files are also written after each step (into plots_subdir/<step>/edi_snapshot/).

  • show_progress (bool) – Enable console progress output while the pipeline runs.

  • progress_style (str) – "bar" – tqdm-style progress bar (requires tqdm; falls back to "log" when unavailable). "log" – one line per step. "silent" – no output. "rich" – a live-updating rich.table.Table showing every step’s status (pending/running/OK/ERR/cached) at once, rewritten in place as the run progresses. See Live Observability.

  • repr_width (int) – Character width used when printing the pipeline summary.

  • plot_dpi (int) – DPI for saved figures.

  • plot_fmt (str) – File extension / format for saved figures ("png", "pdf", "svg").

  • report_formats (tuple) – Sequence of report types to write. Each item must be "html", "txt", or "dashboard". "dashboard" writes a richer, branded dashboard.html with KPI stat tiles and inline-SVG charts (step status, per-step duration, site-count flow) — see Pipeline Outputs.

  • cache_root (str | None) – Default root directory for the pipeline step cache (StepCache) when run() is called with cache=True. None resolves lazily to ~/.pycsamt/pipeline_cache.

  • history_path (str | None) – Default file for the run history log (load_history()) when run() is called with history=True. None resolves lazily to ~/.pycsamt/pipeline_history.jsonl.

Parameters:
  • output_root (str)

  • processed_subdir (str)

  • plots_subdir (str)

  • on_step_error (str)

  • save_intermediate (bool)

  • show_progress (bool)

  • progress_style (str)

  • repr_width (int)

  • plot_dpi (int)

  • plot_fmt (str)

  • report_formats (tuple)

  • cache_root (str | None)

  • history_path (str | None)

output_root: str = 'pipe_results'
processed_subdir: str = 'processed'
plots_subdir: str = 'plots'
on_step_error: str = 'warn'
save_intermediate: bool = False
show_progress: bool = True
progress_style: str = 'bar'
repr_width: int = 80
plot_dpi: int = 150
plot_fmt: str = 'png'
report_formats: tuple
cache_root: str | None = None
history_path: str | None = None
configure(**kw)

Set one or more configuration attributes by keyword.

Parameters:

kw (Any)

Return type:

None

context(**kw)

Temporarily override config values, then restore them.

Parameters:

kw (Any)

Return type:

Generator[PipelineAPIConfig, None, None]

reset()

Restore all attributes to package defaults.

Return type:

None

clone()

Return a deep copy of this config.

Return type:

PipelineAPIConfig

pycsamt.api.pipe.configure_pipe(**kw)

Configure the global PYCSAMT_PIPE singleton.

Parameters:

kw (Any)

Return type:

None

pycsamt.api.pipe.reset_pipe()

Reset PYCSAMT_PIPE to package defaults.

Return type:

None