Changeset 495c377 in sasview for sansmodels/src/sans/models/test


Ignore:
Timestamp:
Oct 15, 2010 10:49:31 AM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
18f2ca1
Parents:
29100cb
Message:

added a dispersion test for the fractalcoreshell model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/test/utest_extra_models.py

    r29100cb r495c377  
    287287        self.assertAlmostEqual(self.model.run(0.001), 273.742, 3) 
    288288        self.assertAlmostEqual(self.model.run(0.1501412), 0.040079, 6) 
    289         self.assertAlmostEqual(self.model.runXY(0.4425284), 0.00141167, 8)                              
     289        self.assertAlmostEqual(self.model.runXY(0.4425284), 0.00141167, 8)   
     290          
     291    def test1DSchulzDispersion(self):       
     292        # Same test w/ test1D up there but w/ Schulzdispersion 
     293        from sans.models.dispersion_models import SchulzDispersion 
     294        disp = SchulzDispersion() 
     295        self.model.set_dispersion('radius', disp) 
     296        self.model.dispersion['radius']['width'] = 2.0 
     297        self.model.dispersion['radius']['npts'] = 100 
     298        self.model.dispersion['radius']['nsigmas'] = 3.0 
     299        # the values are from Igor pro calculation 
     300        # the run does not neccessary to be exactly same with NIST  
     301        # 'cause we used different method. 
     302        self.assertAlmostEqual(self.model.run(0.001), 287.851, -1) 
     303        self.assertAlmostEqual(self.model.run(0.1501412), 0.0500775, 3) 
     304        self.assertAlmostEqual(self.model.runXY(0.4425284), 0.00390948, 3)          
     305        
    290306 
    291307class TestUnifiedPowerRg(unittest.TestCase): 
     
    329345        self.assertAlmostEqual(self.model4.run(0.1501412), 0.126864, 6) 
    330346        self.assertAlmostEqual(self.model4.runXY(0.4425284), 0.00306386, 8)   
    331                                                                                    
     347                                                                               
    332348                                                                                                                                                                                  
    333349if __name__ == '__main__': 
Note: See TracChangeset for help on using the changeset viewer.