- Timestamp:
- Mar 13, 2022 11:38:03 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIconstrGUI.py ¶
r5182 r5216 1396 1396 btn = wx.Button(panel, wx.ID_ANY, 'Show generated constraints') 1397 1397 butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL) 1398 txt = G2mv.VarRemapShow(linelen=999).replace('&','&&') 1398 1399 btn.Bind(wx.EVT_BUTTON,lambda event: 1399 1400 G2G.ShowScrolledColText(panel, 1400 '*** Constraints after processing ***'+ G2mv.VarRemapShow(linelen=999),1401 '*** Constraints after processing ***'+txt, 1401 1402 header='Generated constraints',col1len=80)) 1402 1403 panel.delBtn = wx.Button(panel, wx.ID_ANY, 'Delete selected') -
TabularUnified trunk/GSASIIctrlGUI.py ¶
r5204 r5216 2565 2565 for i,line in enumerate(txt.split('\n')): 2566 2566 if line.strip().endswith(':'): 2567 st = wx.StaticText(spanel,wx.ID_ANY,line ,style=wx.ALIGN_CENTER)2567 st = wx.StaticText(spanel,wx.ID_ANY,line) 2568 2568 txtSizer.Add(st,pos=(i,0),span=(0,cols),flag=wx.EXPAND) 2569 2569 continue 2570 2570 elif line.strip().startswith('**') and line.strip().endswith('**'): 2571 st = wx.StaticText(spanel,wx.ID_ANY,line )2571 st = wx.StaticText(spanel,wx.ID_ANY,line,style=wx.ALIGN_CENTER) 2572 2572 st.SetBackgroundColour(DULL_YELLOW) 2573 2573 txtSizer.Add(st,pos=(i,0),span=(0,cols),flag=wx.EXPAND) … … 2584 2584 while col == 0 and len(t) > col1len: 2585 2585 b = -1 2586 for sym in (') ',' * ',' + ',' - '): 2587 if sym in t[:col1len]: 2588 b = max(b,t.rfind(sym,0,col1len)+len(sym)) 2589 s += t[:b] + '\n\t' 2590 t = t[b:] 2586 for sym in (') ',' * ',' + ',' - ',' && '): 2587 b = max(b, t.rfind(sym,0,col1len)) 2588 if b > 20: 2589 s += t[:b+1] 2590 t = '\n\t' + t[b+1:] 2591 continue 2592 break 2591 2593 s += t 2592 2594 st = wx.StaticText(spanel,wx.ID_ANY,s) 2593 if col == 0: st.Wrap(6 00)2595 if col == 0: st.Wrap(650) # last resort... 2594 2596 st.SetBackgroundColour(wx.WHITE) 2595 2597 txtSizer.Add(st,pos=(i,col),flag=wx.EXPAND) 2596 txtSizer.AddGrowableRow(i)2598 #txtSizer.AddGrowableRow(i) 2597 2599 txtSizer.AddGrowableCol(0) #to fill screen 2598 2600 spanel.SetSizer(txtSizer) -
TabularUnified trunk/GSASIImapvars.py ¶
r5204 r5216 2226 2226 for v,m in zip(varlist,invmultarr): 2227 2227 if debug: print ('v,m[0]: ',v,m[0]) 2228 if len(s1.split('\n')[-1]) > 75: s1 += '\n '2229 2228 if j > 0: s1 += ' & ' 2230 2229 j += 1 2231 2230 s1 += str(v) 2232 2231 if m != 1: 2233 s1 += " / " + str(m[0]) 2232 s1 += " / " + '{:.4f}'.format(m[0]) 2233 #if len(s1.split('\n')[-1]) > 70: 2234 # s1 = ' \n &'.join(s1.rsplit('&',1)) 2234 2235 if symFlag: 2235 2236 symOut += s1 + '\n' … … 2318 2319 return s 2319 2320 2321 def getInvConstraintEq(var,varyList): 2322 '''For a dependent variable, find the constraint that 2323 defines the dependent variable in terms of varied independent variables. 2324 This works for constraint equations (via new var or generated parameters) 2325 or equivalences. For equivalences the result will lists of length 1 2326 2327 :param str var: named of refined variable (e.g. 0:0:Scale) 2328 :param list varyList: list of refined variables 2329 :returns: vList,mList where vList is a list of variables and 2330 mList is a list of multipliers for that variable (floats) 2331 ''' 2332 for varlist,mapvars,invmultarr in zip(dependentParmList,indParmList,invarrayList): 2333 if var not in varlist: continue 2334 i = varlist.index(var) 2335 print(var,i) 2336 vList = [] 2337 mList = [] 2338 for m,v in zip(invmultarr[i,:],mapvars): 2339 if v not in varyList: continue 2340 if m == 0: continue 2341 if v == 0: continue 2342 vList.append(v) 2343 mList.append(m) 2344 return vList,mList 2345 if GSASIIpath.GetConfigValue('debug'): print('getInvConstraintEq: not found: ',var) 2346 return [],[] # unexpected -- not an independent parameter 2347 2320 2348 def GetSymEquiv(seqmode,seqhistnum): 2321 2349 '''Return the automatically generated (equivalence) relationships.
Note: See TracChangeset
for help on using the changeset viewer.