mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
repr of fit result adjusted
This commit is contained in:
parent
f2a5f12dce
commit
52d2d3b142
1 changed files with 4 additions and 3 deletions
|
@ -52,7 +52,8 @@ class Fit_result(Sequence):
|
||||||
return my_str
|
return my_str
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return 'Fit_result' + str([o.value for o in self.fit_parameters]) + '\n'
|
m = max(map(len, list(self.__dict__.keys()))) + 1
|
||||||
|
return '\n'.join([key.rjust(m) + ': ' + repr(value) for key, value in sorted(self.__dict__.items())])
|
||||||
|
|
||||||
|
|
||||||
def least_squares(x, y, func, priors=None, silent=False, **kwargs):
|
def least_squares(x, y, func, priors=None, silent=False, **kwargs):
|
||||||
|
@ -175,7 +176,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs):
|
||||||
|
|
||||||
chisquare = fit_result.fun
|
chisquare = fit_result.fun
|
||||||
|
|
||||||
output.nit = fit_result.nit
|
output.iterations = fit_result.nit
|
||||||
else:
|
else:
|
||||||
output.method = 'Levenberg-Marquardt'
|
output.method = 'Levenberg-Marquardt'
|
||||||
if not silent:
|
if not silent:
|
||||||
|
@ -190,7 +191,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs):
|
||||||
|
|
||||||
chisquare = np.sum(fit_result.fun ** 2)
|
chisquare = np.sum(fit_result.fun ** 2)
|
||||||
|
|
||||||
output.nit = fit_result.nfev
|
output.iterations = fit_result.nfev
|
||||||
|
|
||||||
if not fit_result.success:
|
if not fit_result.success:
|
||||||
raise Exception('The minimization procedure did not converge.')
|
raise Exception('The minimization procedure did not converge.')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue