https://github.com/lmfit/lmfit-py
Tip revision: 3a217568dd9fc3ddb6d089fe900798a464112313 authored by Matthew Newville on 02 May 2023, 17:45:54 UTC
add modelresult.userargs and userkws to doc
add modelresult.userargs and userkws to doc
Tip revision: 3a21756
test_default_kws.py
import numpy as np
from lmfit.lineshapes import gaussian
from lmfit.models import GaussianModel
def test_default_inputs_gauss():
area = 1
cen = 0
std = 0.2
x = np.arange(-3, 3, 0.01)
y = gaussian(x, area, cen, std)
g = GaussianModel()
fit_option1 = {'xtol': 1e-2}
result1 = g.fit(y, x=x, amplitude=1, center=0, sigma=0.5,
max_nfev=5000, fit_kws=fit_option1)
fit_option2 = {'xtol': 1e-6}
result2 = g.fit(y, x=x, amplitude=1, center=0, sigma=0.5,
max_nfev=5000, fit_kws=fit_option2)
assert result1.values != result2.values