Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bb50393
code to create groups; remove CIF Author
briantoby Sep 6, 2025
96bc5e5
Merge remote-tracking branch 'origin/main' into TOFgroup
briantoby Sep 8, 2025
bf68f82
Merge remote-tracking branch 'origin/main' into TOFgroup
briantoby Sep 8, 2025
6d5470b
Add section for plotting grouped histograms. Still need to figure out…
briantoby Sep 10, 2025
0c00d51
Label plots using common & unique part of hist name; use reflection t…
briantoby Sep 10, 2025
3985cbe
make sharing X-axes an option for grouped plots
briantoby Sep 18, 2025
e99db49
WIP: adding group tree items & plot groups
briantoby Oct 22, 2025
bdb60ed
Merge remote-tracking branch 'origin/main' into TOFgroup to bring up …
briantoby Oct 22, 2025
751d211
WIP: get plotting working, fix display of groups. Next: table for edi…
briantoby Oct 23, 2025
68b0c08
WIP: shows table of HAP values, but can we make row labels not scroll?
briantoby Oct 27, 2025
789a02e
working implementation with unscrolled labels not 100% ideal and not …
briantoby Oct 29, 2025
88d1f19
clean implementation of group HAP display
briantoby Oct 30, 2025
df236d1
WIP: now sample param works
briantoby Nov 1, 2025
1f3458e
WIP: Edit parametric name; move refine after value
briantoby Nov 1, 2025
2019dbb
Full working version to display HAP, Sample & Inst vals
briantoby Nov 4, 2025
f9e6ed3
bring TOFgroup up to date with main
briantoby Nov 4, 2025
d2db3b9
Merge remote-tracking branch 'origin/main' into TOFgroup
briantoby Nov 7, 2025
98f2a43
Fix tickmarks in plot
briantoby Nov 8, 2025
31712f9
get latest changes in main
briantoby Nov 9, 2025
262e52b
update to latest main version
briantoby Nov 9, 2025
99cdfa5
fix bindings in plotting so that plotType etc is current
briantoby Nov 10, 2025
47b4858
WIP: implement Limits page; start on copy & ref/all
briantoby Nov 10, 2025
df1849d
finish copy/ref button implementation
briantoby Nov 10, 2025
d177f5c
Merge remote-tracking branch 'origin/main' into TOFgroup
briantoby Nov 19, 2025
d6263a5
bring in latest changes in main
briantoby Nov 22, 2025
6c44c16
allow limits to be set in Q & d; reset drags when mouse is out of plo…
briantoby Nov 29, 2025
b9d1c8d
update to match latest main branch & minor picker fixes
briantoby Nov 30, 2025
26fd234
move copy button to between 1st & 2nd column, but remove from limits …
briantoby Dec 1, 2025
0a25d8c
update from main
briantoby Dec 2, 2025
1a2742a
Add background terms
briantoby Dec 13, 2025
6e491f1
bring in fix for pdabc
briantoby Dec 13, 2025
c0ae310
implement limits on grouped plots; rework arrows & publish plot arrow…
briantoby Dec 14, 2025
8c32385
wrap group plot if too few entries
briantoby Dec 14, 2025
6a9fb4c
add menu bar for groups; fix bug for 2+ digit bank number
briantoby Dec 17, 2025
14d7ca2
pull in fix to bkg peaks
briantoby Dec 20, 2025
784e3be
refactor value reference in prep for copy by group
briantoby Dec 23, 2025
633f1bd
Add group copy/copy selected; load histogram & phase once; make prmAr…
briantoby Dec 27, 2025
820fe17
Add code based on PR #285 that preserves plot x-range & y-scaling acr…
briantoby Dec 28, 2025
3dd616b
closer to PR #285: preserves plot x-range in sharedX mode, but not y-…
briantoby Dec 29, 2025
6c64f45
Add routines to save/restore limits on all plot axes; restore limits …
briantoby Jan 2, 2026
20f40b7
fix problem where use of thin-long tickmarks rescaled x-axis
briantoby Jan 2, 2026
c8e308b
update pixi to match main
briantoby Jan 3, 2026
681763b
more work on preventing limit resets; this should replace everything …
briantoby Jan 3, 2026
fd5b416
update to latest version in main
briantoby Jan 6, 2026
93839da
contour plotting updates that have also been applied to main
briantoby Jan 8, 2026
750ccb7
update to latest main version
briantoby Jan 8, 2026
f369751
Add cross-hair cursor & change S/C buttons to ballot-box, as perhttps…
briantoby Jan 9, 2026
945ef81
Suppress liveplot except when PWDR selected; add Replot for Group aft…
briantoby Jan 10, 2026
b114fae
Address "Switch between single bank & grouped plot mode" request in 1…
briantoby Jan 11, 2026
85b53a0
Allow # of background terms to change from Group page as on 1/7 list …
briantoby Jan 16, 2026
249020c
Add a reset button for instrument parameters on delta-inst page
briantoby Jan 17, 2026
00ebc2c
Merge branch 'TOFgroup' of github.com:AdvancedPhotonSource/GSAS-II in…
briantoby Jan 17, 2026
225a8e4
For groups: color widgets by shift; set bkg color for ValidatedTextCt…
briantoby Jan 18, 2026
b1d26e8
rework group display considerably; address bugs seen on Mac
briantoby Jan 20, 2026
57d77c3
bring in latest changes from main
briantoby Jan 20, 2026
e158411
bring in latest changes from main
briantoby Jan 20, 2026
fa1cddd
show message when delta-inst table would be empty
briantoby Jan 20, 2026
a322331
cosmetics
briantoby Sep 17, 2026
bd5a510
merge in latest main branch
briantoby Sep 17, 2026
94c9c94
merge in duplicate changess
briantoby Sep 19, 2026
206df32
merge in sash fix
briantoby Sep 20, 2026
f5d49c0
start debugging the group fitting
briantoby Oct 4, 2026
7b4fd5a
significant amounts of debugging done
briantoby Oct 6, 2026
88385df
grouped sequential fitting now works, before fixes to table & selecti…
briantoby Oct 7, 2026
e8c2b22
WIP: Grouped Seq table now seems to display properly
briantoby Oct 8, 2026
b1b6ad2
added plotting of groups/histograms
briantoby Oct 8, 2026
5e593fe
now pseudovars test OK with grouped fit
briantoby Oct 9, 2026
fa94566
fix grouped LeBail fit
briantoby Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions GSASII/GSASIIconstrGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ def SelectVarbs(page,FrstVarb,varList,legend,constType):
l2 = max(l2,len(i2))
fmt = "{:"+str(l1)+"s} {:"+str(l2)+"s} {:s}"
atchoices = [fmt.format(*i1) for i1 in choices] # reformat list as str with columns
if groupDict and '*' in str(FrstVarb) and constType == 'equivalence':
legend += '\nOK to select no additional variables'
dlg = G2G.G2MultiChoiceDialog(
G2frame,legend,
'Constrain '+str(FrstVarb)+' with...',atchoices,
Expand All @@ -641,7 +643,7 @@ def SelectVarbs(page,FrstVarb,varList,legend,constType):
Selections = dlg.GetSelections()[:]
dlg.Destroy()
if res != wx.ID_OK: return []
if len(Selections) == 0:
if len(Selections) == 0 and not groupDict:
dlg = wx.MessageDialog(
G2frame,
'No variables were selected to include with '+str(FrstVarb),
Expand Down Expand Up @@ -1453,7 +1455,7 @@ def UpdateConstraintPanel(panel,typ):
lbl= "Define/edit constraints on refined parameters"
topSizer.Add(wx.StaticText(parent,label=lbl),0,WACV)
topSizer.Add((-1,-1),1,wx.EXPAND)
if G2frame.testSeqRefineMode():
if bool(G2frame.testSeqRefineMode(True)):
topSizer.Add(G2G.HelpButton(parent,helpIndex='Constraints-SeqRef'))
else:
topSizer.Add(G2G.HelpButton(parent,helpIndex='Constraints'))
Expand Down Expand Up @@ -1491,19 +1493,22 @@ def UpdateConstraintPanel(panel,typ):
butSizer.Add((-1,-1),1,wx.EXPAND,1)

Siz.Add(butSizer,0,wx.EXPAND)
if G2frame.testSeqRefineMode():
if bool(G2frame.testSeqRefineMode(True)):
butSizer = wx.BoxSizer(wx.HORIZONTAL)
butSizer.Add(wx.StaticText(panel,wx.ID_ANY,' Sequential Ref. Settings. Wildcard use: '),0,WACV)
btn = G2G.EnumSelector(panel, data, '_seqmode',
['Set hist # to *', 'Ignore unless hist=*', 'Use as supplied'],
['auto-wildcard', 'wildcards-only', 'use-all'],
lambda x: wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True))
butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL)
butSizer.Add(wx.StaticText(panel,wx.ID_ANY,' Selected histogram: '),0,WACV)
btn = G2G.EnumSelector(panel, data, '_seqhist',
Controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))
groupDict = Controls.get('Groups',{}).get('groupDict',{})
if not groupDict:
butSizer.Add(wx.StaticText(panel,wx.ID_ANY,' Selected histogram: '),0,WACV)
btn = G2G.EnumSelector(panel, data, '_seqhist',
list(seqHistList),list(range(len(seqHistList))),
lambda x: wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True))
butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL)
butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL)
Siz.Add(butSizer,0)
G2G.HorizontalLine(Siz,panel)
# Siz.Add((5,5),0)
Expand Down Expand Up @@ -1730,7 +1735,7 @@ def ImportConstraints(event):
'_seqmode':'auto-wildcard', '_seqhist':0}) #empty dict - fill it
if 'Global' not in data: #patch
data['Global'] = []
seqHistList = G2frame.testSeqRefineMode()
seqHistList = G2frame.testSeqRefineMode(True) # TODO: what about grouped Seq (groupDict)?
# patch: added ~version 5030 -- new mode for wild-card use in seq refs
# note that default for older sequential fits is 'wildcards-only' but in new GPX is 'auto-wildcard'
if seqHistList:
Expand All @@ -1752,9 +1757,12 @@ def ImportConstraints(event):
#===================================================
seqmode = 'use-all'
seqhistnum = None
groupDict = None
if seqHistList: # Selections used with sequential refinements
seqmode = data.get('_seqmode','wildcards-only')
seqhistnum = min(data.get('_seqhist',0),len(seqHistList)-1)
Controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))
groupDict = Controls.get('Groups',{}).get('groupDict',{})
Histograms,Phases = G2frame.GetUsedHistogramsAndPhasesfromTree()
G2frame.dataWindow.ConstraintEdit.Enable(G2G.wxID_SHOWISO,True)
#removed this check as it prevents examination of ISODISTORT constraints without data
Expand Down Expand Up @@ -1795,6 +1803,11 @@ def ImportConstraints(event):
' has been run.\nWe suggest you refine a scale factor.')
return

