From c5d5d096af7178eefdb75e991816ad6a681f428f Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Thu, 19 May 2022 14:08:22 +0200
Subject: [PATCH] bugfix: do correct number of gap extensions in
 FillLoopsByMonteCarlo

---
 modelling/pymod/_closegaps.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py
index 337c281b..7e6a730d 100644
--- a/modelling/pymod/_closegaps.py
+++ b/modelling/pymod/_closegaps.py
@@ -1047,7 +1047,7 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler=None, max_loops_to_search=6,
         ext_step = 0
 
         first_iteration = True
-        while found_loops < max_loops_to_search and ext_step < max_extension:
+        while found_loops < max_loops_to_search and ext_step <= max_extension:
 
             # extend the gap
             if not first_iteration:
-- 
GitLab