Commit bdf5a7c8 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Merge pull request #15976 from rosswhitfield/gsl2_test_tolerances

GSL2 test tolerances
parents f9f3e2d2 8d861be7
......@@ -133,7 +133,7 @@ public:
// Error of 'c' should also be small
TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(2, 2)), 1e-4);
// b should be almost equal to 4.06
TS_ASSERT_DELTA(cellWs->cell<double>(2, 1), 4.06, 2e-3);
TS_ASSERT_DELTA(cellWs->cell<double>(2, 1), 4.06, 3e-3);
// Check number of peak parameters.
ITableWorkspace_sptr peakWs =
......
......@@ -91,7 +91,7 @@ class IqtFitMultipleTest(unittest.TestCase):
row = tableWS.row(0)
self.assertEquals(round(row['axis-1'], 6), 0.483619)
self.assertEquals(round(row['f1.Intensity'], 6), 0.979517)
self.assertEquals(round(row['f1.Tau'], 7), 0.0246719)
self.assertEquals(round(row['f1.Tau'], 6), 0.024672)
def _validate_matrix_values(self, matrixWS):
# Check f0.A0
......@@ -106,7 +106,7 @@ class IqtFitMultipleTest(unittest.TestCase):
# Check f1.Tau
tau = matrixWS.readY(2)
self.assertEquals(round(tau[0], 7), 0.0246719)
self.assertEquals(round(tau[0], 6), 0.024672)
self.assertEquals(round(tau[-1],8), 0.00253487)
# Check f1.Beta
......@@ -123,7 +123,7 @@ class IqtFitMultipleTest(unittest.TestCase):
# Check Calc
calc = sub_ws.readY(1)
self.assertEquals(round(calc[0], 5), 1)
self.assertEquals(round(calc[-1],7),0.0264651)
self.assertEquals(round(calc[-1],6),0.026465)
# Check Diff
diff = sub_ws.readY(2)
self.assertEquals(round(diff[0], 19), -5.31797e-14)
......
......@@ -55,9 +55,9 @@ Usage
print "Result has %i Spectra" %result_ws.getNumberHistograms()
print "Amplitude 0: %.5f" %(result_ws.readY(0)[0])
print "Amplitude 1: %.5f" %(result_ws.readY(0)[1])
print "Amplitude 2: %.5f" %(result_ws.readY(0)[2])
print "Amplitude 0: %.3f" %(result_ws.readY(0)[0])
print "Amplitude 1: %.3f" %(result_ws.readY(0)[1])
print "Amplitude 2: %.3f" %(result_ws.readY(0)[2])
print "X axis at 0: %.5f" %(result_ws.readX(0)[0])
print "X axis at 1: %.5f" %(result_ws.readX(0)[1])
......@@ -74,9 +74,9 @@ Output:
Result has 2 Spectra
Amplitude 0: 4.29258
Amplitude 1: 4.17928
Amplitude 2: 3.97924
Amplitude 0: 4.293
Amplitude 1: 4.179
Amplitude 2: 3.979
X axis at 0: 0.52531
X axis at 1: 0.72917
......
......@@ -87,11 +87,11 @@ Usage
EnggUtils.write_ENGINX_GSAS_iparam_file(GSAS_iparm_fname, [Difc1, Difc2], [Zero1, Zero2])
print "DIFA1: %.2f" % (Difa1)
print "DIFC1: %.2f" % (Difc1)
print "DIFC1: %.1f" % (Difc1)
print "TZERO1: %.2f" % (Zero1)
tbl = mtd[out_tbl_name]
print "The output table has %d row(s)" % tbl.rowCount()
print "Parameters from the table, DIFC1: %.2f, ZERO1: %.2f" % (tbl.cell(0,1), tbl.cell(0,2))
print "Parameters from the table, DIFC1: %.1f, ZERO1: %.2f" % (tbl.cell(0,1), tbl.cell(0,2))
import os
print "Output GSAS iparam file was written?", os.path.exists(GSAS_iparm_fname)
print "Number of lines of the GSAS iparam file:", sum(1 for line in open(GSAS_iparm_fname))
......@@ -110,9 +110,9 @@ Output:
.. testoutput:: ExampleCalib
DIFA1: 0.00
DIFC1: 18400.19
DIFC1: 18400.2
TZERO1: -2.06
The output table has 1 row(s)
Parameters from the table, DIFC1: 18400.19, ZERO1: -2.06
Parameters from the table, DIFC1: 18400.2, ZERO1: -2.06
Output GSAS iparam file was written? True
Number of lines of the GSAS iparam file: 35
......@@ -72,16 +72,16 @@ Usage
# Print the results
print "DIFA: %.1f" % difa
print "DIFC: %.1f" % difc
print "TZERO: %.1f" % tzero
print "DIFC: %.0f" % round(difc,-1)
print "TZERO: %.0f" %round(tzero,-1)
tbl = mtd[out_tbl_name]
print "The output table has %d row(s)" % tbl.rowCount()
print "Parameters from the table, DIFA: %.1f, DIFC: %.1f, TZERO: %.1f" % (tbl.cell(0,0), tbl.cell(0,1), tbl.cell(0,2))
print "Parameters from the table, DIFA: %.1f, DIFC: %.0f, TZERO: %.0f" % (tbl.cell(0,0), round(tbl.cell(0,1),-1), round(tbl.cell(0,2),-1))
print "Number of peaks fitted: {0}".format(peaks_tbl.rowCount())
print "First peak expected (dSpacing): {0}".format(peaks_tbl.column('dSpacing')[0])
print "First fitted peak center (ToF): {0:.1f}".format(peaks_tbl.column('X0')[0])
print "Second peak expected (dSpacing): {0}".format(peaks_tbl.column('dSpacing')[1])
print "Second fitted peak center (ToF): {0:.1f}".format(peaks_tbl.column('X0')[1])
print "Second fitted peak center (ToF): {0:.0f}".format(round(peaks_tbl.column('X0')[1],-1))
Output:
......@@ -92,15 +92,15 @@ Output:
.. testoutput:: ExTwoPeaks
DIFA: 0.0
DIFC: 18181.8
TZERO: 460.5
DIFC: 18180
TZERO: 460
The output table has 1 row(s)
Parameters from the table, DIFA: 0.0, DIFC: 18181.8, TZERO: 460.5
Parameters from the table, DIFA: 0.0, DIFC: 18180, TZERO: 460
Number of peaks fitted: 2
First peak expected (dSpacing): 0.8
First fitted peak center (ToF): 15006.0
Second peak expected (dSpacing): 1.9
Second fitted peak center (ToF): 35006.0
Second fitted peak center (ToF): 35010
.. categories::
......
......@@ -80,7 +80,7 @@ Usage
print "First peak expected (dSpacing): {0}".format(peaks_tbl.column('dSpacing')[0])
print "First fitted peak center (ToF): {0:.1f}".format(peaks_tbl.column('X0')[0])
print "Second peak expected (dSpacing): {0}".format(peaks_tbl.column('dSpacing')[1])
print "Second fitted peak center (ToF): {0:.1f}".format(peaks_tbl.column('X0')[1])
print "Second fitted peak center (ToF): {0:.0f}".format(round(peaks_tbl.column('X0')[1],-1))
Output:
......@@ -94,7 +94,7 @@ Output:
First peak expected (dSpacing): 0.8
First fitted peak center (ToF): 15006.0
Second peak expected (dSpacing): 1.9
Second fitted peak center (ToF): 35006.0
Second fitted peak center (ToF): 35010
.. categories::
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment