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

Update energy tests #11

Merged
merged 10 commits into from
Mar 8, 2024
Merged

Update energy tests #11

merged 10 commits into from
Mar 8, 2024

Conversation

mattwthompson
Copy link
Contributor

This is a follow-on to #4 with just a couple of substantive changes

  • The water dimer evaluation helper in smirnoff-plugins makes incorrect assumptions about atom/particle ordering, so I just ported it over to here with the right order.
  • For relatively simple energy evaluations, Interchange's OpenMM function seems to work fine

ref_energies = [1005.0846252441406, 44.696786403656006, 10.453390896320343]

for found, ref in zip(found_energies, ref_energies):
assert found.m_as(kj_mol) == pytest.approx(ref, rel=1e-3)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note this is a fairly loose tolerance; I was getting errors like these if I used the defaults. How exactly these energies have drifted slightly from their artisan hand-crafted values a couple of years back, I'm not sure

$ python -m pytest -v deforcefields/tests/test_deforcefields.py::test_energy_sites | grep "E    "
E       assert 1005.0861476907567 == 1005.0846252441406 ± 1.0e-03
E
E         comparison failed
E         Obtained: 1005.0861476907567
E         Expected: 1005.0846252441406 ± 1.0e-03
E       assert 44.69819545912324 == 44.696786403656006 ± 4.5e-05
E
E         comparison failed
E         Obtained: 44.69819545912324
E         Expected: 44.696786403656006 ± 4.5e-05
E       assert 10.454626091527247 == 10.453390896320343 ± 1.0e-05
E
E         comparison failed
E         Obtained: 10.454626091527247
E         Expected: 10.453390896320343 ± 1.0e-05

Copy link
Owner

Choose a reason for hiding this comment

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

I think the original values were calculated using the toolkit pre-interchange but maybe its time to do them by hand to double check, for now though this is a great match!

Copy link
Owner

@jthorton jthorton left a comment

Choose a reason for hiding this comment

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

Fantastic work @mattwthompson, hopefully, this should be the end oV-site-site issues!

@jthorton jthorton merged commit eb99f5e into jthorton:main Mar 8, 2024
6 checks passed
@mattwthompson
Copy link
Contributor Author

Hopefully!

If everything's up to date, could we get a release (maybe 1.0.2?) to get this rolled out to the "new" infrastructure? I'm happy to do the feedstock PR, but I'm not going to tag a release on one of your projects 😅

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.

2 participants