From 960fc521c4c0262afca758bb79861e8c736de782 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 11 Oct 2021 09:10:23 +0100 Subject: [PATCH] remove keyword n_parms from fit standard --- pyerrors/fits.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 1d5ba31d..7f1d26db 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -14,7 +14,7 @@ from autograd import elementwise_grad as egrad from .pyerrors import Obs, derived_observable, covariance, pseudo_Obs -def standard_fit(x, y, func,n_parms="auto", silent=False, **kwargs): +def standard_fit(x, y, func, silent=False, **kwargs): """Performs a non-linear fit to y = func(x) and returns a list of Obs corresponding to the fit parameters. x has to be a list of floats. @@ -68,19 +68,16 @@ def standard_fit(x, y, func,n_parms="auto", silent=False, **kwargs): if not callable(func): raise TypeError('func has to be a function.') - if n_parms=="auto": - for i in range(25): - try: - func(np.arange(i), x.T[0]) - except: - pass - else: - break - + for i in range(25): + try: + func(np.arange(i), x.T[0]) + except: + pass + else: + break - n_parms = i + n_parms = i - if not silent: print('Fit with', n_parms, 'parameters')