Skip to content

Commit 51145c4

Browse files
Backmerge to develop (#246)
* Fix for the TXT file reader (#238) (#239) * bump version * added test * make the file reader more robust for weird/malformed files * modified the CHANGELOG * Release 1.1.2 * Added chi^2 value and success flag to fit results * Set bumps version dependency to the working 1.0.0b7 (refl1d and EasyScience) * Release 1.3.3 proper version number and updated changelog (#245) --------- Co-authored-by: Christian Dam Vedel <[email protected]>
1 parent c26ad40 commit 51145c4

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Version 1.3.2 (15 May 2025)
1+
# Version 1.3.3 (17 June 2025)
22

3-
Fixed loading of experiment data files in .txt format.
3+
Added Chi^2 and fit status to fitting results.
4+
Added explicit dependency on bumps version.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies = [
3636
"refl1d[webview]==1.0.0a12",
3737
"orsopy==1.2.1",
3838
"xhtml2pdf==0.2.17",
39+
"bumps==1.0.0b7",
3940
]
4041

4142
[project.optional-dependencies]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
__version__ = '1.3.2'
1+
__version__ = '1.3.3'
2+

src/easyreflectometry/fitting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def fit(self, data: sc.DataGroup, id: int = 0) -> sc.DataGroup:
5454
new_data['coords'][f'z_{id}'] = sc.array(
5555
dims=[f'z_{id}'], values=sld_profile[0], unit=(1 / new_data['coords'][f'Qz_{id}'].unit).unit
5656
)
57+
new_data['reduced_chi'] = float(result[i].reduced_chi)
58+
new_data['success'] = result[i].success
5759
return new_data
5860

5961
def fit_single_data_set_1d(self, data: DataSet1D) -> FitResults:

tests/test_fitting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ def test_fitting(minimizer):
6060
analysed = fitter.fit(data)
6161
assert 'R_0_model' in analysed.keys()
6262
assert 'SLD_0' in analysed.keys()
63+
assert 'success' in analysed.keys()
64+
assert analysed['success']

0 commit comments

Comments
 (0)