diff --git a/polyply/src/molecule_utils.py b/polyply/src/molecule_utils.py index a960ca85..f4249d74 100644 --- a/polyply/src/molecule_utils.py +++ b/polyply/src/molecule_utils.py @@ -286,6 +286,10 @@ def find_termini_mods(meta_molecule, molecule, force_field): for attr in ['atype', 'mass']: if target_attrs[attr] != ref_attrs[attr]: replace_dict[node][attr] = target_attrs[attr] + # a little dangerous but mostly ok; if there are no changes to + # the atoms we can continue + if len(replace_dict) == 0: + continue # bonded interactions could be different too so we need to check them overwrite_inters = defaultdict(list)