Skip to content

Commit

Permalink
Bump recursion limit (#1180)
Browse files Browse the repository at this point in the history
Fixes #1175 

It seems there may be a couple extra calls to _set_owner than just once per atom, so make sure we grow the recursion limit enough for systems with >1000 atoms all in the same molecule.
  • Loading branch information
swails committed Jun 22, 2021
1 parent dfb7305 commit b6b131e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parmed/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tag_molecules(struct) -> List[Set[int]]:
"""
# Make sure our recursion limit is large enough, but never shrink it
from sys import setrecursionlimit, getrecursionlimit
setrecursionlimit(max(len(struct.atoms), getrecursionlimit()))
setrecursionlimit(max(int(1.2 * len(struct.atoms)), getrecursionlimit()))

if not struct.bonds:
for i, atom in enumerate(struct.atoms):
Expand Down

0 comments on commit b6b131e

Please sign in to comment.