diff --git a/pyproject.toml b/pyproject.toml index e0da3a2d..b11f04e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dependencies = [ "refl1d[webview]==1.0.0a12", "orsopy==1.2.1", "xhtml2pdf==0.2.17", + "bumps==1.0.0b7", ] [project.optional-dependencies] diff --git a/src/easyreflectometry/fitting.py b/src/easyreflectometry/fitting.py index d0cc3f46..c7bb75c5 100644 --- a/src/easyreflectometry/fitting.py +++ b/src/easyreflectometry/fitting.py @@ -54,6 +54,8 @@ def fit(self, data: sc.DataGroup, id: int = 0) -> sc.DataGroup: new_data['coords'][f'z_{id}'] = sc.array( dims=[f'z_{id}'], values=sld_profile[0], unit=(1 / new_data['coords'][f'Qz_{id}'].unit).unit ) + new_data['reduced_chi'] = float(result[i].reduced_chi) + new_data['success'] = result[i].success return new_data def fit_single_data_set_1d(self, data: DataSet1D) -> FitResults: diff --git a/tests/test_fitting.py b/tests/test_fitting.py index 1b32f96e..0a965d06 100644 --- a/tests/test_fitting.py +++ b/tests/test_fitting.py @@ -60,3 +60,5 @@ def test_fitting(minimizer): analysed = fitter.fit(data) assert 'R_0_model' in analysed.keys() assert 'SLD_0' in analysed.keys() + assert 'success' in analysed.keys() + assert analysed['success']