forked from IPKM/nmreval
fixed fit parameter ignore boundary problems; fixes #128
This commit is contained in:
parent
661ab81d7e
commit
5116622e42
@ -243,7 +243,7 @@ class QFitParameterWidget(QtWidgets.QWidget, Ui_FormFit):
|
|||||||
else:
|
else:
|
||||||
lb, ub = bds[i]
|
lb, ub = bds[i]
|
||||||
try:
|
try:
|
||||||
if not (lb < p_i < ub):
|
if not ((lb < p_i < ub) or (not is_fixed[i])):
|
||||||
raise ValueError(f'Parameter {g.name} is outside bounds ({lb}, {ub})')
|
raise ValueError(f'Parameter {g.name} is outside bounds ({lb}, {ub})')
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
|
@ -222,7 +222,7 @@ class Parameter:
|
|||||||
self.var = False
|
self.var = False
|
||||||
else:
|
else:
|
||||||
if isinstance(self.lb, (int, float)) and isinstance(self.ub, (int, float)):
|
if isinstance(self.lb, (int, float)) and isinstance(self.ub, (int, float)):
|
||||||
if self.lb <= value <= self.ub:
|
if (self.lb <= value <= self.ub) or (not self.var):
|
||||||
self._value = value
|
self._value = value
|
||||||
else:
|
else:
|
||||||
raise ValueError('Value of parameter is outside bounds')
|
raise ValueError('Value of parameter is outside bounds')
|
||||||
|
Loading…
Reference in New Issue
Block a user