Changeset 29100cb in sasview for sansmodels/src/sans/models/test/utest_extra_models.py
- Timestamp:
- Oct 15, 2010 9:00:21 AM (14 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:
- 495c377
- Parents:
- 8f20419d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_extra_models.py
r8f20419d r29100cb 287 287 self.assertAlmostEqual(self.model.run(0.001), 273.742, 3) 288 288 self.assertAlmostEqual(self.model.run(0.1501412), 0.040079, 6) 289 self.assertAlmostEqual(self.model.runXY(0.4425284), 0.00141167, 6) 290 289 self.assertAlmostEqual(self.model.runXY(0.4425284), 0.00141167, 8) 290 291 class TestUnifiedPowerRg(unittest.TestCase): 292 """ 293 Unit tests for FractalCoreShell Model function 294 """ 295 def setUp(self): 296 from sans.models.UnifiedPowerRgModel import UnifiedPowerRgModel 297 self.model1= UnifiedPowerRgModel(1) 298 self.model4= UnifiedPowerRgModel(4) 299 300 def test1DLabel1(self): 301 # Label #1 302 # the values are from Igor pro calculation 303 # the different digits are due to precision of q values 304 self.assertAlmostEqual(self.model1.run(0.001), 2.99956, 5) 305 self.assertAlmostEqual(self.model1.run(0.1501412), 0.126506, 6) 306 self.assertAlmostEqual(self.model1.runXY(0.4425284), 0.00306386, 8) 307 308 def test1DLabel4(self): 309 # Label #4 310 # Set params consistent w/NIST 311 # No. 4 already same 312 # No. 3 313 self.model4.setParam('Rg3', 200) 314 self.model4.setParam('B3', 5e-06) 315 self.model4.setParam('G3', 400) 316 # No. 2 317 self.model4.setParam('Rg2', 600) 318 self.model4.setParam('B2', 2e-07) 319 self.model4.setParam('G2', 4000) 320 # No. 1 321 self.model4.setParam('Rg1', 2000) 322 self.model4.setParam('B1', 1e-08) 323 self.model4.setParam('G1', 40000) 324 325 # the values are from Igor pro calculation 326 # the different digits are due to precision of q values 327 self.assertAlmostEqual(self.model4.run(0.001), 14778.4, 1) 328 self.assertAlmostEqual(self.model4.run(0.0301614), 7.88115, 4) 329 self.assertAlmostEqual(self.model4.run(0.1501412), 0.126864, 6) 330 self.assertAlmostEqual(self.model4.runXY(0.4425284), 0.00306386, 8) 331 332 291 333 if __name__ == '__main__': 292 334 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.