mosdef-hub / foyer

A package for atom-typing as well as applying and disseminating forcefields
https://foyer.mosdef.org
MIT License
117 stars 76 forks source link

Remove untyped #493

Closed chrisiacovella closed 2 years ago

chrisiacovella commented 2 years ago

PR Summary:

This is a fix to issue #491 https://github.com/mosdef-hub/foyer/issues/491

In short, many forcefields many not have parameters for all possible connections (e.g., no dihedral terms). While setting, e.g., assert_dihedral_params = False, will prevent the code from throwing an error during atomtyping, untyped connections still are left in the topology returned by apply, which will causes the writers to crash. This PR adds remove_untyped_connections argument, that when set to True, will remove untyped connections if the associated connection has assert params set to False (e.g., untyped dihedrals will be removed if assert_dihedral_params = False and remove_untyped_connections = True) .

test_remove_untyped.zip

daico007 commented 2 years ago

@chrisiacovella I think you forgot to commit all the testing XMLs, which are causing the tests to fail.