undo stuff I introduced in aa0d14a322; should fix #165, reopens #151

This commit is contained in:
Dominik Demuth 2023-12-01 20:19:09 +01:00
parent 728eb34ca7
commit 20592e05c6
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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)