Changeset 9c648c7 in sasview for park_integration
- Timestamp:
- Jan 22, 2009 2:29:59 PM (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:
- 50cbace
- Parents:
- fe060f7
- Location:
- park_integration
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/ParkFitting.py
r681f0dc r9c648c7 105 105 106 106 # See `park.fitresult.FitHandler` for details. 107 fitter = FitMC(localfit=localfit )107 fitter = FitMC(localfit=localfit, start_points=1) 108 108 if handler == None: 109 109 print "no handler" 110 110 handler= fitresult.ConsoleUpdate(improvement_delta=0.1) 111 111 print "park handler", handler 112 113 112 114 result = fit.fit(self.problem, 113 115 fitter=fitter, -
park_integration/ScipyFitting.py
r681f0dc r9c648c7 59 59 self.fitArrangeDict={} 60 60 self.paramList=[] 61 #def fit(self, *args, **kw): 62 # return profile(self._fit, *args, **kw) 63 61 64 def fit(self ,handler=None, qmin=None, qmax=None): 62 65 # Protect against simultanous fitting attempts … … 68 71 fitproblem=[] 69 72 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() 71 74 if fproblem.get_to_fit()==1: 72 75 fitproblem.append(fproblem) … … 96 99 qmax= numpy.max(data.image) 97 100 functor= sansAssembly(self.paramList,model,data) 101 102 98 103 out, cov_x, info, mesg, success = optimize.leastsq(functor,model.getParams(self.paramList), full_output=1, warning=True) 99 104 chisqr = functor.chisq(out) … … 115 120 116 121 117 118 122 def 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 119 136
Note: See TracChangeset
for help on using the changeset viewer.