2.27.2.12. pycsamt.pipeline._output#
Output-directory management for the pyCSAMT pipeline.
OutputDir creates and manages the canonical directory tree produced
by a pipeline run:
<root>/
├── processed/ ← final EDI files (config: processed_subdir)
├── plots/ ← QC figures, one sub-folder per step
│ ├── 01_notch/
│ │ ├── harmonic_waterfall.png
│ │ └── snr_gain_profile.png
│ └── 02_select_band/
│ └── band_microstrips.png
├── pipeline.yaml ← reproduced config for reproducibility
├── report.html
└── summary.txt
The directory is created lazily when OutputDir.setup() is called.
Nothing is written until that point so that a pipeline that only runs in
memory (outdir=None) produces no filesystem side-effects.
Classes
|
Manages the output directory tree for a single pipeline run. |
- class pycsamt.pipeline._output.OutputDir(root, *, api=None)[source]
Bases:
objectManages the output directory tree for a single pipeline run.
- Parameters:
root (str | Path | None) – Root path. If
None, falls back tooutput_root.api (Any) – A
PipelineAPIConfiginstance. WhenNone, the globalPYCSAMT_PIPEsingleton is used.
- setup()[source]
Create the directory tree. Safe to call multiple times.
- Return type:
None
- step_plot_dir(idx, step_name)[source]
Return (and create) the plot sub-directory for step idx.
- save_figure(fig, fn_name, step_idx, step_name, *, api=None)[source]
Save fig into the step’s plot sub-directory.
- Parameters:
fig (matplotlib.figure.Figure) – Matplotlib figure to save.
fn_name (str) – Name used as the filename stem (derived from the QC function name).
step_idx (int) – 1-based step position.
step_name (str) – Step label (used for the sub-folder name).
api (Any) – Config override.
- Returns:
The path where the figure was saved, or
Noneon failure.- Return type:
Path or None
- write_edis(sites)[source]
Write processed EDI files to the
processed/sub-directory.Uses
pycsamt.site.export.write_sites().
- save_pipeline_config(yaml_str)[source]
Write yaml_str as
pipeline.yamlin the root directory.