Changeset 88d2e70 in sasview for test/sasinvariant/test/utest_data_handling.py
- Timestamp:
- Oct 11, 2018 2:03:40 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
- Children:
- 7c4bb4d
- Parents:
- e090ba90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasinvariant/test/utest_data_handling.py
rf53d684 r88d2e70 45 45 46 46 # Test results 47 self.assertAlmostEqual s(p[0], 1.0, 5)48 self.assertAlmostEqual s(p[1], 0.0, 5)47 self.assertAlmostEqual(p[0], 1.0, 5) 48 self.assertAlmostEqual(p[1], 0.0, 5) 49 49 50 50 def test_fit_linear_data_with_noise(self): … … 74 74 75 75 # Test results 76 self.assertAlmostEqual s(p[0], 1.0, 5)77 self.assertAlmostEqual s(p[1], 0.0, 5)76 self.assertAlmostEqual(p[0], 1.0, 5) 77 self.assertAlmostEqual(p[1], 0.0, 5) 78 78 79 79 def test_fit_linear_data_with_noise_and_fixed_par(self): … … 506 506 for i in range(len(self.data.x)): 507 507 value = math.fabs(test_y[i]-self.data.y[i])/self.data.y[i] 508 self.assert _(value < 0.001)508 self.assertTrue(value < 0.001) 509 509 510 510 class TestDataExtraLowSlitGuinier(unittest.TestCase): … … 553 553 554 554 test_y = inv._low_extrapolation_function.evaluate_model(x=self.data.x[:inv._low_extrapolation_npts]) 555 self.assert _(len(test_y) == len(self.data.y[:inv._low_extrapolation_npts]))555 self.assertTrue(len(test_y) == len(self.data.y[:inv._low_extrapolation_npts])) 556 556 557 557 for i in range(inv._low_extrapolation_npts): 558 558 value = math.fabs(test_y[i]-self.data.y[i])/self.data.y[i] 559 self.assert _(value < 0.001)559 self.assertTrue(value < 0.001) 560 560 561 561 def test_low_data(self): … … 589 589 npts = inv._low_extrapolation_npts) 590 590 test_y = data_in_range.y 591 self.assert _(len(test_y) == len(self.data.y[:inv._low_extrapolation_npts]))591 self.assertTrue(len(test_y) == len(self.data.y[:inv._low_extrapolation_npts])) 592 592 for i in range(inv._low_extrapolation_npts): 593 593 value = math.fabs(test_y[i]-self.data.y[i])/self.data.y[i] 594 self.assert _(value < 0.001)594 self.assertTrue(value < 0.001) 595 595 596 596 … … 642 642 643 643 test_y = inv._high_extrapolation_function.evaluate_model(x=self.data.x[start: ]) 644 self.assert _(len(test_y) == len(self.data.y[start:]))644 self.assertTrue(len(test_y) == len(self.data.y[start:])) 645 645 646 646 for i in range(len(self.data.x[start:])): 647 647 value = math.fabs(test_y[i]-self.data.y[start+i])/self.data.y[start+i] 648 self.assert _(value < 0.001)648 self.assertTrue(value < 0.001) 649 649 650 650 def test_high_data(self): … … 677 677 npts = inv._high_extrapolation_npts) 678 678 test_y = data_in_range.y 679 self.assert _(len(test_y) == len(self.data.y[start:]))679 self.assertTrue(len(test_y) == len(self.data.y[start:])) 680 680 temp = self.data.y[start:] 681 681 682 682 for i in range(len(self.data.x[start:])): 683 683 value = math.fabs(test_y[i]- temp[i])/temp[i] 684 self.assert _(value < 0.001)684 self.assertTrue(value < 0.001)
Note: See TracChangeset
for help on using the changeset viewer.