stratified_packager.processing.reporting

QGIS-side assembly of the §9 report rows (run-level and per-zip).

Folds the build outcomes held in _BuildState into the row dataclasses of report (which stays qgis-free — it only defines the rows and writes the CSV). Orphan accounting (§9.1) also lives here. Runs on the algorithm thread; user-facing warnings flow through the feedback.

Functions

account_orphans(material, state, ...)

Count features matching no stratum, per partitioned (primary) layer (§9.1).

collect_report_rows(strata, material, state, ...)

Fold worker outcomes into the §9.1 run-report rows.

zip_report_rows(material, members, state)

Build the §9.2 rows of one bundle (vector tables + payload entries).

stratified_packager.processing.reporting._outcome_for(state, stratum_name, prep)[source]

Look up a layer’s outcome, following the dedup-primary indirection (§12).

Parameters:
  • state (_BuildState) – The pool state.

  • stratum_name (str) – The stratum.

  • prep (_LayerPrep) – The (possibly non-primary) member prep.

Return type:

LayerWriteResult | None

Returns:

The outcome of the prep’s own job, or of its group primary’s.

stratified_packager.processing.reporting.account_orphans(material, state, report_rows, feedback)[source]

Count features matching no stratum, per partitioned (primary) layer (§9.1).

Run after the build: the read source’s feature count minus the union of every stratum’s matched fids (accumulated during writing). A staged read source normally holds only the matched union, so it reports zero — correct for the data actually packaged; under EXPORT_FULL_PACKAGE it instead holds every feature (§8.2), so the true orphan count surfaces (those features ship in the <full> package).

Parameters:
Return type:

None

stratified_packager.processing.reporting.collect_report_rows(strata, material, state, report_rows)[source]

Fold worker outcomes into the §9.1 run-report rows.

Parameters:
Return type:

None

stratified_packager.processing.reporting.zip_report_rows(material, members, state)[source]

Build the §9.2 rows of one bundle (vector tables + payload entries).

Parameters:
Return type:

list[ZipReportRow]

Returns:

The rows, member-major.