bugfix: display fit parameter for single set

This commit is contained in:
dominik 2022-03-29 09:16:02 +02:00
parent 02cbfbea8d
commit 4ad82cf5b2
3 changed files with 4 additions and 4 deletions

View File

@ -118,7 +118,7 @@ class Parameter:
return start + f'{self.value:} (fixed)'
def __add__(self, other: Parameter | float) -> float:
if isinstance(other, float):
if isinstance(other, (float, int)):
return self.value + other
elif isinstance(other, Parameter):
return self.value + other.value

View File

@ -1,4 +1,4 @@
from typing import List, Union
from typing import List, Tuple, Union
from .properties import PropWidget
from ...Qt import QtWidgets, QtGui, QtCore
@ -77,7 +77,7 @@ class DataTree(QtWidgets.QTreeWidget):
break
@QtCore.pyqtSlot(QtWidgets.QTreeWidgetItem)
def data_change(self, item: QtWidgets.QTreeWidgetItem) -> tuple[set, set]:
def data_change(self, item: QtWidgets.QTreeWidgetItem) -> Tuple[set, set]:
idd = item.data(0, QtCore.Qt.UserRole)
is_selected = item.checkState(0) == QtCore.Qt.Checked
to_be_hidden = set()

View File

@ -443,7 +443,7 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
self.set_parameter_iter(fit_id, [p.value for p in fit_parameter], self.models[fitted_model])
mean_parameter = [reduce(add, p)/len(p) for p in zip(*glob_fit_parameter)]
mean_parameter = [reduce(add, p, 0)/len(p) for p in zip(*glob_fit_parameter)]
self.set_parameter_iter(None, mean_parameter, self.models[fitted_model])