Skip to content

Commit b873377

Browse files
Merge pull request #38040 from robertapplin/0-fix-incorrect-quasi-calculation
Fix incorrect BayesQuasi calculation
2 parents 6b3f244 + c97123e commit b873377

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/BayesQuasi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,11 @@ def C2Fw(self, sname):
667667

668668
# interlace amplitudes and widths of the peaks
669669
y.extend(height_data)
670-
y.extend(np.hstack((amplitude_data, width_data, eisf_data)).flatten("F"))
670+
y.extend(np.hstack((amplitude_data, width_data, eisf_data)).flatten())
671671

672672
# interlace amplitude and width errors of the peaks
673673
e.extend(height_error)
674-
e.extend(np.hstack((amplitude_error, width_error, eisf_error)).flatten("F"))
674+
e.extend(np.hstack((amplitude_error, width_error, eisf_error)).flatten())
675675

676676
# create x data and axis names for each function
677677
axis_names.append("f" + str(nl) + ".f0." + "Height")
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Mantid Repository : https://github.com/mantidproject/mantid
2+
#
3+
# Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI,
4+
# NScD Oak Ridge National Laboratory, European Spallation Source,
5+
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6+
# SPDX - License - Identifier: GPL - 3.0 +
7+
# pylint: disable=no-init,attribute-defined-outside-init
8+
from systemtesting import MantidSystemTest
9+
from mantid.simpleapi import BayesQuasi, Load
10+
11+
12+
class BayesQuasiTest(MantidSystemTest):
13+
_sample_name = "irs26176_graphite002_red"
14+
_resolution_name = "irs26173_graphite002_res"
15+
16+
def runTest(self):
17+
Load(Filename=f"{self._sample_name}.nxs", OutputWorkspace=self._sample_name, LoadHistory=False)
18+
Load(Filename=f"{self._resolution_name}.nxs", OutputWorkspace=self._resolution_name, LoadHistory=False)
19+
BayesQuasi(
20+
SampleWorkspace=self._sample_name,
21+
ResolutionWorkspace=self._resolution_name,
22+
MinRange=-0.54760699999999995,
23+
MaxRange=0.54411200000000004,
24+
Elastic=False,
25+
Background="Sloping",
26+
FixedWidth=False,
27+
OutputWorkspaceFit=f"{self._sample_name}_QLr_quasielasticbayes_Fit",
28+
OutputWorkspaceResult=f"{self._sample_name}_QLr_Result",
29+
OutputWorkspaceProb=f"{self._sample_name}_QLr_Prob",
30+
)
31+
32+
def validate(self):
33+
self.tolerance = 1e-10
34+
return (
35+
"irs26176_graphite002_QLr_Result",
36+
"irs26176_graphite002_QLr_Result.nxs",
37+
"irs26176_graphite002_QLr_Prob",
38+
"irs26176_graphite002_QLr_Prob.nxs",
39+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5b81d321d79a2535e32f64a92199fd2d
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cf9e11fd64133a894848d2301c76466b

0 commit comments

Comments
 (0)