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)
|
mousePositionChanged = QtCore.pyqtSignal(float, float)
|
||||||
mouseDoubleClicked = QtCore.pyqtSignal()
|
mouseDoubleClicked = QtCore.pyqtSignal()
|
||||||
positionClicked = QtCore.pyqtSignal(tuple, bool)
|
positionClicked = QtCore.pyqtSignal(tuple, bool)
|
||||||
aboutToClose = QtCore.pyqtSignal(str)
|
aboutToClose = QtCore.pyqtSignal(list)
|
||||||
|
|
||||||
counter = itertools.count()
|
counter = itertools.count()
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
|||||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||||
|
|
||||||
if res == QtWidgets.QMessageBox.Yes:
|
if res == QtWidgets.QMessageBox.Yes:
|
||||||
self.aboutToClose.emit(self.id)
|
self.aboutToClose.emit([self.id])
|
||||||
evt.accept()
|
evt.accept()
|
||||||
else:
|
else:
|
||||||
evt.ignore()
|
evt.ignore()
|
||||||
|
@ -138,8 +138,8 @@ class FitResult(Points):
|
|||||||
**kwargs):
|
**kwargs):
|
||||||
|
|
||||||
self.parameter, name = self._prepare_names(params, name)
|
self.parameter, name = self._prepare_names(params, name)
|
||||||
|
label = kwargs.get('label', name)
|
||||||
super().__init__(x=x, y=y, name=name, **kwargs)
|
super().__init__(x=x, y=y, name=label, **kwargs)
|
||||||
|
|
||||||
self.residual = resid
|
self.residual = resid
|
||||||
self.idx = idx
|
self.idx = idx
|
||||||
@ -327,6 +327,7 @@ class FitResult(Points):
|
|||||||
state[attr] = getattr(self, attr)
|
state[attr] = getattr(self, attr)
|
||||||
|
|
||||||
state['name'] = self._model_name
|
state['name'] = self._model_name
|
||||||
|
state['label'] = self.name
|
||||||
state['corr'] = self.correlation
|
state['corr'] = self.correlation
|
||||||
state['pcorr'] = self.partial_correlation
|
state['pcorr'] = self.partial_correlation
|
||||||
state['stats'] = self.statistics
|
state['stats'] = self.statistics
|
||||||
@ -354,7 +355,6 @@ class FitResult(Points):
|
|||||||
|
|
||||||
return new_fit
|
return new_fit
|
||||||
|
|
||||||
|
|
||||||
def sub(self, x_values):
|
def sub(self, x_values):
|
||||||
part_functions = []
|
part_functions = []
|
||||||
for sub_name, sub_y in zip(self.func.sub_name(), self.func.sub(self.p_final, x_values, **self.fun_kwargs)):
|
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