Skip to content

Commit

Permalink
Update rather than add and remove.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 3, 2024
1 parent 41ce413 commit 4c9c19f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/somd2/_utils/_somd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,7 @@ def _apply_pert(system, pert_file):
if not is_pert:
raise ValueError(f"Failed to apply the perturbation in '{pert_file}'.")

# Replace the reference molecule with the perturbed molecule.
system.remove(mol)
system.add(pert_mol)
# Update the molecule.
system.update(mol)

return system

0 comments on commit 4c9c19f

Please sign in to comment.