Add PIT (Probability Integral Transform) plot to pted_coverage_test#16
Conversation
Agent-Logs-Url: https://github.com/ConnorStoneAstro/pted/sessions/c34db391-d3e0-45dc-96af-461051196d9f Co-authored-by: ConnorStoneAstro <78555321+ConnorStoneAstro@users.noreply.github.com>
pted and pted_coverage_test
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
==========================================
+ Coverage 97.87% 98.05% +0.17%
==========================================
Files 4 4
Lines 329 359 +30
==========================================
+ Hits 322 352 +30
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
|
@copilot could you add a monkeypatch test for the pit utility to cover the case where matplotlib is not available? It should check that the warning is properly thrown |
Agent-Logs-Url: https://github.com/ConnorStoneAstro/pted/sessions/94059e7f-7b1d-4c51-988b-4c79de3c2490 Co-authored-by: ConnorStoneAstro <78555321+ConnorStoneAstro@users.noreply.github.com>
Added |
There was a problem hiding this comment.
Pull request overview
Adds a Probability Integral Transform (PIT) plotting capability intended to help visually assess uniformity/calibration of per-simulation p-values produced by PTED coverage testing.
Changes:
- Introduces
pit_plot(...)insrc/pted/utils.py(with KS-style confidence band and KS test annotation) and exports it via__all__. - Extends
pted_coverage_test()withpit_plot/pit_confidenceparameters to optionally write a PIT plot file. - Adds/updates tests and README documentation covering the new PIT plotting behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/pted/utils.py |
Adds pit_plot utility and exports it. |
src/pted/pted.py |
Adds optional PIT plot output to pted_coverage_test(). |
tests/test_pted.py |
Adds tests for PIT plotting via coverage test and direct utility call. |
tests/test_utils.py |
Adds test asserting a warning when matplotlib is unavailable for PIT plotting. |
README.md |
Documents PIT plot parameters and usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pted and pted_coverage_testpted_coverage_test
Agent-Logs-Url: https://github.com/ConnorStoneAstro/pted/sessions/c63d7cf2-32ae-4f01-9616-46fd8992abe6 Co-authored-by: ConnorStoneAstro <78555321+ConnorStoneAstro@users.noreply.github.com>
|
pit_plot(pvals, saveto, confidence=0.95)utility function toutils.pywith KS confidence bandspit_plotinutils.py__all__pit_plot/pit_confidenceparameters topted_coverage_test()inpted.pytests/test_pted.pyandtests/test_utils.pypit_confidencedefault in signature block corrected from0.9to0.95(matches code)utils.py: ravelpvalsonce afterasarrayso sort andkstestalways operate on a 1-D array