From 1293c3f2930ad2420e19df30bf4537a0f2fec6d9 Mon Sep 17 00:00:00 2001 From: rozyczko Date: Tue, 17 Jun 2025 14:59:03 +0200 Subject: [PATCH 1/4] added chi^2 value and success flag to fit results --- src/easyreflectometry/fitting.py | 2 ++ tests/test_fitting.py | 2 ++ 2 files changed, 4 insertions(+) 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'] From cd68acfd6157ca4dcd9442e9a85275c223a384fe Mon Sep 17 00:00:00 2001 From: rozyczko Date: Tue, 17 Jun 2025 15:50:13 +0200 Subject: [PATCH 2/4] try being explicit wrt bumps version, so the prerelease doesn't get pulled --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e0da3a2d..2f498b75 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==0.9.3", ] [project.optional-dependencies] From c8ef77340a4a6c204cd44dd41591782923db48ab Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 17 Jun 2025 17:31:06 +0200 Subject: [PATCH 3/4] back to 1.0b7 --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2f498b75..e0da3a2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,6 @@ dependencies = [ "refl1d[webview]==1.0.0a12", "orsopy==1.2.1", "xhtml2pdf==0.2.17", - "bumps==0.9.3", ] [project.optional-dependencies] From 099998b8ebb32c6be141092446e824d2d5db99a7 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 17 Jun 2025 17:38:16 +0200 Subject: [PATCH 4/4] explicitly the working 1.0.0b7 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) 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]