Changeset 40add21 in sasview for src/sas/sasgui/perspectives/calculator
- Timestamp:
- Aug 4, 2017 11:31:27 AM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- b1c2011
- Parents:
- 1abd19c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/model_editor.py
r490c617 r40add21 1065 1065 p_line = param_line.lstrip().rstrip() 1066 1066 if p_line: 1067 pname, pvalue = self.get_param_helper(p_line)1067 pname, pvalue, desc = self.get_param_helper(p_line) 1068 1068 param_names.append(pname) 1069 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', ' '],\n" % (spaces16, pname, pvalue))1069 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], '', '%s'],\n" % (spaces16, pname, pvalue, desc)) 1070 1070 for param_line in pd_param_str.split('\n'): 1071 1071 p_line = param_line.lstrip().rstrip() 1072 1072 if p_line: 1073 pname, pvalue = self.get_param_helper(p_line)1073 pname, pvalue, desc = self.get_param_helper(p_line) 1074 1074 param_names.append(pname) 1075 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', ' '],\n" % (spaces16, pname, pvalue))1075 out_f.write("%s['%s', '', %s, [-numpy.inf, numpy.inf], 'volume', '%s'],\n" % (spaces16, pname, pvalue, desc)) 1076 1076 out_f.write('%s]\n' % spaces13) 1077 1077 … … 1114 1114 for item in items: 1115 1115 name = item.split("=")[0].strip() 1116 description = "" 1116 1117 try: 1117 1118 value = item.split("=")[1].strip() 1118 1119 if value.count("#"): 1119 1120 # If line ends in a comment, remove it before parsing float 1121 index = value.index("#") 1122 description = value[(index + 1):].strip() 1120 1123 value = value[:value.index("#")].strip() 1121 1124 float(value) … … 1123 1126 value = 1.0 # default 1124 1127 1125 return name, value 1128 return name, value, description 1126 1129 1127 1130 def set_function_helper(self, line):
Note: See TracChangeset
for help on using the changeset viewer.