choderalab / openmoltools

An open set of tools for automating tasks relating to small molecules
MIT License
63 stars 30 forks source link

Fixes `packmol` module compatibility with recent OpenMM and MDTraj versions #294

Closed davidlmobley closed 4 years ago

davidlmobley commented 4 years ago

Relatively recently, OpenMM added bond order handling, but our packmol module had not been updated to handle this, causing failures -- specifically, the bonds array passed into mdtraj.topology.from_dataframe now has four entries per bond ( (atom1, atom2, type1, order)) but the logic here was still treating it as if it only contained atoms. This resulted in type1 and order getting set to numbers larger than or equal to the number of atoms in the system, causing downstream failures.

This fixes the issue.

davidlmobley commented 4 years ago

Would love a timely review and merge from someone, as I am using this for a class I'm teaching, and this issue had broken some functionality I was using.

davidlmobley commented 4 years ago

(With the exception of one import, changes are isolated to around line 192, but Atom also seems to have stripped out a few trailing spaces in the process. Apologies for the slightly messy changelog.)