forked from IPKM/nmreval
Fitresult accepts label argument as set name
This commit is contained in:
parent
a964e02612
commit
1378cf6ac7
@ -26,7 +26,7 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
mousePositionChanged = QtCore.pyqtSignal(float, float)
|
||||
mouseDoubleClicked = QtCore.pyqtSignal()
|
||||
positionClicked = QtCore.pyqtSignal(tuple, bool)
|
||||
aboutToClose = QtCore.pyqtSignal(str)
|
||||
aboutToClose = QtCore.pyqtSignal(list)
|
||||
|
||||
counter = itertools.count()
|
||||
|
||||
@ -375,7 +375,7 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
|
||||
if res == QtWidgets.QMessageBox.Yes:
|
||||
self.aboutToClose.emit(self.id)
|
||||
self.aboutToClose.emit([self.id])
|
||||
evt.accept()
|
||||
else:
|
||||
evt.ignore()
|
||||
|
@ -138,8 +138,8 @@ class FitResult(Points):
|
||||
**kwargs):
|
||||
|
||||
self.parameter, name = self._prepare_names(params, name)
|
||||
|
||||
super().__init__(x=x, y=y, name=name, **kwargs)
|
||||
label = kwargs.get('label', name)
|
||||
super().__init__(x=x, y=y, name=label, **kwargs)
|
||||
|
||||
self.residual = resid
|
||||
self.idx = idx
|
||||
@ -327,6 +327,7 @@ class FitResult(Points):
|
||||
state[attr] = getattr(self, attr)
|
||||
|
||||
state['name'] = self._model_name
|
||||
state['label'] = self.name
|
||||
state['corr'] = self.correlation
|
||||
state['pcorr'] = self.partial_correlation
|
||||
state['stats'] = self.statistics
|
||||
@ -354,7 +355,6 @@ class FitResult(Points):
|
||||
|
||||
return new_fit
|
||||
|
||||
|
||||
def sub(self, x_values):
|
||||
part_functions = []
|
||||
for sub_name, sub_y in zip(self.func.sub_name(), self.func.sub(self.p_final, x_values, **self.fun_kwargs)):
|
||||
|
Loading…
Reference in New Issue
Block a user