spacr.run_recommendations

Generate reproducible recommendations from regression diagnostics.

Each recommendation is a fixed rule triggered by a measured threshold. The result names the setting to change, the proposed action, the evidence that triggered it, and whether the issue blocks interpretation. Rules that do not fire are omitted, so the summary contains only actions supported by the current run.

Classes

Recommendation

One thing to change, why, and how strongly.

Functions

format_recommendations(→ str)

Format recommendations for the end of a run summary.

recommend(→ List[Recommendation])

Derive recommendations from a run's measured diagnostics.

Module Contents

class spacr.run_recommendations.Recommendation[source]

One thing to change, why, and how strongly.

Parameters:
  • setting – spaCR setting key the recommendation proposes changing.

  • action – human-readable proposed value or action; it is display prose and is not applied automatically.

  • because – measured evidence explaining why the recommendation fired.

  • severity – "blocking" for a result that should not be trusted until addressed; "consider" by default, with every other value rendered as advisory.

line() → str[source]

Return the two-line display block for this recommendation.

spacr.run_recommendations.format_recommendations(items: List[Recommendation]) → str[source]

Format recommendations for the end of a run summary.

Parameters:

items – ordered run recommendations to render.

An empty input is reported explicitly so a completed check with no recommendations is distinguishable from a missing result.

spacr.run_recommendations.recommend(diagnostics: Mapping[str, Any], *, settings: Mapping[str, Any] | None = None) → List[Recommendation][source]

Derive recommendations from a run’s measured diagnostics.

Parameters:
  • diagnostics – the numbers the QC computed.

  • settings – settings used for the run. Recommendations already satisfied by these values are omitted.

Returns:

the recommendations that fired, blocking ones first.