Skip to content

Commit

Permalink
Fix an off-by-one error ...
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup committed Oct 5, 2017
1 parent 6a41e72 commit b687fc4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions moldesign/molecules/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ def _is_ending_residue(self):
except KeyError:
# If we're here, the residue is missing some atoms. We'll fall back to checking the
# next residues in line
if self.index == len(self.molecule.residues):
if self.index == len(self.molecule.residues) - 1:
return True
else:
print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % \
self)
print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % self)
nextres = self.molecule.residues[self.index + 1]
return not self._same_polymer(nextres)

Expand Down

0 comments on commit b687fc4

Please sign in to comment.