asp_plot.report_pipeline#

Declarative report pipeline for the asp_plot CLI.

This module decouples the report-generation pipeline from Click. The CLI (asp_plot.cli.asp_plot) parses options, packs them into a ReportConfig, and calls run_report() – which is importable and callable from notebooks and tests without any Click context.

The body of the report is a declarative section registry (REPORT_SECTIONS): each entry is a ReportSpec pairing an enabled(ctx) predicate with a build(ctx) function that returns the report sections to append. The orchestrator iterates the registry in order, so section ordering and figure numbering are data, not source-line position. Captions live in asp_plot.report_captions.

Attributes#

Classes#

ReportConfig

All inputs needed to generate a report, decoupled from Click.

ReportContext

Mutable runtime state shared across section builders.

ReportSpec

One declarative report section.

Functions#

run_report(→ str)

Generate the ASP processing report described by config.

Module Contents#

class asp_plot.report_pipeline.ReportConfig#

All inputs needed to generate a report, decoupled from Click.

Field names and defaults mirror the CLI options one-for-one so the Click wrapper can splat its parsed params straight in.

add_basemap: bool = True#
altimetry_csv: str | None = None#
atl06sr_time_range: str = 'all'#
bundle_adjust_directory: str | None = None#
dem_filename: str | None = None#
dem_gsd: float | None = None#
directory: str = './'#
map_crs: str | None = None#
pc_align: bool = True#
plot_altimetry: bool = True#
plot_geometry: bool = True#
plot_icesat: object | None = None#
reference_dem: str | None = None#
report_command: str | None = None#
report_filename: str | None = None#
report_title: str | None = None#
reuse_selections: str | None = None#
stereo_directory: str = 'stereo'#
subset_km: float = 1.0#
class asp_plot.report_pipeline.ReportContext#

Mutable runtime state shared across section builders.

Built once by _setup_context(), then threaded through every ReportSpec so builders can pull shared plotters/selections and draw sequential figure filenames without a module-global counter.

fig_path(fig_fn: str) str#
next_fig_fn() str#

Next sequential NN.png figure filename (00, 01, 02, …).

asp_dem: str | None#
config: ReportConfig#
ctx_kwargs: dict#
icesat2_selections: dict | None = None#
map_crs: str | None#
plot_altimetry: bool#
plots_directory: str#
report_metadata: asp_plot.report.ReportMetadata | None = None#
report_pdf_path: str#
report_title: str#
reuse_clip_windows: list | None = None#
reuse_clip_windows_crs: str | None = None#
reuse_parquet: object | None = None#
reuse_segments: object | None = None#
reuse_track: dict#
stereo_plotter: asp_plot.stereo.StereoPlotter#
class asp_plot.report_pipeline.ReportSpec#

One declarative report section.

enabled(ctx) gates the section on config/runtime state; build(ctx) runs the plotting and returns the ReportSection / AlignmentReportPage objects to append (possibly several, possibly none).

build: Callable[[ReportContext], List[object]]#
enabled: Callable[[ReportContext], bool]#
name: str#
asp_plot.report_pipeline.run_report(config: ReportConfig) str#

Generate the ASP processing report described by config.

Builds the runtime context, iterates the declarative REPORT_SECTIONS registry to assemble the report body, compiles the PDF, writes the figure-selections sidecar, and cleans up. Returns the path to the written PDF. Importable and callable without any Click context.

asp_plot.report_pipeline.REPORT_SECTIONS: List[ReportSpec]#