# determine if this is a grouped sequential fit
groupDict = None
if bool(G2frame.testSeqRefineMode(True)):
Controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))
groupDict = Controls.get('Groups',{}).get('groupDict',{})
# create a list of the phase variables
symHolds = []
(Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,EFtable,ORBtables,BLtable,MFtable,maxSSwave) = \
Expand All @@ -1820,7 +1833,7 @@ def ImportConstraints(event):
phaseAtTypes[item] = ''

# create a list of the hist*phase variables
if seqHistList: # for sequential refinement, only process selected histgram in list
if seqHistList and not groupDict: # for sequential refinement, only process selected histgram in list
histDict = {seqHistList[seqhistnum]:Histograms[seqHistList[seqhistnum]]}
else:
histDict = Histograms
Expand Down Expand Up @@ -1964,7 +1977,7 @@ def CheckScalePhaseFractions(G2frame,hist,histograms,phases,Constraints):
for histogram hist, if so, offer the user a chance to create a constraint
on the sum of phase fractions
'''
if G2frame.testSeqRefineMode(): # more work needed due to seqmode
if bool(G2frame.testSeqRefineMode(True)): # more work needed due to seqmode
return False
# histStr = '*'
else:
Expand Down
6 changes: 3 additions & 3 deletions GSASII/GSASIIctrlGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -5080,7 +5080,7 @@ def __init__(self,G2frame,title,parmDict,varyList,fullVaryList,
self.choiceDict = {}

parmFrozen = Controls.get('parmFrozen',{})
if G2frame.testSeqRefineMode():
if bool(G2frame.testSeqRefineMode(True)):
frozenList = set()
for h in parmFrozen:
if h == 'FrozenList': continue
Expand Down Expand Up @@ -5229,7 +5229,7 @@ def AddSpinner(varSizer,label,SelCtrl,binding):
))
parmFrozen = self.Controls.get('parmFrozen',{})
fcount = 0
if self.G2frame.testSeqRefineMode():
if bool(self.G2frame.testSeqRefineMode(True)):
for h in parmFrozen:
if h == 'FrozenList': continue
fcount += len(parmFrozen[h])
Expand Down Expand Up @@ -5402,7 +5402,7 @@ def ResetFrozen(event):
if name in self.parmWin.frozenList:
del self.parmWin.frozenList[self.parmWin.frozenList.index(name)]
parmFrozen = self.parmWin.Controls.get('parmFrozen',{})
if self.parmWin.G2frame.testSeqRefineMode():
if bool(self.parmWin.G2frame.testSeqRefineMode(True)):
for h in parmFrozen:
if h == 'FrozenList': continue
if name in parmFrozen[h]:
Expand Down
Loading
Loading