Changeset d48858da in sasview for park_integration
- Timestamp:
- Aug 17, 2011 9:02:51 AM (13 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:
- d4edd72
- Parents:
- aaeae3a0
- Location:
- park_integration/test
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/test/batch_fit.py
re5df560 rd48858da 5 5 import time 6 6 import unittest 7 from DataLoader.loader import Loader7 from sans.dataloader.loader import Loader 8 8 from sans.fit.Fitting import Fit 9 9 from sans.models.CylinderModel import CylinderModel … … 13 13 NPTS = 1 14 14 15 16 17 15 18 def classMapper(classInstance, classFunc, *args): 16 19 """ … … 24 27 25 28 29 26 30 class BatchScipyFit: 27 31 """ 28 test fit module using map function32 test fit module 29 33 """ 30 34 def __init__(self, qmin=None, qmax=None): … … 85 89 self.list_of_constraints = [] 86 90 self.list_of_mapper = [] 91 engine ="scipy" 87 92 88 93 path = "testdata_line3.txt" 89 self._reset_helper(path=path, engine= "scipy", npts=NPTS)94 self._reset_helper(path=path, engine=engine, npts=NPTS) 90 95 path = "testdata_line.txt" 91 self._reset_helper(path=path, engine= "scipy", npts=NPTS)96 self._reset_helper(path=path, engine=engine, npts=NPTS) 92 97 path = "SILIC010_noheader.DAT" 93 self._reset_helper(path=path, engine= "scipy", npts=NPTS)98 self._reset_helper(path=path, engine=engine, npts=NPTS) 94 99 path = "cyl_400_20.txt" 95 self._reset_helper(path=path, engine= "scipy", npts=NPTS)100 self._reset_helper(path=path, engine=engine, npts=NPTS) 96 101 path = "sphere_80.txt" 97 self._reset_helper(path=path, engine= "scipy", npts=NPTS)102 self._reset_helper(path=path, engine=engine, npts=NPTS) 98 103 path = "PolySpheres.txt" 99 self._reset_helper(path=path, engine="scipy", npts=NPTS) 104 self._reset_helper(path=path, engine=engine, npts=NPTS) 105 path = "latex_qdev.txt" 106 self._reset_helper(path=path, engine=engine, npts=NPTS) 107 path = "latex_qdev2.txt" 108 self._reset_helper(path=path, engine=engine, npts=NPTS) 100 109 101 110 def test_map_fit(self): … … 103 112 """ 104 113 results = map(classMapper,self.list_of_fitter, self.list_of_function) 105 #print len(results)106 #for result in results:107 #print result.fitness, result.stderr, result.pvec114 print len(results) 115 for result in results: 116 print result.fitness, result.stderr, result.pvec 108 117 109 118 def test_process_map_fit(self, n=1): … … 118 127 iterable=temp) 119 128 t1 = time.time() 120 print "got %s fit results in %ss" % (str(len(results)), str(t1 - t0))121 122 #for result in results:123 #print result.fitness, result.stderr, result.pvec124 #t2 = time.time()125 #print "print fitresults ", time.strftime(" %H:%M:%S", time.localtime(t2)), t2 - t1129 print "got fit results ", time.strftime(" %H:%M:%S", time.localtime(t1)), t1 - t0 130 print len(results) 131 for result in results: 132 print result.fitness, result.stderr, result.pvec 133 t2 = time.time() 134 print "print fit1 results ", time.strftime(" %H:%M:%S", time.localtime(t2)), t2 - t1 126 135 127 136 class testBatch(unittest.TestCase): … … 136 145 self.test.test_map_fit() 137 146 138 def test_fit2(self):139 140 self.test.set_range(qmin=0.013, qmax=0.05)141 self.test.reset_value()142 self.test.test_map_fit()147 #def test_fit2(self): 148 # """test fit with python built in map function---- common range for all data""" 149 # self.test.set_range(qmin=0.013, qmax=0.05) 150 # self.test.reset_value() 151 # self.test.test_map_fit() 143 152 144 153 def test_fit3(self): … … 148 157 self.test.test_process_map_fit(n=1) 149 158 150 def test_fit4(self):151 """test fit with a common fixed range for data using 1 processor and map"""152 self.test.set_range(qmin=0.013, qmax=0.05)153 self.test.reset_value()154 self.test.test_process_map_fit(n=1)159 #def test_fit4(self): 160 # """test fit with a common fixed range for data using 1 processor and map""" 161 # self.test.set_range(qmin=0.013, qmax=0.05) 162 # self.test.reset_value() 163 # self.test.test_process_map_fit(n=1) 155 164 156 165
Note: See TracChangeset
for help on using the changeset viewer.