Changeset 88d2e70 in sasview for test/sascalculator
- 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/sascalculator/test/utest_sld.py
ra50da82 r88d2e70 51 51 molecule_formula=self.sld_formula) 52 52 #test sld 53 self.assertAlmostEqual s(sld_real * _SCALE, -5.6e-7, 1)54 self.assertAlmostEqual s(sld_im * _SCALE, 0)53 self.assertAlmostEqual(sld_real * _SCALE, -5.6e-7, 1) 54 self.assertAlmostEqual(sld_im * _SCALE, 0) 55 55 #test absorption value 56 self.assertAlmostEqual s(abs, 0.0741, 2)57 self.assertAlmostEqual s(incoh, 5.62, 2)56 self.assertAlmostEqual(abs, 0.0741, 2) 57 self.assertAlmostEqual(incoh, 5.62, 2) 58 58 #Test length 59 self.assertAlmostEqual s(length, 0.1755, 3)59 self.assertAlmostEqual(length, 0.1755, 3) 60 60 #test Cu sld 61 self.assertAlmostEqual s(cu_real * _SCALE, 9.46e-6, 1)62 self.assertAlmostEqual s(cu_im * _SCALE, 3.01e-8)61 self.assertAlmostEqual(cu_real * _SCALE, 9.46e-6, 1) 62 self.assertAlmostEqual(cu_im * _SCALE, 3.01e-8) 63 63 # test Mo sld 64 self.assertAlmostEqual s(mo_real * _SCALE, 9.43e-6)65 self.assertAlmostEqual s(mo_im * _SCALE, 5.65e-7,1)64 self.assertAlmostEqual(mo_real * _SCALE, 9.43e-6) 65 self.assertAlmostEqual(mo_im * _SCALE, 5.65e-7,1) 66 66 67 67 … … 91 91 molecule_formula=self.sld_formula) 92 92 #test sld 93 self.assertAlmostEqual s(sld_real * _SCALE, 6.33e-6, 1)94 self.assertAlmostEqual s(sld_im * _SCALE, 0)93 self.assertAlmostEqual(sld_real * _SCALE, 6.33e-6, 1) 94 self.assertAlmostEqual(sld_im * _SCALE, 0) 95 95 #test absorption value 96 self.assertAlmostEqual s(abs, 1.35e-4, 2)97 self.assertAlmostEqual s(incoh, 0.138, 2)96 self.assertAlmostEqual(abs, 1.35e-4, 2) 97 self.assertAlmostEqual(incoh, 0.138, 2) 98 98 #Test length 99 self.assertAlmostEqual s(length, 1.549, 3)99 self.assertAlmostEqual(length, 1.549, 3) 100 100 #test Cu sld 101 self.assertAlmostEqual s(cu_real * _SCALE, 9.36e-6, 1)102 self.assertAlmostEqual s(cu_im * _SCALE, 2.98e-8)101 self.assertAlmostEqual(cu_real * _SCALE, 9.36e-6, 1) 102 self.assertAlmostEqual(cu_im * _SCALE, 2.98e-8) 103 103 # test Mo sld 104 self.assertAlmostEqual s(mo_real * _SCALE, 9.33e-6)105 self.assertAlmostEqual s(mo_im * _SCALE, 5.59e-9,1)104 self.assertAlmostEqual(mo_real * _SCALE, 9.33e-6) 105 self.assertAlmostEqual(mo_im * _SCALE, 5.59e-9,1) 106 106 107 107 … … 131 131 molecule_formula=self.sld_formula) 132 132 #test sld 133 self.assertAlmostEqual s(sld_real * _SCALE, 1.04e-6, 1)134 self.assertAlmostEqual s(sld_im * _SCALE, -1.5e-7, 1)133 self.assertAlmostEqual(sld_real * _SCALE, 1.04e-6, 1) 134 self.assertAlmostEqual(sld_im * _SCALE, -1.5e-7, 1) 135 135 #test absorption value 136 self.assertAlmostEqual s(abs, 180.0,0)137 self.assertAlmostEqual s(incoh, 0.0754, 2)136 self.assertAlmostEqual(abs, 180.0,0) 137 self.assertAlmostEqual(incoh, 0.0754, 2) 138 138 #Test length 139 self.assertAlmostEqual s(length, 0.005551, 4)139 self.assertAlmostEqual(length, 0.005551, 4) 140 140 #test Cu sld 141 self.assertAlmostEqual s(cu_real * _SCALE, 2.89e-5, 1)142 self.assertAlmostEqual s(cu_im * _SCALE, 2.81e-6)141 self.assertAlmostEqual(cu_real * _SCALE, 2.89e-5, 1) 142 self.assertAlmostEqual(cu_im * _SCALE, 2.81e-6) 143 143 # test Mo sld 144 self.assertAlmostEqual s(mo_real * _SCALE, 2.84e-5, 1)145 self.assertAlmostEqual s(mo_im * _SCALE, 7.26e-7,1)144 self.assertAlmostEqual(mo_real * _SCALE, 2.84e-5, 1) 145 self.assertAlmostEqual(mo_im * _SCALE, 7.26e-7,1) 146 146 147 147 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.