Skip to content

Commit e601fdd

Browse files
committed
Merge remote-tracking branch 'origin/main' into cinema (see #11)
to keep up to date with main branch
2 parents 2876239 + e10fb4b commit e601fdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1071
-705
lines changed

GSASII/GSASIIctrlGUI.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9486,7 +9486,7 @@ def gitCheckUpdates(G2frame):
94869486
else:
94879487
msg = ('You have made a local branch and have switched to that.'+
94889488
' Do you want to update anyway? Doing so will return'+
9489-
' you to the master branch. This may be better handled'+
9489+
' you to the main branch. This may be better handled'+
94909490
' manually.\n\nPress "Yes" to continue with update\n'+
94919491
'Press "Cancel" to stop the update.')
94929492
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9505,7 +9505,7 @@ def gitCheckUpdates(G2frame):
95059505
"changes locally. Your local commits will be difficult "+
95069506
"to locate if you update. SUGGESTION: if your changes "+
95079507
"are meaningful, create a new git branch and return "+
9508-
"to the master branch.\n\n"+
9508+
"to the main branch.\n\n"+
95099509
'Press "Yes" to continue, stranding your local changes\n'+
95109510
'Press "Cancel" to stop the update.')
95119511
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9524,13 +9524,31 @@ def gitCheckUpdates(G2frame):
95249524
return
95259525
if len(lc) != 0:
95269526
msg = ('You have made local changes and committed them '+
9527-
'into the master branch. GUI-based updates cannot '+
9527+
'into the main branch. GUI-based updates cannot '+
95289528
'be made. You should perform a git merge manually')
95299529
G2MessageBox(G2frame,msg,title='Do manual update')
95309530
return
95319531

95329532
cmds = ['--git-update']
9533-
if localChanges:
9533+
if localChanges and GSASIIpath.GetConfigValue('debug'):
9534+
msg = ('You have locally-made changes to the GSAS-II source '+
9535+
'code files. Do you want to stash them before updating?\n\n'+
9536+
'If you select "Yes" the update will be applied after '+
9537+
'using git stash. You will need to use "git stash pop" '+
9538+
'to get these changes back.'+
9539+
'\n\nIf you select "No" no update will '+
9540+
'be performed.')
9541+
dlg = wx.MessageDialog(G2frame, msg, 'Stash Local Changes?',
9542+
wx.YES_NO|wx.NO_DEFAULT|wx.CENTRE|wx.ICON_QUESTION)
9543+
ans = dlg.ShowModal()
9544+
dlg.Destroy()
9545+
if ans != wx.ID_YES:
9546+
return
9547+
g2repo = GSASIIpath.openGitRepo(path2GSAS2)
9548+
import datetime as dt
9549+
now = dt.datetime.strftime(dt.datetime.now(),"%Y-%m-%dT%H:%M")
9550+
g2repo.git.stash(f'-m "preserving local changes prior to update from GUI @ {now}"')
9551+
elif localChanges:
95349552
if gitAskLocalChanges(G2frame,cmds): return
95359553
if gitAskSave(G2frame,regressmsg,cmds): return
95369554
# launch changes and restart
@@ -9604,11 +9622,11 @@ def gitSelectVersion(G2frame):
96049622
if localChanges:
96059623
msg = ('You have switched to a local branch and have '+
96069624
'uncommited changes. Save, stash or restore and switch '+
9607-
'back to the master branch. Regression is not possible '+
9625+
'back to the main branch. Regression is not possible '+
96089626
'from the GUI when on any other branch.')
96099627
else:
96109628
msg = ('You have made and switched to a local branch. '+
9611-
'You must manually switch back to the master branch.'+
9629+
'You must manually switch back to the main branch.'+
96129630
' Regression is not possible '+
96139631
'from the GUI when on any other branch.')
96149632
G2MessageBox(G2frame,msg,title='update not possible')
@@ -9624,7 +9642,7 @@ def gitSelectVersion(G2frame):
96249642
"changes locally. Your local commits will be difficult "+
96259643
"to locate if you update. SUGGESTION: if your changes "+
96269644
"are meaningful, create a new git branch and return "+
9627-
"to the master branch.\n\n"+
9645+
"to the main branch.\n\n"+
96289646
'Press "Yes" to continue, stranding your local changes\n'+
96299647
'Press "Cancel" to stop the update.')
96309648
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9638,7 +9656,7 @@ def gitSelectVersion(G2frame):
96389656
rc,lc,_ = GSASIIpath.gitCheckForUpdates(False)
96399657
if len(lc) != 0:
96409658
msg = ('You have made local changes and committed them '+
9641-
'into the master branch. GUI-based regression cannot '+
9659+
'into the main branch. GUI-based regression cannot '+
96429660
'be done. You should perform a "git checkout" to the '+
96439661
'desired version manually')
96449662
G2MessageBox(G2frame,msg,title='Do manual update')

