Changeset dfa8832 in sasview for sansmodels/src
- Timestamp:
- Jan 7, 2010 5:06:14 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:
- 2db1d66
- Parents:
- c451be9
- Location:
- sansmodels/src/sans/models/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_dispersity.py
r26e4a24 rdfa8832 34 34 self.model.dispersion['radius']['npts'] = 100 35 35 36 self.assertAlmostEqual(self.model.run(0.001), 4527.47250339, 3)37 self.assertAlmostEqual(self.model.runXY([0.001, 0.001]), 4546.997777604715, 3)36 self.assertAlmostEqual(self.model.run(0.001), 1.021051*4527.47250339, 3) 37 self.assertAlmostEqual(self.model.runXY([0.001, 0.001]), 1.021048*4546.997777604715, 2) 38 38 39 39 def test_gaussian(self): … … 45 45 self.model.setParam('scale', 10.0) 46 46 47 self.assertAlmostEqual(self.model.run(0.001), 4723.32213339, 3)48 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 4743.56, 2)47 self.assertAlmostEqual(self.model.run(0.001), 1.1804794*4723.32213339, 3) 48 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.180454*4743.56, 2) 49 49 50 50 def test_clone(self): … … 57 57 58 58 new_model = self.model.clone() 59 self.assertAlmostEqual(new_model.run(0.001), 4723.32213339, 3)60 self.assertAlmostEqual(new_model.runXY([0.001,0.001]), 4743.56, 2)59 self.assertAlmostEqual(new_model.run(0.001), 1.1804794*4723.32213339, 3) 60 self.assertAlmostEqual(new_model.runXY([0.001,0.001]), 1.180454*4743.56, 2) 61 61 62 62 def test_gaussian_zero(self): … … 154 154 self.model.dispersion['length']['npts'] = 10 155 155 156 self.assertAlmostEqual(self.model.run(0.001), 358.44062724936009, 3)157 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 360.22673635224584, 3)156 self.assertAlmostEqual(self.model.run(0.001), 1.07832610*358.44062724936009, 3) 157 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.07844010*360.22673635224584, 3) 158 158 159 159 … … 235 235 236 236 237 self.assertAlmostEqual(self.model.run(0.001), 407.344127907553, 3)237 self.assertAlmostEqual(self.model.run(0.001), 1.16747510*407.344127907553, 3) 238 238 239 239 … … 286 286 287 287 288 self.assertAlmostEqual(self.model.run(0.001), 1 1948.72581312305, 3)289 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1 1811.972359807551, 3)288 self.assertAlmostEqual(self.model.run(0.001), 1.10650710*11948.72581312305, 3) 289 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.105898*11811.972359807551, 2) 290 290 291 291 def test_array(self): … … 339 339 """ 340 340 self.assertAlmostEqual(self.model.run(0.001), 90412744456148.094, 3) 341 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 90347660670656.391, 3)341 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 90347660670656.391, 1) 342 342 343 343 def test_dispersion(self): … … 348 348 disp = DisperseModel(self.model, ['radius'], [10]) 349 349 disp.setParam('n_pts', 10) 350 self.assertAlmostEqual(disp.run(0.001), 96795008379475.25, 3)350 self.assertAlmostEqual(disp.run(0.001), 96795008379475.25, 1) 351 351 352 352 def test_new_disp(self): … … 357 357 self.model.dispersion['radius']['npts'] = 10 358 358 359 self.assertAlmostEqual(self.model.run(0.001), 96795008379475.25,3)359 self.assertAlmostEqual(self.model.run(0.001), 1.19864810*96795008379475.25,3) 360 360 361 361 … … 415 415 self.model.dispersion['length']['npts'] = 10 416 416 417 self.assertAlmostEqual(self.model.run(0.001), 711.18048194151925, 3)418 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 704.63525988095705, 3)417 self.assertAlmostEqual(self.model.run(0.001), 1.23925910*711.18048194151925, 3) 418 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.238955*704.63525988095705, 3) 419 419 420 420 -
sansmodels/src/sans/models/test/utest_other_dispersity.py
r26e4a24 rdfa8832 33 33 self.model.dispersion['radius']['width'] = 5.0 34 34 self.model.dispersion['radius']['npts'] = 100 35 36 self.assertAlmostEqual(self.model.run(0.001), 4527.47250339, 3)37 self.assertAlmostEqual(self.model.runXY([0.001, 0.001]), 4546.997777604715, 3)35 print "constant",self.model.run(0.001), self.model.dispersion 36 self.assertAlmostEqual(self.model.run(0.001), 1.021051*4527.47250339, 3) 37 self.assertAlmostEqual(self.model.runXY([0.001, 0.001]), 1.021048*4546.997777604715, 2) 38 38 39 39 def test_gaussian(self): … … 45 45 self.model.setParam('scale', 10.0) 46 46 47 self.assertAlmostEqual(self.model.run(0.001), 4723.32213339, 3)48 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 4743.56, 2)47 self.assertAlmostEqual(self.model.run(0.001), 1.1804794*4723.32213339, 3) 48 self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.180454*4743.56, 2) 49 49 50 50 def test_clone(self): … … 58 58 new_model = self.model.clone() 59 59 print "gaussian",self.model.run(0.001) 60 self.assertAlmostEqual(new_model.run(0.001), 4723.32213339, 3)61 self.assertAlmostEqual(new_model.runXY([0.001,0.001]), 4743.56, 2)60 self.assertAlmostEqual(new_model.run(0.001), 1.1804794*4723.32213339, 3) 61 self.assertAlmostEqual(new_model.runXY([0.001,0.001]), 1.180454*4743.56, 2) 62 62 63 63 def test_schulz_zero(self):
Note: See TracChangeset
for help on using the changeset viewer.