Skip to content

ump_intake.panel

module ump-intake

Panel build (stage 3): apply the confirmed mapping, aggregate columns that map to the same media id, tie the extracted totals to the printed ones (G-DATA-02), and render the canonical weekly CSV.

Extraction rating (governance framework): exact for machine-readable sources (CSV, inline data, generated demo data, connector rows), parsed for a scripted read of a formatted workbook, read for OCR or AI and retyped for hand typing (both declared by the caller). G-DATA-03 widens read or retyped values that were not double-keyed.

function

def default_rating(kind: str) -> str

Source: packages/ump-intake/src/ump_intake/panel.py, line 26

function

def build_panel(
t: ParsedTable,
mapping: dict[str, str],
printed_override: dict[str, float] | None = None,
*,
tolerance_rel: float = TOTALS_TOLERANCE_REL,
) -> dict[str, Any]

Apply {column: target}. Returns the canonical table, tie-out, aggregation notes and fit hints.

Source: packages/ump-intake/src/ump_intake/panel.py, line 30

function

def tie_out(
t: ParsedTable,
targets: dict[str, str],
rows: list[dict[str, Any]],
kpi_id: str,
media_cols: dict[str, list[str]],
printed_override: dict[str, float] | None,
*,
tolerance_rel: float = TOTALS_TOLERANCE_REL,
) -> dict[str, Any]

G-DATA-02: extracted totals against printed totals, per source column. The headline pair is the column with the largest relative gap, so the gate reflects the worst column.

Source: packages/ump-intake/src/ump_intake/panel.py, line 105

function

def panel_rows(canonical: bytes) -> tuple[list[str], list[list[Any]]]

Read a canonical panel CSV back to (columns, rows) with numbers as floats and dates as ISO text.

Source: packages/ump-intake/src/ump_intake/panel.py, line 136

NameTypeValueDescription
EXTRACTION_RATINGS('exact', 'parsed', 'read', 'retyped')
TOTALS_TOLERANCE_REL0.01§15 G-DATA-02 tie-out tolerance (relative), proposed. Callers may pass their own tolerance_rel.