2.2.3.12. pycsamt.api.pipe.config#
Global pipeline configuration for pyCSAMT.
Centralises all output, display, and execution settings used by
pycsamt.pipeline. Follows the same singleton + configure/reset
pattern as the rest of pycsamt.api.
Examples
Override output format temporarily:
from pycsamt.api.pipe import PYCSAMT_PIPE
with PYCSAMT_PIPE.context(plot_dpi=300, plot_fmt="pdf"):
result = pipeline.run(sites)
Change global defaults:
from pycsamt.api.pipe import configure_pipe
configure_pipe(output_root="my_project/results", show_progress=False)
Functions
|
Configure the global |
|
Reset |
Classes
|
Runtime configuration for the pyCSAMT pipeline engine. |
- class pycsamt.api.pipe.config.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)[source]
Bases:
objectRuntime 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 (intoplots_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-updatingrich.table.Tableshowing 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, brandeddashboard.htmlwith 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) whenrun()is called withcache=True.Noneresolves lazily to~/.pycsamt/pipeline_cache.history_path (str | None) – Default file for the run history log (
load_history()) whenrun()is called withhistory=True.Noneresolves lazily to~/.pycsamt/pipeline_history.jsonl.
- Parameters:
- 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
- configure(**kw)[source]
Set one or more configuration attributes by keyword.
- Parameters:
kw (Any)
- Return type:
None
- context(**kw)[source]
Temporarily override config values, then restore them.
- Parameters:
kw (Any)
- Return type:
Generator[PipelineAPIConfig, None, None]
- reset()[source]
Restore all attributes to package defaults.
- Return type:
None
- clone()[source]
Return a deep copy of this config.
- Return type:
- pycsamt.api.pipe.config.configure_pipe(**kw)[source]
Configure the global
PYCSAMT_PIPEsingleton.- Parameters:
kw (Any)
- Return type:
None
- pycsamt.api.pipe.config.reset_pipe()[source]
Reset
PYCSAMT_PIPEto package defaults.- Return type:
None