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) .
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