mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-09-03 01:50:44 +02:00
Removed the lmfit based fitting and the old API for calling functions closes #296
16 lines
350 B
Python
16 lines
350 B
Python
# SPDX-License-Identifier: MPL-2.0
|
|
import numpy as np
|
|
import aare
|
|
|
|
|
|
|
|
def test_gaussian_model_evaluates_and_fits_data():
|
|
x = np.linspace(-5.0, 5.0, 51)
|
|
expected = np.array([20.0, 0.5, 1.2])
|
|
model = aare.Gaussian()
|
|
|
|
y = model(x, expected)
|
|
result = model.fit(x, y)
|
|
|
|
np.testing.assert_allclose(result["par"], expected, atol=2e-3)
|