assess_eligibility

assess_eligibility(
    subjects,
    parameters,
    *,
    forecast_source,
    consensus_source=CONSENSUS_SOURCE,
)

Assess whether each subject is publishable, and record why.

The check order is part of the contract: missing input, then stale prediction, then stale consensus, then too wide a gap. The first match wins.

Parameters

Name Type Description Default
subjects pd.DataFrame One row per subject, with a column per source and an “_age” Timedelta column per age-bounded source. required
parameters AnchoringParameters The coefficient set whose age and gap bounds apply. required
forecast_source str The source compared against consensus. required
consensus_source str The consensus source name. CONSENSUS_SOURCE

Returns

Name Type Description
pd.DataFrame A copy of subjects with an eligible (bool) and an eligibility_reason (string) column added.

Raises

Name Type Description
PanelError A required column is absent.