Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Guard against nan in test stat calculation #1993

Merged
merged 5 commits into from
Sep 9, 2022

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Sep 9, 2022

Description

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Guard against nan from division by zero in pyhf.infer.calculators.AsymptoticCalculator.teststatistic.
* Add use of 'less than or equal to' to docs for tests stats to match equations 14
  and 16 of https://arxiv.org/abs/1007.1727.
* Add tests to ensure that nan conditions in Issue #529 and Issue #1992 are not possible.

@matthewfeickert matthewfeickert added the fix A bug fix label Sep 9, 2022
@matthewfeickert matthewfeickert self-assigned this Sep 9, 2022
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Sep 9, 2022

@masonproffitt I'll bring this out of draft in the morning my time, but I'm about to go to bed.

This needs:

  • Verification and agreement across the devs.
  • To have a test that will ensure that a nan isn't created.

@matthewfeickert matthewfeickert added the tests pytest label Sep 9, 2022
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 98.28% // Head: 98.28% // No change to project coverage 👍

Coverage data is based on head (9d6e7f9) compared to base (287bfae).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1993   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files          68       68           
  Lines        4479     4479           
  Branches      730      730           
=======================================
  Hits         4402     4402           
  Misses         45       45           
  Partials       32       32           
Flag Coverage Δ
contrib 27.61% <ø> (ø)
doctest 61.30% <ø> (+0.04%) ⬆️
unittests-3.10 96.22% <ø> (ø)
unittests-3.7 96.20% <ø> (ø)
unittests-3.8 96.24% <ø> (ø)
unittests-3.9 96.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pyhf/infer/calculators.py 100.00% <ø> (ø)
src/pyhf/infer/test_statistics.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matthewfeickert matthewfeickert changed the title fix: Use '<=' over '<' to avoid nan in test stat calculation fix: Guard against nan in test stat calculation Sep 9, 2022
@matthewfeickert matthewfeickert added the docs Documentation related label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related fix A bug fix tests pytest
Projects
None yet
2 participants