Changeset 9c648c7 in sasview


Ignore:
Timestamp:
Jan 22, 2009 2:29:59 PM (15 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:
50cbace
Parents:
fe060f7
Message:

reducing the start_points for parkfitting

Location:
park_integration
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • park_integration/ParkFitting.py

    r681f0dc r9c648c7  
    105105         
    106106        # See `park.fitresult.FitHandler` for details. 
    107         fitter = FitMC(localfit=localfit) 
     107        fitter = FitMC(localfit=localfit, start_points=1) 
    108108        if handler == None: 
    109109            print "no handler" 
    110110            handler= fitresult.ConsoleUpdate(improvement_delta=0.1) 
    111111        print "park handler", handler 
     112        
     113             
    112114        result = fit.fit(self.problem, 
    113115                         fitter=fitter, 
  • park_integration/ScipyFitting.py

    r681f0dc r9c648c7  
    5959        self.fitArrangeDict={} 
    6060        self.paramList=[] 
     61    #def fit(self, *args, **kw): 
     62    #    return profile(self._fit, *args, **kw) 
     63 
    6164    def fit(self ,handler=None, qmin=None, qmax=None): 
    6265        # Protect against simultanous fitting attempts 
     
    6871        fitproblem=[] 
    6972        for id ,fproblem in self.fitArrangeDict.iteritems(): 
    70             print "ScipyFitting:fproblem.get_to_fit() ",fproblem.get_to_fit() 
     73            #print "ScipyFitting:fproblem.get_to_fit() ",fproblem.get_to_fit() 
    7174            if fproblem.get_to_fit()==1: 
    7275                fitproblem.append(fproblem) 
     
    9699                qmax= numpy.max(data.image)  
    97100        functor= sansAssembly(self.paramList,model,data) 
     101         
     102         
    98103        out, cov_x, info, mesg, success = optimize.leastsq(functor,model.getParams(self.paramList), full_output=1, warning=True) 
    99104        chisqr = functor.chisq(out) 
     
    115120         
    116121        
    117                
    118              
     122def profile(fn, *args, **kw): 
     123    import cProfile, pstats, os 
     124    global call_result 
     125    def call(): 
     126        global call_result 
     127        call_result = fn(*args, **kw) 
     128    cProfile.runctx('call()', dict(call=call), {}, 'profile.out') 
     129    stats = pstats.Stats('profile.out') 
     130    #stats.sort_stats('time') 
     131    stats.sort_stats('calls') 
     132    stats.print_stats() 
     133    os.unlink('profile.out') 
     134    return call_result 
     135 
    119136       
Note: See TracChangeset for help on using the changeset viewer.