diff_diff.BaseResults#

class diff_diff.BaseResults[source]#

Bases: object

Shared base for ESTIMATOR result containers (spec section 5).

Behaviorally inert in 3.9 - a TRANSITIONAL marker base that makes the results contract checkable and anchors the 4.0 storage flip. It does not yet enforce a uniform runtime protocol: most subclasses are scalar estimator results (one canonical quintet), but EventStudyResults is intentionally vector-valued, and a few inherited classes still expose summary() without an alpha argument. Full protocol uniformity (uniform summary(alpha=None), native canonical storage) is enforced in later Phase 2 / 4.0 PRs. The target contract every ESTIMATOR-results subclass converges to:

  • Canonical quintet. att, se, t_stat, p_value, conf_int bound to ONE coherent inference row (native fields or property aliases over legacy overall_*/avg_* storage; the storage flips to native canonical fields at 4.0, ledger rows M-050..M-058, with legacy names living on as FutureWarning properties until 5.0).

  • Serialization. summary(alpha=None), to_dict() (canonical key names only - deprecated names never leak into serialized output), and to_dataframe(level=...) where multiple views exist.

  • Pickle migration. Classes whose stored field names change ship __setstate__ migration following the SyntheticDiDResults.__setstate__ precedent (diff_diff/results.py) so 3.x pickles load under 4.0.

  • Planned estimand self-description hook. The per-class headline semantics (name / definition / aggregation / headline attribute) currently live in _reporting_helpers.describe_target_parameter, keyed by result-class name. A later PR lifts that block onto this base so results self-describe their target parameter (the MMM exporter’s verified allowlist is the first consumer); nothing here constrains that lift.

Diagnostic result containers (spec section 3.5) do NOT inherit this base - they are marked with Diagnostic and are exempt from the quintet by type.

Methods

__init__()#
classmethod __new__(*args, **kwargs)#