source: sasview/test/pr_inversion/test/utest_explorer.py @ 3a473ef

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 3a473ef was 3a473ef, checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago

Manual update of test/ directory with changes on master - SASVIEW-996

  • Property mode set to 100644
File size: 1.0 KB
Line 
1"""
2    Unit tests for DistExplorer class
3"""
4
5import os.path
6import unittest, math, numpy
7from utest_invertor import load
8from sas.sascalc.pr.invertor import Invertor
9from sas.sascalc.pr.distance_explorer import DistExplorer
10
11
12def find(filename):
13    return os.path.join(os.path.dirname(__file__), filename)
14
15
16class TestExplorer(unittest.TestCase):
17           
18    def setUp(self):
19        self.invertor = Invertor()
20        x, y, err = load(find('sphere_80.txt'))
21       
22        # Choose the right d_max...
23        self.invertor.d_max = 160.0
24        # Set a small alpha
25        self.invertor.alpha = .0007
26        # Set data
27        self.invertor.x   = x
28        self.invertor.y   = y
29        self.invertor.err = err       
30        self.invertor.nfunc = 15
31       
32        self.explo = DistExplorer(self.invertor)
33       
34    def test_exploration(self):
35        results = self.explo(120, 200, 25)
36        self.assertEqual(len(results.errors), 0)
37        self.assertEqual(len(results.chi2), 25)
38       
39if __name__ == '__main__':
40    unittest.main()
Note: See TracBrowser for help on using the repository browser.