mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
53 stars 32 forks source link

Update connection members during parameterization #808

Closed CalCraven closed 4 months ago

CalCraven commented 4 months ago

Add tests and change behavior when applying types, update connection connection_members from types.

This addressed a bug found by @bc118 using NAMD, which write the indices of impropers which must match with the types of the improper types listed.

image

This screenshot identifies the issues most clearly with impropers. Order is only enforced from identifying the improper in the forcefield. As such, we have to do reordering once the improper_type is identified.

This is a potentially impactful issue if using improper in GMSO. Anyone doing so should check that the improper atoms in their output files are ordered as expected, with the central atom first, and the last atom last.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 92.85714% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.45%. Comparing base (69fd5e2) to head (0a8b944).

Files Patch % Lines
gmso/utils/sorting.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #808 +/- ## ========================================== + Coverage 92.44% 92.45% +0.01% ========================================== Files 66 66 Lines 7024 7036 +12 ========================================== + Hits 6493 6505 +12 Misses 531 531 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.