parent
728eb34ca7
commit
20592e05c6
@ -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
|
||||
|
@ -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
|
||||
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)
|
||||
if v_k_used.var and p_k_used not in var:
|
||||
var.append(p_k_used)
|
||||
|
||||
data_pars.append(actual_pars)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user