From 1d22f22901396851266594e27570a73b38dcdfc1 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Mon, 18 Sep 2023 15:30:06 +0200 Subject: [PATCH] Parameter in preview --- src/gui_qt/fit/fit_parameter.py | 2 +- src/gui_qt/fit/fitwindow.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/gui_qt/fit/fit_parameter.py b/src/gui_qt/fit/fit_parameter.py index 7426c1b..49568cf 100644 --- a/src/gui_qt/fit/fit_parameter.py +++ b/src/gui_qt/fit/fit_parameter.py @@ -237,7 +237,7 @@ class QFitParameterWidget(QtWidgets.QWidget, Ui_FormFit): for i, (p_i, g) in enumerate(zip(parameter, self.global_parameter)): if isinstance(g, FitModelWidget): - if p_i is None: + if (p_i is None) and (not is_global[i]): # set has no oen value p.append(param_general[i].copy()) else: diff --git a/src/gui_qt/fit/fitwindow.py b/src/gui_qt/fit/fitwindow.py index 3f9ce48..b93ebec 100644 --- a/src/gui_qt/fit/fitwindow.py +++ b/src/gui_qt/fit/fitwindow.py @@ -9,6 +9,7 @@ import numpy as np from pyqtgraph import mkPen from nmreval.fit._meta import MultiModel, ModelFactory +from nmreval.fit.data import Data from nmreval.fit.model import Model from nmreval.fit.result import FitResult @@ -419,20 +420,14 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog): self.preview_lines = [] for k, model in models_parameters.items(): - f = model['func'] + f = Model(model['func']) is_complex = self._complex[k] - parameters = model['parameter'] + parameters = model['data_parameter'] color = model['color'] - seen_parameter = [] - for p, kwargs in parameters.values(): - if (p, kwargs) in seen_parameter: - # plot only previews with different parameter - continue - - seen_parameter.append((p, kwargs)) + print(pp.value for pp in p) if is_complex is not None: y = f.func(x, *p, complex_mode=is_complex, **kwargs)