panels.candidates

Candidates panel: ranked causality candidates and the pre-refine delta.

Renders the causality_candidates artifact (retained/filtered counts, a per-candidate score-breakdown chart, and per-candidate detail) and, when a pre-refine snapshot is available, a v1 to v2 ranking-delta table.

Attributes

JsonDict

_SCORE_KEYS

Functions

_rank_candidates(cands)

_candidate_by_id(cands, cid)

build_score_breakdown_chart(candidates_list, ...[, title])

Build a grouped bar chart of each candidate's component scores.

render_candidates_panel(causality_candidates[, pre_refine])

Render the Candidates section.

Module Contents

panels.candidates.JsonDict[source]
panels.candidates._SCORE_KEYS = ('structural', 'temporal', 'telemetry', 'evidence', 'governance')[source]
panels.candidates._rank_candidates(cands)[source]
Parameters:

cands (List[JsonDict])

Return type:

Dict[str, int]

panels.candidates._candidate_by_id(cands, cid)[source]
Parameters:
Return type:

Optional[JsonDict]

panels.candidates.build_score_breakdown_chart(candidates_list, scoring_config, title='Score breakdown (retained candidates)')[source]

Build a grouped bar chart of each candidate’s component scores.

@ In, candidates_list, list, causality_candidates.candidates rows; each

row’s scores dict supplies the structural/temporal/telemetry/ evidence/governance values (first 12 candidates shown)

@ In, scoring_config, dict, optional thresholds (minimum_evidence_threshold,

minimum_composite_threshold) drawn as reference lines

@ In, title, str, chart title @ Out, fig, plotly.graph_objects.Figure, the chart, or None if no candidates

Parameters:
  • candidates_list (List[JsonDict])

  • scoring_config (Optional[JsonDict])

  • title (str)

Return type:

Optional[plotly.graph_objects.Figure]

panels.candidates.render_candidates_panel(causality_candidates, pre_refine=None)[source]

Render the Candidates section.

@ In, causality_candidates, dict, the (post-refine) causality_candidates

artifact; reads candidates, filtered_out_candidates, event_analogs, provenance, scoring_config/screening

@ In, pre_refine, dict, optional causality_candidates_pre_refine snapshot

used to render the v1 to v2 ranking-delta table

@ Out, None

Parameters:
Return type:

None