Changes in / [4ec7089:61a2a0c] in sasview
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r3d8c49a rc8e1996 1157 1157 category_pos = int(state.categorycombobox) 1158 1158 except: 1159 if state.formfactorcombobox is not None: 1160 state._convert_to_sasmodels() 1159 state.formfactorcombobox = state.formfactorcombobox.lower() 1160 state.formfactorcombobox = \ 1161 state.formfactorcombobox.replace('model', '') 1162 state.formfactorcombobox = unicode(state.formfactorcombobox) 1161 1163 state.categorycombobox = unicode(state.categorycombobox) 1162 1164 if state.categorycombobox in self.categorybox.Items: … … 1526 1528 index_data = ((self.qmin_x <= self.data.x) & 1527 1529 (self.data.x <= self.qmax_x)) 1528 val = str(len( [index_data is True]))1530 val = str(len(self.data.x[index_data is True])) 1529 1531 self.Npts_fit.SetValue(val) 1530 1532 else: -
src/sas/sasgui/perspectives/fitting/pagestate.py
r3d8c49a rc8e1996 355 355 obj.saved_states[copy_name] = copy_state 356 356 return obj 357 358 def _convert_to_sasmodels(self):359 """360 Convert parameters to a form usable by sasmodels converter361 362 :return: None363 """364 from sasmodels import convert365 # Create conversion dictionary to send to sasmodels366 p = dict()367 for fittable, name, value, _, uncert, lower, upper, units in \368 self.parameters:369 if not value:370 value = numpy.nan371 if not uncert or uncert[1] == '':372 uncert[0] = False373 uncert[1] = numpy.nan374 if not upper or upper[1] == '':375 upper[0] = False376 upper[1] = numpy.nan377 if not lower or lower[1] == '':378 lower[0] = False379 lower[1] = numpy.nan380 p[name] = {381 "fittable" : bool(fittable),382 "value" : float(value),383 "std" : float(uncert[1]),384 "upper" : float(upper[1]),385 "lower" : float(lower[1]),386 "units" : units,387 }388 name, params = convert.convert_model(self.formfactorcombobox, p)389 390 # Only convert if old != new, otherwise all the same391 if name != self.formfactorcombobox:392 self.formfactorcombobox = name393 self.parameters = []394 for name, info in params.iteritems():395 if info.get("std") is not numpy.nan:396 std = ['True', str(info.get("std"))]397 else:398 std = ['False', '']399 if info.get("lower") is not numpy.nan:400 lower = ['True', str(info.get("lower"))]401 else:402 lower = ['False', '']403 if info.get("upper") is not numpy.nan:404 upper = ['True', str(info.get("upper"))]405 else:406 upper = ['False', '']407 param_list = [info.get("fittable"), name, info.get("value"),408 "+/-", std, lower, upper]409 self.parameters.append(param_list)410 411 357 412 358 def _repr_helper(self, list, rep):
Note: See TracChangeset
for help on using the changeset viewer.