Closed csbrasnett closed 4 days ago
Since Vermouth generates a vermouth.molecule.Choice object you need to do the check using Choice.match. Calling @pckroon for some advise of comparing resnames using choice objects.
Use vermouth.molecule.attributes_match
to compare node dictionaries. E.g. attributes_match(my_node, {'resname': Choice(['ALA', 'GLY']), 'resid': 23}
. Note that all attributes specified in the second dictionary must be in the first dict (or have value None
) and match. In the example that means that the dictionary my_node
must have the attributes 'resname' and 'resid', and the resname must be either 'ALA' or 'GLY', and the resid must be 23.
I think this addresses everything now, let me know your thoughts. One point of concern - when I was looking at doing a test for the final missing part of the codecov report, I can't see a 'from_itp' key in the node dictionary for the test molecules, even though they have been? Looking at meta_molecule.py I'm not sure how/where this is added anyway?
with the -ter flag, add modifications read from the force field to the n and c termini