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 geometric mean error in HOOMD forcefield #727

Merged
merged 7 commits into from
May 10, 2023

Conversation

marjanalbooyeh
Copy link
Contributor

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.

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (1e9a664) 92.05% compared to head (9a3c197) 92.04%.

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              
Impacted Files Coverage Δ
gmso/external/convert_hoomd.py 91.47% <100.00%> (-0.02%) ⬇️

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

@chrisjonesBSU
Copy link
Contributor

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.

Copy link
Member

@daico007 daico007 left a 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!

Copy link
Contributor

@chrisjonesBSU chrisjonesBSU left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks :)

@daico007 daico007 merged commit bf81523 into mosdef-hub:main May 10, 2023
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