Changeset 309ccaf in sasview for sansmodels/src


Ignore:
Timestamp:
Apr 13, 2009 11:50:02 AM (16 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:
37f487e
Parents:
42d27f2
Message:

utest for multiplication model (includeing DiaEll? and DiaCyl?).

File:
1 edited

Legend:

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

    r24276b6 r309ccaf  
    2727    fixed=[] 
    2828    fixed=['radius.width'] 
    29     """ 
     29     
    3030    #Radius of two models should not be equal.. 
    3131    def test_multplication_radius(self): 
    32         "" test multiplication model"" 
     32        "" "test multiplication model""" 
    3333        from sans.models.MultiplicationModel import MultiplicationModel 
    3434        from sans.models.CylinderModel import CylinderModel 
    3535        from sans.models.HardsphereStructure import HardsphereStructure 
    3636        model1 = CylinderModel() 
    37         model1.setParam("radius", 3) 
     37        model1.setParam("radius", 20) 
     38        model1.setParam("length", 400) 
    3839        model2 = HardsphereStructure() 
    3940        model  =  MultiplicationModel(model1,model2 ) 
    40         model.setParam("radius", 1) 
    41         self.assertEqual(model.getParam("radius"), 1) 
     41        model.setParam("radius", 20) 
     42        self.assertEqual(model.getParam("radius"), 20) 
    4243        #self.assertEqual(model.model1.getParam("radius"),3) 
    4344        from sans.models.DiamCylFunc import DiamCylFunc 
    4445        model4= DiamCylFunc() 
    4546        radius= model4.run(0.0) 
    46         self.assertEqual(model.model2.getParam("radius"),radius) 
    47     """     
     47        self.assertEqual(model.model2.getParam("radius"),74.400330888433245) 
     48         
     49    def test_multplication_radius1(self): 
     50        "" "test multiplication model""" 
     51        from sans.models.MultiplicationModel import MultiplicationModel 
     52        from sans.models.EllipsoidModel import EllipsoidModel 
     53        from sans.models.HardsphereStructure import HardsphereStructure 
     54        model1 = EllipsoidModel() 
     55        model1.setParam("radius_a", 20) 
     56        model1.setParam("radius_b", 400) 
     57        model2 = HardsphereStructure() 
     58        model  =  MultiplicationModel(model1,model2 ) 
     59        model.setParam("radius_a", 20) 
     60        self.assertEqual(model.getParam("radius_a"), 20) 
     61        #self.assertEqual(model.model1.getParam("radius"),3) 
     62        from sans.models.DiamEllipFunc import DiamEllipFunc 
     63        model4= DiamEllipFunc() 
     64        radius= model4.run(0.0) 
     65        self.assertEqual(model.model2.getParam("radius"),270.74504487588121) 
    4866     
    4967    def test_multiplication(self): 
Note: See TracChangeset for help on using the changeset viewer.