- Timestamp:
- Feb 20, 2021 1:25:23 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIconstrGUI.py ¶
r4822 r4823 1092 1092 eqString[-1] += '{:g}*{:} '.format(m,var) 1093 1093 varMean = G2obj.fmtVarDescr(var) 1094 helptext += "\n" + var+ " ("+ varMean + ")"1094 helptext += '\n{:3g} * {:} '.format(m,var) + " ("+ varMean + ")" 1095 1095 # Add ISODISTORT help items 1096 1096 if '_Explain' in data: … … 1105 1105 helptext += '\n\n' 1106 1106 helptext += hlptxt 1107 # typeString = 'NEWVAR'1108 # if item[-3]:1109 # eqString[-1] += ' = '+item[-3]1110 # else:1111 # eqString[-1] += ' = New Variable'1112 1107 if item[-3]: 1113 typeString = str(item[-3]) + ' = '1108 typeString = '(NEWVAR) ' + str(item[-3]) + ' = ' 1114 1109 else: 1115 1110 typeString = 'New Variable = ' … … 1134 1129 eqString[-1] += '{:g}*{:} '.format(m,var) 1135 1130 varMean = G2obj.fmtVarDescr(var) 1136 helptext += "\n" + var+ " ("+ varMean + ")"1131 helptext += '\n{:3g} * {:} '.format(m,var) + " ("+ varMean + ")" 1137 1132 typeString = 'CONST' 1138 1133 eqString[-1] += ' = '+str(item[-3]) 1139 1134 elif item[-1] == 'e': 1140 helptext = "The following variables are set to be equivalent, noting multipliers:" 1141 normval = item[:-3][1][0] 1135 helptext = "The following variable:" 1136 normval = item[:-3][0][0] 1137 indepterm = item[:-3][0][1] 1142 1138 for i,term in enumerate(item[:-3]): 1143 1139 var = str(term[1]) … … 1145 1141 if len(eqString[-1]) > maxlen: 1146 1142 eqString.append(' ') 1147 if i == 0: # move independent variable to end 1148 indepterm = term 1143 varMean = G2obj.fmtVarDescr(var) 1144 if i == 0: # move independent variable to end, as requested by Bob 1145 helptext += '\n{:} '.format(var) + " ("+ varMean + ")" 1146 helptext += "\n\nis equivalent to the following, noting multipliers:" 1149 1147 continue 1150 1148 elif eqString[-1] != '': 1151 1149 eqString[-1] += ' = ' 1152 if normval/term[0] == 1: 1150 m = normval/term[0] 1151 if m == 1: 1153 1152 eqString[-1] += '{:}'.format(var) 1154 1153 else: 1155 eqString[-1] += '{:g}*{:} '.format(normval/term[0],var) 1156 varMean = G2obj.fmtVarDescr(var) 1157 helptext += "\n" + var + " ("+ varMean + ")" 1158 if normval/indepterm[0] == 1: 1159 eqString[-1] += ' = {:} '.format(indepterm[1]) 1160 else: 1161 eqString[-1] += ' = {:g}*{:} '.format(normval/indepterm[0],str(indepterm[1])) 1154 eqString[-1] += '{:g}*{:} '.format(m,var) 1155 helptext += '\n{:3g} * {:} '.format(m,var) + " ("+ varMean + ")" 1156 eqString[-1] += ' = {:} '.format(indepterm) 1162 1157 typeString = 'EQUIV' 1163 1158 else: … … 1247 1242 elif data[name][Id][-1] == 'f': 1248 1243 data[name][Id][-2] = dlg.newvar[1] 1249 if type(data[name][Id][-3]) is str:1244 if dlg.newvar[0]: 1250 1245 # process the variable name to put in global form (::var) 1251 1246 varname = str(dlg.newvar[0]).strip().replace(' ','_') -
TabularUnified trunk/GSASIIobj.py ¶
r4809 r4823 1932 1932 'RBRU' : 'Residue rigid body group Uiso param.', 1933 1933 'constr([0-9]*)' : 'Parameter from constraint', 1934 'nv-([^_]+)_*' : 'New variable constraint parameter named \\1', 1934 1935 # supersymmetry parameters p::<var>:a:o 'Flen','Fcent'? 1935 1936 'mV([0-2])$' : 'Modulation vector component \\1', -
TabularUnified trunk/GSASIIstrIO.py ¶
r4814 r4823 191 191 fixedList = [] 192 192 ignored = 0 193 namedVarList = [] 193 194 for item in constList: 194 195 if item[-1] == 'h': … … 214 215 if varname is not None: 215 216 varname = str(varname) # in case this is a G2VarObj 216 if ':' in varname:217 if varname.startswith(':'): 217 218 D['_name'] = varname 218 219 else: 219 D['_name'] = '::' + varname 220 D['_name'] = '::nv-' + varname 221 D['_name'] = G2obj.MakeUniqueLabel(D['_name'],namedVarList) 220 222 D['_vary'] = varyFlag == True # force to bool 221 223 constDict.append(D)
Note: See TracChangeset
for help on using the changeset viewer.