mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
remove keyword n_parms from fit standard
This commit is contained in:
parent
090a26919b
commit
960fc521c4
1 changed files with 9 additions and 12 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue