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>)[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.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"or"txt".
- Parameters:
- 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]