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

[BUG] create_from_pertfile uses next instead of continue when skipping atoms that don't match the perturbation template #179

Closed
lohedges opened this issue Mar 15, 2024 · 2 comments · Fixed by #180
Assignees
Labels
bug Something isn't working

Comments

@lohedges
Copy link
Contributor

When matching atoms to the perturbation template the current code incorrectly uses next to skip the atom in the case of a mismatch (see here). This will raise cause an Exception to be raised if the first atom in the molecule isn't in the atoms section of the pert file, i.e. it is unperturbed. However, if there is a later mismatch, then the wrong values of the end state charge,LJ, and ambertype will be applied to the atom. The solution is to replace next with continue.

@lohedges lohedges added the bug Something isn't working label Mar 15, 2024
@lohedges lohedges self-assigned this Mar 15, 2024
@lohedges
Copy link
Contributor Author

On a related not, I'm not sure if the error message that is printed when the atom is skipped is too useful. (Perhaps this is for debugging.) Since the atom records in the pert file only contains perturbing atoms, there will likely be many situations where atoms in the topology aren't matched. Perhaps there could be a verbose mode that prints what did and didn't match so that the user can cross-reference if they wish?

@chryswoods
Copy link
Contributor

Thanks - good catch :-)

Yes, that error message was left over from debugging. I'll remove it and will then merge into devel.

chryswoods added a commit that referenced this issue Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants