From 5ee1de5afae901e9e49f28eaf4f98e55ad0a8d7d Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 17 Oct 2024 14:59:49 +1100 Subject: [PATCH] catch exception when fold paramters are not able to be updated --- .../fold/fold_function/_base_fold_rotation_angle.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py b/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py index 9454d5c8..486f1b23 100644 --- a/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py +++ b/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py @@ -167,8 +167,11 @@ def fit(self, params: dict = {}) -> bool: success = True except Exception as _e: logger.error("Could not fit curve to S-Plot, check the wavelength") - - self.update_params(guess) + try: + self.update_params(guess) + except Exception as _e: + logger.error("Could not update parameters") + return False return success return True