From 793b750516fe55cc99459cf79d8ecd2215e1cc75 Mon Sep 17 00:00:00 2001 From: Yanbing Zhou Date: Thu, 23 Apr 2026 08:40:22 -0700 Subject: [PATCH] Fix infinite loop in BFGS when tr_min_hit is reset on rejected steps --- westpy/relaxation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/westpy/relaxation.py b/westpy/relaxation.py index a727a4d..4100a21 100644 --- a/westpy/relaxation.py +++ b/westpy/relaxation.py @@ -445,7 +445,7 @@ def _compute_new_position(self): self.trust_radius = min(self.trust_radius_ini, self.nr_step_length) # else: - self.tr_min_hit = 0 + pass else: # a new bfgs step is done self.bfgs_iter = self.bfgs_iter + 1 @@ -637,7 +637,6 @@ def _compute_trust_radius(self): if self.tr_min_hit == 1: self._log("history already reset at previous step: stopping") self.tr_min_hit = 2 - exit() else: self.tr_min_hit = 1