Skip to content

Commit

Permalink
Merge pull request #17 from aizvorski/master
Browse files Browse the repository at this point in the history
Fix: particle indexes passed to addParticle
  • Loading branch information
jaimergp committed Oct 20, 2020
2 parents 8a5e9e4 + 92480ce commit 377f493
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ommprotocol/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ def restraint_force(self, indices=None, strength=5.0):
positions = self.positions if self.positions is not None else self.handler.positions
if indices is None:
indices = range(self.handler.topology.getNumAtoms())
for i, index in enumerate(indices):
force.addParticle(i, positions[index].value_in_unit(u.nanometers))
for index in indices:
force.addParticle(int(index), positions[index].value_in_unit(u.nanometers))
return force

def distance_restraint_force(self, atoms, distances, strengths):
Expand Down

0 comments on commit 377f493

Please sign in to comment.