Skip to content
Increment 0.1.0a6 prerelease documentation. These docs describe the increment 0.1.0a6 prerelease (v0.1.0a6). Its API may change. Install: pip install 'increment==0.1.0a6' Keep any extras requested by the guide, such as increment[dashboard]==0.1.0a6.

Tables (`increment.tables`)

readout_table(data, title, subtitle, theme, nest_by, advisory, show_interval_level, trend, trend_label, trend_max_ylim)

Build a coeftable HTML readout table from lift-estimate rows.

data needs metric, method, lift, lower, higher, stat_sig, group_id (plus segment for nest_by="segment"), as a narwhals-wrappable frame or estimates_to_readout row dicts. Optional columns change the render: estimand labels a non-”itt” row so colliding estimand/metric pairs stay distinct; value_scale="absolute" rows render under “Lift (absolute)” instead of “Lift %” with a blank forest cell; preferred_direction colors a row by the metric’s declared favorability. estimates_to_readout emits explicitly posterior-qualified values which are rendered only when advisory=True; a shifted null_lift also draws a dashed forest reference line. Row notes and reliability/numerical caveats are shown as attributed source notes, with matching markers in Result; their exact source content remains available in the existing evidence details. A run() result or saved result envelope renders its cells with the run’s scope and integrity qualifications; a live confidence-set row renders as render shows it.

A role column with at least one non-None value sections the table by concise role labels (coeftable’s groups= + collapsible_groups=True); see _group_disclosure_column. A role column that is absent, or None on every row (no plan ever declared, for any row), renders ungrouped.

nest_by picks which dimension stacks under each metric row vs. splits into side-by-side columns: "arm" stacks arms/splits by method, "method" stacks methods/splits by arm, "segment" stacks segments/splits by arm (data must already be filtered to one method, or this raises). None (default) picks "segment" when rows of one method carry more than one segment and "arm" otherwise. Segment labels show as written, so the missing-value segment reads __null__ and an empty-string segment reads ""; a segment written as two quote characters reads \"". advisory explicitly renders stored-posterior values with posterior-qualified labels; show_interval_level governs interval-level disclosure - an Interval column when levels differ across rows, or a note appended to subtitle when every row shares one non-95% level (a Bonferroni-corrected breakout reads “all intervals 98.33%” once instead of per row).

trend adds a per-day sparkline: a native frame, or a raw estimate sequence, converted via to_frame and renamed to the main table’s segment column. A metric absent from trend renders a blank cell rather than raising; None (default) omits it.

Raises ValueError if nest_by="segment" and data has more than one method; if visible row keys collide without distinct analysis_population values (the refusal’s route names nest_by="segment" when the colliding rows differ by segment); if trend is missing a required key column or repeats a resolved readout identity at the same ds after scale/population label disambiguation; or if trend mixes incompatible ds_basis values.

The sparkline’s y-domain fit is hardcoded to "robust" (IQR-based) so a noisy early window in a cumulative/as-of series can’t dominate a plain min/max fit and flatten the later trend.

estimates_to_readout(estimates)

Convert estimates into readout rows with explicitly posterior-qualified values.

Rows from a scoped collection also carry view_partial from their source metadata; filtered views remain explicitly partial. Plain lists leave that scope status unknown.

contrast_results_to_readout(results)

Convert fixed switchback contrasts to readout-table row dictionaries.

trend_table(data, title, subtitle, trend_label)

Render calendar metric trends (MetricTrend.to_frame() output).

The headline row per metric (nested by segment when a dimension column is present) shows the latest complete period’s value and CI; the full period series - incomplete tail included - renders as a sparkline beside it. A frame with no complete period falls back to the latest period available.