Ignore:
Timestamp:
Jul 8, 2008 9:48:38 AM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
6e0f53a
Parents:
1c94a9f1
Message:

more tests added …most of them are failing because of uncertainty , scipy result and park resuls also little bit different

File:
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/test/constrainttestpark.py

    rcf3b781 r792db7d5  
    1010     
    1111    def test2models2dataonconstraint(self): 
    12         """ test fitting for two set of data  and one model with a constraint""" 
     12        """ test fitting for two set of data  and one model with 2 constraint""" 
    1313        from sans.fit.Loader import Load 
    1414        load= Load() 
     
    4242        engine.set_param( model2,"M2", {'A':'M1.A','B':'M1.B'}) 
    4343        engine.set_model(model2,2) 
     44         
    4445        engine.set_data(data2,2) 
    4546     
    4647         
    47         print engine.fit({'A':2,'B':1},None,None) 
    48         if True: 
    49             import pylab 
    50             x1 = engine.problem[0].data.x 
    51             x2 = engine.problem[1].data.x 
    52             y1 = engine.problem[0].data.y 
    53             y2 = engine.problem[1].data.y 
    54             fx1 = engine.problem[0].data.fx 
    55             fx2 = engine.problem[1].data.fx 
    56             pylab.plot(x1,y1,'xb',x1,fx1,'-b',x2,y2,'xr',x2,fx2,'-r') 
    57             pylab.show() 
     48        chisqr2, out2, cov2= engine.fit({'A':2,'B':1},None,None) 
     49        print "chisqr2",chisqr2 
     50        print "out2", out2 
     51        print " cov2", cov2 
     52        print chisqr2/len(data1.x) 
     53         
     54        self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2) 
     55        self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2) 
     56        #self.assert_(chisqr2/len(data1.x) < 2) 
     57        #self.assert_(chisqr2/len(data2.x) < 2) 
     58         
Note: See TracChangeset for help on using the changeset viewer.