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

rename x to dz in mud_calculator.py and decrease error tolerance for tests #147

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

yucongalicechen
Copy link
Collaborator

addressed comments in #146
@sbillinge ready for review
@bobleesj let me know if this title is more informative!

@@ -19,4 +19,4 @@ def test_compute_mud(tmp_path):

expected_mud = 3
actual_mud = compute_mud(file)
assert actual_mud == pytest.approx(expected_mud, rel=0.01, abs=0.1)
assert actual_mud == pytest.approx(expected_mud, rel=1e-4, abs=1e-3)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

decrease the error tolerance. I think previously I changed this to 0.01 and 0.1 because I thought about the edge cases like HfO2 wire data. But for the other better data (pretty much all other real data we ran) the error is much lower. So we can have a smaller tolerance here.

Copy link
Contributor

@sbillinge sbillinge Dec 28, 2024

Choose a reason for hiding this comment

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

This is a test, not code, so the logic is that we set the tolerance we want for the test, not some worst case scenario I think, right?

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.31%. Comparing base (bd1dd40) to head (11d2ccd).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #147   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files           6        6           
  Lines         293      293           
=======================================
  Hits          291      291           
  Misses          2        2           
Files with missing lines Coverage Δ
tests/test_mud_calculator.py 100.00% <100.00%> (ø)

@yucongalicechen yucongalicechen changed the title rename x to dz in mud_calculator.py and decrease error range for tests rename x to dz in mud_calculator.py and decrease error tolerance for tests Dec 28, 2024
@bobleesj
Copy link
Contributor

addressed comments in #146

@sbillinge ready for review

@bobleesj let me know if this title is more informative!

Yes, great title! Thanks

@sbillinge sbillinge merged commit a9fbbe5 into diffpy:main Dec 28, 2024
5 checks passed
@yucongalicechen yucongalicechen deleted the mudcalc branch December 28, 2024 14:53
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