Changeset b461b8fe in sasview for sansmodels/src/sans/models/test


Ignore:
Timestamp:
Jul 18, 2011 2:09:17 PM (13 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:
a07161b
Parents:
8f19b69
Message:

update utest due to the changes in angles (rad→degree) and 2D data structure

File:
1 edited

Legend:

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

    reba9885 rb461b8fe  
    3737    def test1D_3(self): 
    3838        """ Test 2D model for a Shpere for 2 vectors as input """ 
    39         x= numpy.reshape(self.x, [len(self.x),1]) 
    40         y= numpy.reshape(self.y, [1,len(self.y)]) 
    41         vect = self.comp.evalDistribution([x,y]) 
    42         self.assertAlmostEqual(vect[0][0],9.2985e-07, 4) 
    43         self.assertAlmostEqual(vect[len(self.x)-1][len(self.y)-1],1.3871e-08, 4) 
     39        #x= numpy.reshape(self.x, [len(self.x),1]) 
     40        #y= numpy.reshape(self.y, [1,len(self.y)]) 
     41        vect = self.comp.evalDistribution([self.x,self.y]) 
     42        self.assertAlmostEqual(vect[0],9.2985e-07, 4) 
     43        self.assertAlmostEqual(vect[len(self.x)-1],1.3871e-08, 4) 
    4444         
    4545         
     
    6969    def test1D_2(self): 
    7070        """ Test 2D model of a cylinder """  
    71         self.comp.setParam('cyl_theta', 1.0) 
    72         self.comp.setParam('cyl_phi', 1.0) 
     71        self.comp.setParam('cyl_theta', 1.0 * 180/3.1415) 
     72        self.comp.setParam('cyl_phi', 1.0 * 180/3.1415) 
    7373        self.assertAlmostEqual(self.comp.run([0.2, 2.5]),  
    74                                0.038176446608393366, 4) 
     74                               0.038176446608393366, 3) 
    7575         
    7676    def test1D_3(self): 
    7777        """ Test 2D model for a cylinder for 2 vectors as input """ 
    78         x= numpy.reshape(self.x, [len(self.x),1]) 
    79         y= numpy.reshape(self.y, [1,len(self.y)]) 
    80         vect = self.comp.evalDistribution([x,y]) 
     78        vect = self.comp.evalDistribution([self.x,self.y]) 
    8179       
    82         self.assertAlmostEqual(vect[0][0],5.06121018e-08,4) 
    83         self.assertAlmostEqual(vect[len(self.x)-1][len(self.y)-1],2.5978e-11, 4) 
     80        self.assertAlmostEqual(vect[0],5.06121018e-08,4) 
     81        self.assertAlmostEqual(vect[len(self.x)-1],2.5978e-11, 4) 
    8482         
    8583         
Note: See TracChangeset for help on using the changeset viewer.