Skip to content

chore: sync main — presentation coverage for print_summary/plot_summary - #283

Merged
Polichinel merged 2 commits into
mainfrom
development
Aug 13, 2026
Merged

chore: sync main — presentation coverage for print_summary/plot_summary#283
Polichinel merged 2 commits into
mainfrom
development

Conversation

@Polichinel

Copy link
Copy Markdown
Contributor

Brings #282 to main: 14 presentation tests for PosteriorDistributionAnalyzer.print_summary()/plot_summary() (the #260 gap left by pipeline-core #316's relic-suite pruning), the RED-proven call-time-stdout fix in print_summary, and the CIC Test Alignment correction.

Test/doc change plus one behavior fix that only affects redirected-stdout callers (none exist in either repo); no release needed — next version bump will carry it.

The diff is exactly the just-reviewed #282 content (two adversarial review rounds + fixes, third round clean).

Closes #260

🤖 Generated with Claude Code

Polichinel and others added 2 commits August 13, 2026 03:26
#260)

pipeline-core #316 pruned their relic suite — the ONLY tests anywhere for
the analyzer's presentation methods. This adds the coverage in the repo
that owns the code (tests/test_statistics_presentation.py, 14 tests):

- print_summary: before-analyze guard; CURRENT labels ("Point estimate
  (tower tip)", the relic still asserted the pre-tower "MAP estimate");
  printed values/formats match the summary dict; one HDI line per PINNED
  mass; call-time stdout resolution (redirect respected).
- plot_summary: before-analyze guard returns None; Figure structure (point
  line at the tip, legend "% HDI" label per pinned mass); show=False/True
  semantics; bimodal title caveat (flag injected both directions —
  detection is the tower's contract, not ours); save_path verified by a
  REAL PNG write (existence + magic bytes + size) — the relic mocked
  savefig, which is how "silently stops writing files" escapes.

Every summary key the methods consume is exercised end-to-end through
analyze(), so the next key rename fails here first, not as a KeyError at
report-generation time (#260's stated bite).

Fix the tests caught (RED-proven): print_summary's `file: TextIO =
sys.stdout` default froze the IMPORT-time stream, silently bypassing later
redirection (pytest capture, contextlib.redirect_stdout). Now
`Optional[TextIO] = None`, resolved to the current sys.stdout at call
time. No caller passed `file` explicitly (both repos grepped).

Riders: CIC Test Alignment section corrected (it attributed presentation
coverage to classes that don't exist — TestPDAPresentation/
TestPDAFailureModes/TestPDAInteractiveSafety); print_summary docstring
Example/Note updated to the actual output.

Closes #260

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…erage

test(statistics): presentation coverage for print_summary/plot_summary (#260)
@Polichinel
Polichinel merged commit cf65fe2 into main Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coverage gap: PosteriorDistributionAnalyzer.print_summary()/plot_summary() untested in either repo (pipeline-core #316 fallout)

1 participant