-
Notifications
You must be signed in to change notification settings - Fork 33
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 geometric mean error in HOOMD forcefield #727
Fix geometric mean error in HOOMD forcefield #727
Conversation
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
==========================================
- Coverage 92.05% 92.04% -0.01%
==========================================
Files 66 66
Lines 6353 6352 -1
==========================================
- Hits 5848 5847 -1
Misses 505 505
☔ View full report in Codecov by Sentry. |
Thanks for working on this @marjanAlbouye! We should probably have a unit test where at least one of the sigmas and/or epsilons are zero. |
…so into hoomd_ff_geometric_mean
for more information, see https://pre-commit.ci
…so into hoomd_ff_geometric_mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for finding and fixing this bug!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks :)
This PR fixes the error raised by
statistics.geometric_mean()
when sigma or epsilon parameters are zero. Statistics package uses the logscale equation to calculate geometric mean but that only works for non-zero positive values, because ln(0) is undefined.This PR uses the non logarithmic equation for calculating the geometric mean.