Changeset dfa8832 in sasview for sansmodels/src/sans


Ignore:
Timestamp:
Jan 7, 2010 5:06:14 PM (15 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:
2db1d66
Parents:
c451be9
Message:

Updated some values of test accordingly to the changes in finding averaged volume for dispersions

Location:
sansmodels/src/sans/models/test
Files:
2 edited

Legend:

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

    r26e4a24 rdfa8832  
    3434        self.model.dispersion['radius']['npts'] = 100 
    3535         
    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) 
    3838         
    3939    def test_gaussian(self): 
     
    4545        self.model.setParam('scale', 10.0) 
    4646         
    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) 
    4949         
    5050    def test_clone(self): 
     
    5757         
    5858        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) 
    6161         
    6262    def test_gaussian_zero(self): 
     
    154154        self.model.dispersion['length']['npts'] = 10 
    155155 
    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) 
    158158         
    159159 
     
    235235 
    236236 
    237         self.assertAlmostEqual(self.model.run(0.001), 407.344127907553, 3) 
     237        self.assertAlmostEqual(self.model.run(0.001), 1.16747510*407.344127907553, 3) 
    238238 
    239239         
     
    286286 
    287287 
    288         self.assertAlmostEqual(self.model.run(0.001), 11948.72581312305, 3) 
    289         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 11811.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) 
    290290 
    291291    def test_array(self): 
     
    339339        """ 
    340340        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) 
    342342 
    343343    def test_dispersion(self): 
     
    348348        disp = DisperseModel(self.model, ['radius'], [10]) 
    349349        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) 
    351351         
    352352    def test_new_disp(self): 
     
    357357        self.model.dispersion['radius']['npts'] = 10 
    358358 
    359         self.assertAlmostEqual(self.model.run(0.001), 96795008379475.25, 3) 
     359        self.assertAlmostEqual(self.model.run(0.001), 1.19864810*96795008379475.25,3) 
    360360         
    361361         
     
    415415        self.model.dispersion['length']['npts'] = 10 
    416416 
    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) 
    419419         
    420420 
  • sansmodels/src/sans/models/test/utest_other_dispersity.py

    r26e4a24 rdfa8832  
    3333        self.model.dispersion['radius']['width'] = 5.0 
    3434        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) 
    3838         
    3939    def test_gaussian(self): 
     
    4545        self.model.setParam('scale', 10.0) 
    4646         
    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) 
    4949         
    5050    def test_clone(self): 
     
    5858        new_model = self.model.clone() 
    5959        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) 
    6262         
    6363    def test_schulz_zero(self): 
Note: See TracChangeset for help on using the changeset viewer.