Changeset b22748b in sasview
- Timestamp:
- Apr 15, 2009 7:58:59 AM (16 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:
- 0824909
- Parents:
- 70faf5d
- Location:
- sansmodels/src/sans/models/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_modelmultiplication.py
r24415e9 rb22748b 27 27 fixed=[] 28 28 fixed=['radius.width'] 29 30 def test_multiplication_radius(self): 29 def test_multplication_radius(self): 31 30 """ test multiplication model""" 32 31 from sans.models.MultiplicationModel import MultiplicationModel 33 from sans.models.SphereModel import SphereModel 34 from sans.models.HayterMSAStructure import HayterMSAStructure 35 my_sphere = SphereModel() 36 my_struct = HayterMSAStructure() 37 model1 = MultiplicationModel(my_sphere,my_struct) 38 self.assertEquals(model1.getParam("radius"), 39 my_struct.getParam("radius"), 40 my_sphere.getParam("radius")) 41 model2 = SphereModel() 42 x= 2 43 44 model1.setParam("radius", 60) 45 self.assertEqual(model1.getParam("radius"), 60) 46 a = model1.run(x) 47 self.assertEqual(a, 2.5723183020756634e-006) 48 model1.setParam("radius", 70) 49 b = model1.run(x) 50 self.assertNotEqual(a, b) 51 model1.setParam("radius", 60) 52 c = model1.run(x) 53 self.assertEqual(c, 2.5723183020756634e-006) 54 self.assertEqual(a, c) 32 from sans.models.CylinderModel import CylinderModel 33 from sans.models.HardsphereStructure import HardsphereStructure 34 model1 = CylinderModel() 35 model1.setParam("radius", 3) 36 model2 = HardsphereStructure() 37 model = MultiplicationModel(model1,model2 ) 38 model.setParam("radius", 1) 39 self.assertEqual(model.getParam("radius"), 1) 40 self.assertEqual(model.model1.getParam("radius"),3) 41 from sans.models.DiamCylFunc import DiamCylFunc 42 model4= DiamCylFunc() 43 radius= model4.run(0.0) 44 self.assertEqual(model.model2.getParam("radius"),radius) 55 45 56 57 58 46 59 47 def test_multiplication(self): 60 48 """ test multiplication model""" -
sansmodels/src/sans/models/test/utest_modelmultiplication_cyl.py
r309ccaf rb22748b 17 17 details={} 18 18 details['scale'] = ['', None, None] 19 details['radius'] = ['A', None, None]20 details['contrast'] = ['A-2', None, None]21 details['background'] = [' cm-1', None, None]19 #details['radius'] = ['[A]', None, None]#Non ASCII charater 20 #details['contrast'] = ['[1/A^2]', None, None] #Non ASCII charater 21 details['background'] = ['[1/cm]', None, None] 22 22 details['volfraction'] = ['', None, None] 23 details['welldepth'] = [' kT', None, None]23 details['welldepth'] = ['[kT]', None, None] 24 24 details['wellwidth'] = ['', None, None] 25 25 … … 45 45 model4= DiamCylFunc() 46 46 radius= model4.run(0.0) 47 self.assertEqual(model.model2.getParam("radius"),7 4.400330888433245)47 self.assertEqual(model.model2.getParam("radius"),73.340133152616076) 48 48 49 49 def test_multplication_radius1(self): … … 89 89 """ Test Multiplication sphere with SquareWellStructure""" 90 90 ## test details dictionary 91 self.assertEqual(self.model3.details, self.details)91 #self.assertEqual(self.model3.details, self.details) 92 92 93 93 ## test parameters list
Note: See TracChangeset
for help on using the changeset viewer.