Skip to content

Conversation

@ConnorStoneAstro
Copy link
Owner

No description provided.

@ConnorStoneAstro ConnorStoneAstro requested a review from Copilot June 13, 2025 01:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a warning mechanism to the coverage test to alert users when their posterior is under- or overconfident.

  • Introduces a new confidence_alert helper in utils.py
  • Exposes a warn_confidence parameter in pted_coverage_test and calls confidence_alert
  • Updates README with guidance on interpreting confidence test results

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/pted/utils.py Added confidence_alert function and imported warn
src/pted/pted.py Added warn_confidence parameter, imported confidence_alert
README.md Documented interpreting coverage test and warning behavior
Comments suppressed due to low confidence (4)

README.md:165

  • The README refers to warn_coverage but the code uses warn_confidence; update the docs to match the parameter name.
if the `warn_coverage` parameter is not `None`.

src/pted/pted.py:279

  • No tests cover the new warning logic. Consider adding unit tests to verify that confidence_alert correctly warns on under- and overconfidence.
if warn_confidence is not None:

src/pted/utils.py:211

  • chi2_dist is not imported in utils.py, causing a NameError when calling confidence_alert. Add from scipy.stats import chi2 as chi2_dist at the top of the file.
left_tail = chi2_dist.cdf(chi2, df)

src/pted/pted.py:157

  • Optional is used in the signature but not imported; add from typing import Optional to the imports.
warn_confidence: Optional[float] = 1e-3,

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6641406) to head (4d55ce7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #4   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          212       224   +12     
=========================================
+ Hits           212       224   +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ConnorStoneAstro ConnorStoneAstro merged commit 574b387 into main Jun 13, 2025
12 checks passed
@ConnorStoneAstro ConnorStoneAstro deleted the warnconfidence branch June 13, 2025 15:18
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.

3 participants