GSASII/GSASIIdataGUI.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7172,6 +7172,8 @@ def _makemenu(): # routine to create menu when first used
71727172
self.GeneralCalc.Append(G2G.wxID_COMPARECELLS,'Compare Cells','Compare Unit Cells using NIST*LATTICE')
71737173
self.GeneralCalc.Append(G2G.wxID_COMPARESTRUCTURE,'Compare polyhedra','Compare polyhedra to ideal octahedra/tetrahedra')
71747174
self.GeneralCalc.Enable(G2G.wxID_COMPARESTRUCTURE,False)
7175+
G2G.Define_wxId('wxID_SUBSRCH')
7176+
self.GeneralCalc.Append(G2G.wxID_SUBSRCH,'SUBGROUPS search','Search for settings of this phase in higher symmetry')
71757177
self.GeneralCalc.Append(G2G.wxID_USEBILBAOMAG,'Select magnetic/subgroup phase','If disabled, make in PWDR/Unit Cells')
71767178
self.GeneralCalc.Append(G2G.wxID_USEBILBAOSUB,'Make subgroup project file(s)','Requires subcell search in PWDR/Unit Cells')
71777179
G2G.Define_wxId('wxID_SUPERSRCH')
@@ -8487,7 +8489,7 @@ def OnEditMag(**args):
84878489
# for lbl in G2frame.G2plotNB.plotList:
84888490
# G2frame.G2plotNB.Delete(lbl)
84898491
# G2frame.lastPlotType = None
8490-
G2pwpl.PlotPatterns(G2frame,plotType=kind,newPlot=NewPlot)
8492+
G2pwpl.PlotPatterns(G2frame,plotType=kind,newPlot=NewPlot,fromTree=True)
84918493
elif kind == 'HKLF':
84928494
Name = G2frame.GPXtree.GetItemText(item)
84938495
phaseName = G2pdG.IsHistogramInAnyPhase(G2frame,Name)
@@ -8929,18 +8931,18 @@ def OnShowShift(event):
89298931
if G2frame.Contour:
89308932
G2frame.Contour = False
89318933
newPlot = True
8932-
G2pwpl.PlotPatterns(G2frame,newPlot)
8934+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
89338935
elif G2frame.GPXtree.GetItemText(item) == 'Background':
89348936
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89358937
data = G2frame.GPXtree.GetItemPyData(item)
89368938
G2pdG.UpdateBackground(G2frame,data)
8937-
G2pwpl.PlotPatterns(G2frame,True)
8939+
G2pwpl.PlotPatterns(G2frame,True,fromTree=True)
89388940
elif G2frame.GPXtree.GetItemText(item) == 'Limits':
89398941
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89408942
datatype = G2frame.GPXtree.GetItemText(G2frame.PatternId)[:4]
89418943
data = G2frame.GPXtree.GetItemPyData(item)
89428944
G2pdG.UpdateLimitsGrid(G2frame,data,datatype)
8943-
G2pwpl.PlotPatterns(G2frame,plotType=datatype,newPlot=True)
8945+
G2pwpl.PlotPatterns(G2frame,plotType=datatype,newPlot=True,fromTree=True)
89448946
elif G2frame.GPXtree.GetItemText(item) == 'Instrument Parameters':
89458947
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89468948
data = G2frame.GPXtree.GetItemPyData(item)[0]
@@ -8954,7 +8956,7 @@ def OnShowShift(event):
89548956
G2pdG.UpdateModelsGrid(G2frame,data)
89558957
elif prfx1 == 'REFD':
89568958
G2pdG.UpdateREFDModelsGrid(G2frame,data)
8957-
G2pwpl.PlotPatterns(G2frame,plotType=prfx1)
8959+
G2pwpl.PlotPatterns(G2frame,plotType=prfx1,fromTree=True)
89588960
if prfx1 == 'SASD':
89598961
if len(data['Size']['Distribution']):
89608962
G2plt.PlotSASDSizeDist(G2frame)
@@ -8977,7 +8979,7 @@ def OnShowShift(event):
89778979
G2frame.GPXtree.SetItemPyData(item,data)
89788980

89798981
G2pdG.UpdateSampleGrid(G2frame,data)
8980-
G2pwpl.PlotPatterns(G2frame,True,plotType=datatype)
8982+
G2pwpl.PlotPatterns(G2frame,True,plotType=datatype,fromTree=True)
89818983
elif G2frame.GPXtree.GetItemText(item) == 'Index Peak List':
89828984
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89838985
data = G2frame.GPXtree.GetItemPyData(item)
@@ -8996,7 +8998,7 @@ def OnShowShift(event):
89968998
if G2frame.Contour:
89978999
G2frame.Contour = False
89989000
newPlot = True
8999-
G2pwpl.PlotPatterns(G2frame,newPlot)
9001+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
90009002
elif G2frame.GPXtree.GetItemText(item) == 'Unit Cells List':
90019003
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
90029004
data = G2frame.GPXtree.GetItemPyData(item)
@@ -9027,7 +9029,7 @@ def OnShowShift(event):
90279029
if G2frame.Contour:
90289030
G2frame.Contour = False
90299031
newPlot = True
9030-
G2pwpl.PlotPatterns(G2frame,newPlot)
9032+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
90319033
elif G2frame.GPXtree.GetItemText(item) == 'Reflection List': #HKLF reflections
90329034
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
90339035
name = G2frame.GPXtree.GetItemText(G2frame.PatternId)

0 commit comments

Comments
 (0)