Changes in / [85a3b46:233c121] in sasview
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/README.txt
r69ef722 r099c355 165 165 www.sasview.org/trac/wiki. 166 166 *** Note 2: If you have EXE or ZIP SasView installer, you won't need any of 167 the following. 167 the following. However it is highly recommended that any 168 previous versions be un-installed prior to installing the 169 new version. 168 170 169 171 2.1- System Requirements: … … 218 220 constrained fit will likely not be correct 219 221 - Save project does not store the state of all the windows 222 - Loading projects can be very slow 223 - Save Project only works once a data set has been associated with 224 a model. Error is reported on status bar. 220 225 221 226 3.2- Windows: 222 - None 227 - If installed to same directory as old version without first removing 228 the old version, the old desktop icon will remain but point to the 229 new exe version. Likewise all the start menu folders and items will 230 have the old name even though pointing to the new version. Usually 231 safest to uninstall old version prior to installing new version anyway. 223 232 224 233 3.3- MAC: -
src/sans/fit/BumpsFitting.py
reff93b8 reff93b8 169 169 for i,M in enumerate(self.fit_arrange_dict.values()) 170 170 if M.get_to_fit() == 1 ] 171 if len(models) == 0: 172 raise RuntimeError("Nothing to fit") 171 173 problem = FitProblem(models) 172 174 … … 246 248 mapper = SerialMapper 247 249 fitdriver.mapper = mapper.start_mapper(problem, None) 248 import time; T0 = time.time()250 #import time; T0 = time.time() 249 251 try: 250 252 best, fbest = fitdriver.fit() -
src/sans/guiframe/gui_manager.py
r51af54b rafb5080 1958 1958 wx.PostEvent(self, StatusEvent(status="Completed Saving.")) 1959 1959 else: 1960 msg = "No perspective windows are loaded. " 1961 msg += "No data was saved to %s\n" % (str(path)) 1960 msg = "Error occurred while saving the project: " 1961 msg += "To save, at least one application panel " 1962 msg += "should have a data set " 1963 msg += "and model selected. " 1964 msg += "No project was saved to %s" % (str(path)) 1962 1965 logging.error(msg) 1963 1966 wx.PostEvent(self,StatusEvent(status=msg)) -
src/sans/perspectives/fitting/fitpage.py
r4e9f227 r4e9f227 2068 2068 return self.tcChi.GetValue() 2069 2069 2070 def get_param_list(self):2071 """2072 :return self.param_toFit: list containing references to TextCtrl2073 checked.Theses TextCtrl will allow reference to parameters to fit.2074 2075 :raise: if return an empty list of parameter fit will nnote work2076 properly so raise ValueError,"missing parameter to fit"2077 """2078 if self.param_toFit != []:2079 return self.param_toFit2080 else:2081 msg = "missing parameters to fit"2082 wx.MessageBox(msg, 'warning')2083 return False2084 2085 2070 def onsetValues(self, chisqr, p_name, out, cov): 2086 2071 """ -
src/sans/perspectives/fitting/fitting.py
reff93b8 reff93b8 86 86 self.elapsed = 0.022 87 87 self.fit_panel = None 88 #let fit ready89 self.fitproblem_count = None90 88 #Flag to let the plug-in know that it is running stand alone 91 89 self.standalone = True … … 983 981 :param uid: id related to the panel currently calling this fit function. 984 982 """ 985 flag = True 986 ## count the number of fitproblem schedule to fit 987 fitproblem_count = 0 988 for value in self.page_finder.values(): 989 if value.get_scheduled() == 1: 990 fitproblem_count += 1 983 if uid is None: raise RuntimeError("no page to fit") # Should never happen 984 991 985 # Remember the user selected fit engine before the fit. Simultaneous 992 986 # fitting may change the selected engine, so it needs to be restored 993 987 # when the fit is complete. 994 988 self._gui_engine = self._fit_engine 995 self.fitproblem_count = fitproblem_count 996 if self._fit_engine in ("park","bumps"): 997 engineType = "Simultaneous Fit" 989 990 sim_page_uid = getattr(self.sim_page, 'uid', None) 991 batch_page_uid = getattr(self.batch_page, 'uid', None) 992 993 if uid == sim_page_uid: 994 fit_type = 'simultaneous' 995 elif uid == batch_page_uid: 996 fit_type = 'combined_batch' 998 997 else: 999 engineType = "Single Fit" 998 fit_type = 'single' 999 1000 # if constrained fit, don't use scipy leastsq directly 1001 if fit_type == 'simultaneous': 1002 if self._fit_engine not in ("park","bumps"): 1003 self._on_change_engine(engine='bumps') 1004 1005 1000 1006 fitter_list = [] 1001 1007 sim_fitter = None 1002 is_single_fit = True 1003 batch_on = False 1004 if self.sim_page is not None and self.sim_page.uid == uid: 1008 if fit_type == 'simultaneous': 1005 1009 #simulatanous fit only one engine need to be created 1006 ## if simultaneous fit change automatically the engine to park1007 if self._fit_engine not in ("park","bumps"):1008 self._on_change_engine(engine='park')1009 1010 sim_fitter = Fit(self._fit_engine) 1010 1011 sim_fitter.fitter_id = self.sim_page.uid 1011 1012 fitter_list.append(sim_fitter) 1012 is_single_fit = False 1013 batch_on = self.sim_page.batch_on 1014 1015 self.fitproblem_count = fitproblem_count 1016 if self._fit_engine in ("park","bumps"): 1017 engineType = "Simultaneous Fit" 1018 else: 1019 engineType = "Single Fit" 1020 1013 1021 1014 self.current_pg = None 1022 1015 list_page_id = [] 1023 1016 fit_id = 0 1024 batch_inputs = {} 1025 batch_outputs = {} 1026 for page_id, value in self.page_finder.iteritems(): 1017 for page_id, page_info in self.page_finder.iteritems(): 1027 1018 # For simulfit (uid give with None), do for-loop 1028 1019 # if uid is specified (singlefit), do it only on the page. 1029 if engineType == "Single Fit": 1030 #combine more than 1 batch page on single mode 1031 if self.batch_page is None or self.batch_page.uid != uid: 1032 if page_id != uid: 1033 continue 1020 if page_id in (sim_page_uid, batch_page_uid): continue 1021 if fit_type == "single" and page_id != uid: continue 1022 1034 1023 try: 1035 if value.get_scheduled() == 1: 1036 value.nbr_residuals_computed = 0 1037 #Get list of parameters name to fit 1038 pars = [] 1039 templist = [] 1024 if page_info.get_scheduled() == 1: 1025 page_info.nbr_residuals_computed = 0 1040 1026 page = self.fit_panel.get_page_by_id(page_id) 1041 1027 self.set_fit_weight(uid=page.uid, 1042 1028 flag=page.get_weight_flag(), 1043 1029 is2d=page._is_2D()) 1044 templist = page.get_param_list() 1045 flag = page._update_paramv_on_fit() 1046 if not flag: 1030 if not page.param_toFit: 1031 msg = "No fitting parameters for %s"%page.window_caption 1032 wx.PostEvent(page.parent.parent, 1033 StatusEvent(status=msg, info="error", 1034 type="stop")) 1035 return False 1036 if not page._update_paramv_on_fit(): 1047 1037 msg = "Fitting range or parameter values are" 1048 1038 msg += " invalid in %s" % \ … … 1051 1041 StatusEvent(status=msg, info="error", 1052 1042 type="stop")) 1053 return flag 1054 for element in templist: 1055 name = str(element[1]) 1056 pars.append(name) 1057 fitproblem_list = value.values() 1043 return False 1044 1045 pars = [str(element[1]) for element in page.param_toFit] 1046 fitproblem_list = page_info.values() 1058 1047 for fitproblem in fitproblem_list: 1059 1048 if sim_fitter is None: 1060 1049 fitter = Fit(self._fit_engine) 1061 1050 fitter.fitter_id = page_id 1062 self._fit_helper(fitproblem=fitproblem,1063 pars=pars,1064 fitter=fitter,1065 fit_id=fit_id,1066 batch_inputs=batch_inputs,1067 batch_outputs=batch_outputs)1068 1051 fitter_list.append(fitter) 1069 1052 else: 1070 1053 fitter = sim_fitter 1071 self._fit_helper(fitproblem=fitproblem,1054 self._add_problem_to_fit(fitproblem=fitproblem, 1072 1055 pars=pars, 1073 1056 fitter=fitter, 1074 fit_id=fit_id, 1075 batch_inputs=batch_inputs, 1076 batch_outputs=batch_outputs) 1057 fit_id=fit_id) 1077 1058 fit_id += 1 1078 1059 list_page_id.append(page_id) 1079 current_page_id = page_id 1080 value.clear_model_param() 1060 page_info.clear_model_param() 1081 1061 except KeyboardInterrupt: 1082 flag = True1083 1062 msg = "Fitting terminated" 1084 1063 wx.PostEvent(self.parent, StatusEvent(status=msg, info="info", 1085 1064 type="stop")) 1086 return flag1065 return True 1087 1066 except: 1088 flag = False 1089 msg = "%s error: %s" % (engineType, sys.exc_value) 1067 msg = "Fitting error: %s" % str(sys.exc_value) 1090 1068 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 1091 1069 type="stop")) 1092 return flag1070 return False 1093 1071 ## If a thread is already started, stop it 1094 1072 #if self.calc_fit!= None and self.calc_fit.isrunning(): … … 1102 1080 improvement_delta=0.1) 1103 1081 self._mac_sleep(0.2) 1104 ## perform single fit1105 try:1106 page = self.fit_panel.get_page_by_id(uid)1107 batch_on = page.batch_on1108 except:1109 try:1110 #if the id cannot be found then we deal with a self.sim_page1111 #or a self.batch_page1112 if self.sim_page is not None and uid == self.sim_page.uid:1113 batch_on = self.sim_page.batch_on1114 if self.batch_page is not None and uid == self.batch_page.uid:1115 batch_on = self.batch_page.batch_on1116 except:1117 batch_on = False1118 1082 1119 1083 # batch fit 1120 if batch_on: 1084 batch_inputs = {} 1085 batch_outputs = {} 1086 page = self.fit_panel.get_page_by_id(uid) 1087 if page.batch_on: 1121 1088 calc_fit = FitThread(handler=handler, 1122 1089 fn=fitter_list, … … 1129 1096 reset_flag=self.batch_reset_flag) 1130 1097 else: 1131 # single fit: not batch and not simul fit1132 if not is_single_fit:1133 current_page_id = self.sim_page.uid1134 1098 ## Perform more than 1 fit at the time 1135 1099 calc_fit = FitThread(handler=handler, … … 1141 1105 completefn=self._fit_completed, 1142 1106 ftol=self.ftol) 1143 self.fit_thread_list[current_page_id] = calc_fit 1107 #self.fit_thread_list[current_page_id] = calc_fit 1108 self.fit_thread_list[uid] = calc_fit 1144 1109 calc_fit.queue() 1110 calc_fit.ready(2.5) 1145 1111 msg = "Fitting is in progress..." 1146 1112 wx.PostEvent(self.parent, StatusEvent(status=msg, type="progress")) 1147 1113 1148 self.ready_fit(calc_fit=calc_fit) 1149 return flag 1150 1151 def ready_fit(self, calc_fit): 1152 """ 1153 Ready for another fit 1154 """ 1155 if self.fitproblem_count != None and self.fitproblem_count > 1: 1156 calc_fit.ready(2.5) 1157 else: 1158 time.sleep(0.4) 1159 1114 return True 1115 1160 1116 def remove_plot(self, uid, fid=None, theory=False): 1161 1117 """ … … 1297 1253 self.page_finder[uid].schedule_tofit(value) 1298 1254 1299 def _fit_helper(self, fitproblem, pars, fitter, fit_id, 1300 batch_inputs, batch_outputs): 1255 def _add_problem_to_fit(self, fitproblem, pars, fitter, fit_id): 1301 1256 """ 1302 1257 Create and set fit engine with series of data and model -
src/sans/perspectives/fitting/simfitpage.py
r4e9f227 r4e9f227 138 138 self.Layout() 139 139 break 140 self._onAdd_constraint(None) 140 141 ## some model or parameters can be constrained 142 self._show_constraint() 143 self.sizer3.Layout() 144 self.Layout() 145 self.Refresh() 146 #self._onAdd_constraint(None) 141 147 142 148 def onFit(self, event):
Note: See TracChangeset
for help on using the changeset viewer.