Skip to content

Add unit tests for coverage_curve()#51

Merged
jc-macdonald merged 1 commit intomainfrom
test/issue-6-coverage-curve
Apr 9, 2026
Merged

Add unit tests for coverage_curve()#51
jc-macdonald merged 1 commit intomainfrom
test/issue-6-coverage-curve

Conversation

@jc-macdonald
Copy link
Copy Markdown
Contributor

Summary

Unit tests for coverage_curve() — empirical coverage across nominal levels.

Closes #6

Changes

  • Return types: returns two numpy arrays
  • Default levels: 50 evenly spaced points from 0.05 to 0.99
  • Custom levels: accepts user-specified level array
  • Monotonicity: empirical coverage is non-decreasing
  • Well-calibrated: posteriors drawn from same distribution give coverage near the diagonal (max deviation < 0.15)
  • Bounded: all empirical values in [0, 1]
  • Degenerate posteriors: point mass at truth gives 100% coverage at all levels

Stats

  • 7 new tests in tests/test_scoring.py (50 total)
  • scoring.py coverage: 0% → 44%
  • Total coverage: 67.30% → 68.34%
  • just ci passes (format, lint, mypy strict, coverage)

Test return types, default and custom levels, monotonicity, well-
calibrated posteriors near the diagonal, [0,1] bounds, and degenerate
posteriors (point mass at truth).

Closes #6
@jc-macdonald jc-macdonald merged commit 76b428b into main Apr 9, 2026
3 checks passed
@jc-macdonald jc-macdonald deleted the test/issue-6-coverage-curve branch April 9, 2026 19:45
@jc-macdonald jc-macdonald added test Test coverage improvement scoring scoring.py module labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scoring scoring.py module test Test coverage improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests for coverage_curve()

1 participant