From 20592e05c698dafc0da244d5465b93f5b185f416 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 1 Dec 2023 20:19:09 +0100 Subject: [PATCH] undo stuff I introduced in aa0d14a322; should fix #165, reopens #151 --- src/gui_qt/fit/fitwindow.py | 4 ++-- src/nmreval/fit/minimizer.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui_qt/fit/fitwindow.py b/src/gui_qt/fit/fitwindow.py index 9bb4db9..ac1f11e 100644 --- a/src/gui_qt/fit/fitwindow.py +++ b/src/gui_qt/fit/fitwindow.py @@ -277,14 +277,14 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog): func_dict = {} for model_name, model_parameter in self.models.items(): func, order, param_len = ModelFactory.create_from_list(model_parameter) - + multiple_funcs = isinstance(func, MultiModel) if func is None: continue func = Model(func) if model_name in data: - parameter, _ = self._prepare(model_parameter, function_use=data[model_name], add_idx=isinstance(func, MultiModel)) + parameter, _ = self._prepare(model_parameter, function_use=data[model_name], add_idx=multiple_funcs) if parameter is None or not isinstance(parameter, dict): return diff --git a/src/nmreval/fit/minimizer.py b/src/nmreval/fit/minimizer.py index cafca40..e02042f 100644 --- a/src/nmreval/fit/minimizer.py +++ b/src/nmreval/fit/minimizer.py @@ -287,8 +287,8 @@ class FitRoutine(object): vals = [] var_pars = [] for p_k, v_k in parameter.items(): - vals.append([v_k.scaled_value, v_k.lb / v_k.scale, v_k.ub / v_k.scale]) if v_k.var: + vals.append([v_k.scaled_value, v_k.lb / v_k.scale, v_k.ub / v_k.scale]) var_pars.append(p_k) pp, lb, ub = zip(*vals) @@ -318,11 +318,11 @@ class FitRoutine(object): actual_pars.append(p_k_used) # parameter is variable and was not found before as shared parameter - p0.append(v_k_used.scaled_value) - lb.append(v_k_used.lb / v_k_used.scale) - ub.append(v_k_used.ub / v_k_used.scale) if v_k_used.var and p_k_used not in var: var.append(p_k_used) + p0.append(v_k_used.scaled_value) + lb.append(v_k_used.lb / v_k_used.scale) + ub.append(v_k_used.ub / v_k_used.scale) data_pars.append(actual_pars)