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

added Forcefield.apply assert_bonds #199

Merged
merged 3 commits into from
Feb 22, 2019

Conversation

richardjgowers
Copy link
Contributor

No description provided.

@mattwthompson mattwthompson requested a review from summeraz January 3, 2019 16:06
@mattwthompson
Copy link
Member

Thanks for the contribution!

My understand was that it's supposed to get caught earlier (see here) but I know you're dealing with topologically different systems than we were using back then. I'm a little fuzzy on this so I will let @summeraz comment.

@richardjgowers
Copy link
Contributor Author

It looks like that comment says it gets picked up in the MD engine later on. Arguably this is a thing for foyer to spot.

Looks like this change breaks an existing test, I think you all can push to this branch to fix

Copy link
Contributor

@summeraz summeraz left a comment

Choose a reason for hiding this comment

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

Thanks @richardjgowers! So the reason this wasn't added in #155 was because (at least at that time) if parameters were not provided in the Foyer XML for all bonds, an error was raised by OpenMM within createSystem. Can you add a unit test for what you've added here? My guess is that things will break before reaching the _error_or_warn line you've added.

@richardjgowers
Copy link
Contributor Author

@summeraz I've added a test, it's possible to do Forcefield.apply() and get bonds with no parameters

@justinGilmer justinGilmer merged commit 63083b1 into mosdef-hub:master Feb 22, 2019
@mikemhenry
Copy link
Member

mikemhenry commented Feb 22, 2019

Why did this PR get merged in with a failing test?

test_surface FAILED 
E           Exception: Parameters have not been assigned to all bonds. Total system bonds: 2303, Parametrized bonds: 2178

@mattwthompson
Copy link
Member

Oops, that was sloppy. We thought it was one of the tests that can fail for silly reasons, but on further inspection it's actually something we need to change. Thanks for catching this

mattwthompson added a commit that referenced this pull request Feb 22, 2019
@mikemhenry
Copy link
Member

No worries! I was just surprised that while I was working on another PR, that test started to fail. It looks like this PR was really needed, since one of the tests didn't have all the bonds defined.

@mattwthompson
Copy link
Member

Yeah, of all the things that can happen with failing units tests, finding and fixing an unrelated issue is among the better outcomes

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.

5 participants