Changeset 6e74ee4 in sasview for Invariant/test
- Timestamp:
- Dec 18, 2009 3:43:36 PM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 85b3971
- Parents:
- 25a92d1
- Location:
- Invariant/test
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Invariant/test/utest_use_cases.py
rc8c4fa1 r6e74ee4 18 18 self.data = Loader().load("linefittest.txt") 19 19 20 def test_fit_line_data _nosigma(self):20 def test_fit_line_data(self): 21 21 """ 22 22 Fit_Test_1: test linear fit, ax +b, without fixed … … 34 34 35 35 36 def test_fit_line_data_ sigma(self):36 def test_fit_line_data_fixed(self): 37 37 """ 38 38 Fit_Test_2: test linear fit, ax +b, with 'a' fixed … … 49 49 self.assertAlmostEquals(b, -4.0676,3) 50 50 51 class TestLineFitNoweight(unittest.TestCase): 52 """ 53 Test Line fit without weight(dy data) 54 """ 55 def setUp(self): 56 self.data = Loader().load("linefittest_no_weight.txt") 57 58 def test_fit_line_data_no_weight(self): 59 """ 60 Fit_Test_1: test linear fit, ax +b, without fixed 61 """ 62 63 # Create invariant object. Background and scale left as defaults. 64 fit = invariant.FitFunctor(data=self.data) 65 66 ##Without holding 67 a,b = fit.fit(power=None) 68 69 # Test results 70 self.assertAlmostEquals(a, 2.4727,3) 71 self.assertAlmostEquals(b, 0.6,3) 72 73 74 def test_fit_line_data_fixed_no_weight(self): 75 """ 76 Fit_Test_2: test linear fit, ax +b, with 'a' fixed 77 """ 78 79 # Create invariant object. Background and scale left as defaults. 80 fit = invariant.FitFunctor(data=self.data) 81 82 #With holding a = -power =4 83 a,b = fit.fit(power=-4) 84 85 # Test results 86 self.assertAlmostEquals(a, 4) 87 self.assertAlmostEquals(b, -7.8,3) 88 51 89 class TestInvPolySphere(unittest.TestCase): 52 90 """
Note: See TracChangeset
for help on using the changeset viewer.