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: Don't use exact assert for test_probability.py #1252

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Jan 13, 2021

Description

To avoid the issues with floating point comparison out to 15 decimal places that started surfacing with the release of jaxlib v0.1.58 don't use exact asserts for floating point comparison in test_probability.py. atol=1e-12 was chosen as that is well beyond the floating point precision that should matter for comparion here, but not up to the 1e-15 or so that caused the difference.

Also remove redundant test added by mistake in PR #582

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
* Use np.allclose with an absolute tolerance of 1e-12 instead of exact assert to compare floating point values in test_probability.py
   - Applies to tests test_joint and test_independent
* Remove redundant test added by mistake in PR #582

@matthewfeickert matthewfeickert added tests pytest fix A bug fix labels Jan 13, 2021
@matthewfeickert matthewfeickert self-assigned this Jan 13, 2021
@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #1252 (397a5d7) into master (8c4d1ba) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1252   +/-   ##
=======================================
  Coverage   97.47%   97.47%           
=======================================
  Files          63       63           
  Lines        3716     3716           
  Branches      525      525           
=======================================
  Hits         3622     3622           
  Misses         55       55           
  Partials       39       39           
Flag Coverage Δ
unittests 97.47% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c4d1ba...397a5d7. Read the comment docs.

@kratsg kratsg merged commit df40fe4 into master Jan 13, 2021
@kratsg kratsg deleted the fix/no-exact-assert-test-independent branch January 13, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A bug fix tests pytest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated assert in test_independent unit test
3 participants