-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #10026 fix algorithm and add unit and doc tests
- Loading branch information
1 parent
ba06bca
commit 9140580
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/SortByQVectorsTest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unittest,os | ||
import mantid | ||
|
||
|
||
class SortByQVectorsTest(unittest.TestCase): | ||
|
||
|
||
def test_output(self): | ||
ws = mantid.simpleapi.LoadSassena("outputSassena_1.4.1.h5", TimeUnit=1.0) | ||
mantid.simpleapi.SortByQVectors('ws') | ||
self.assertAlmostEqual(ws[0].getNumberHistograms(),5) | ||
self.assertAlmostEqual(ws[0].dataY(0)[0],0.0) | ||
self.assertAlmostEqual(ws[0].dataY(1)[0],0.00600600591861) | ||
self.assertAlmostEqual(ws[0].dataY(2)[0],0.0120120118372) | ||
self.assertAlmostEqual(ws[0].dataY(3)[0],0.0180180184543) | ||
self.assertAlmostEqual(ws[0].dataY(4)[0],0.0240240236744) | ||
mantid.api.AnalysisDataService.remove("ws") | ||
|
||
if __name__=="__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters