Changeset b461b8fe in sasview for sansmodels/src
- Timestamp:
- Jul 18, 2011 4:09:17 PM (13 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:
- a07161b
- Parents:
- 8f19b69
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_models_array.py
reba9885 rb461b8fe 37 37 def test1D_3(self): 38 38 """ 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) 44 44 45 45 … … 69 69 def test1D_2(self): 70 70 """ 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) 73 73 self.assertAlmostEqual(self.comp.run([0.2, 2.5]), 74 0.038176446608393366, 4)74 0.038176446608393366, 3) 75 75 76 76 def test1D_3(self): 77 77 """ 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]) 81 79 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) 84 82 85 83
Note: See TracChangeset
for help on using the changeset viewer.