Skip to content

Commit 7d4b576

Browse files
committed
Merge branch 'main' into kvec_isodistort_zyp
2 parents a99ae99 + eb224e6 commit 7d4b576

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

+991
-670
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
@@ -7166,6 +7166,8 @@ def _makemenu(): # routine to create menu when first used
71667166
self.GeneralCalc.Append(G2G.wxID_COMPARECELLS,'Compare Cells','Compare Unit Cells using NIST*LATTICE')
71677167
self.GeneralCalc.Append(G2G.wxID_COMPARESTRUCTURE,'Compare polyhedra','Compare polyhedra to ideal octahedra/tetrahedra')
71687168
self.GeneralCalc.Enable(G2G.wxID_COMPARESTRUCTURE,False)
7169+
G2G.Define_wxId('wxID_SUBSRCH')
7170+
self.GeneralCalc.Append(G2G.wxID_SUBSRCH,'SUBGROUPS search','Search for settings of this phase in higher symmetry')
71697171
self.GeneralCalc.Append(G2G.wxID_USEBILBAOMAG,'Select magnetic/subgroup phase','If disabled, make in PWDR/Unit Cells')
71707172
self.GeneralCalc.Append(G2G.wxID_USEBILBAOSUB,'Make subgroup project file(s)','Requires subcell search in PWDR/Unit Cells')
71717173
G2G.Define_wxId('wxID_SUPERSRCH')
@@ -8481,7 +8483,7 @@ def OnEditMag(**args):
84818483
# for lbl in G2frame.G2plotNB.plotList:
84828484
# G2frame.G2plotNB.Delete(lbl)
84838485
# G2frame.lastPlotType = None
8484-
G2pwpl.PlotPatterns(G2frame,plotType=kind,newPlot=NewPlot)
8486+
G2pwpl.PlotPatterns(G2frame,plotType=kind,newPlot=NewPlot,fromTree=True)
84858487
elif kind == 'HKLF':
84868488
Name = G2frame.GPXtree.GetItemText(item)
84878489
phaseName = G2pdG.IsHistogramInAnyPhase(G2frame,Name)
@@ -8923,18 +8925,18 @@ def OnShowShift(event):
89238925
if G2frame.Contour:
89248926
G2frame.Contour = False
89258927
newPlot = True
8926-
G2pwpl.PlotPatterns(G2frame,newPlot)
8928+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
89278929
elif G2frame.GPXtree.GetItemText(item) == 'Background':
89288930
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89298931
data = G2frame.GPXtree.GetItemPyData(item)
89308932
G2pdG.UpdateBackground(G2frame,data)
8931-
G2pwpl.PlotPatterns(G2frame,True)
8933+
G2pwpl.PlotPatterns(G2frame,True,fromTree=True)
89328934
elif G2frame.GPXtree.GetItemText(item) == 'Limits':
89338935
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89348936
datatype = G2frame.GPXtree.GetItemText(G2frame.PatternId)[:4]
89358937
data = G2frame.GPXtree.GetItemPyData(item)
89368938
G2pdG.UpdateLimitsGrid(G2frame,data,datatype)
8937-
G2pwpl.PlotPatterns(G2frame,plotType=datatype,newPlot=True)
8939+
G2pwpl.PlotPatterns(G2frame,plotType=datatype,newPlot=True,fromTree=True)
89388940
elif G2frame.GPXtree.GetItemText(item) == 'Instrument Parameters':
89398941
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89408942
data = G2frame.GPXtree.GetItemPyData(item)[0]
@@ -8948,7 +8950,7 @@ def OnShowShift(event):
89488950
G2pdG.UpdateModelsGrid(G2frame,data)
89498951
elif prfx1 == 'REFD':
89508952
G2pdG.UpdateREFDModelsGrid(G2frame,data)
8951-
G2pwpl.PlotPatterns(G2frame,plotType=prfx1)
8953+
G2pwpl.PlotPatterns(G2frame,plotType=prfx1,fromTree=True)
89528954
if prfx1 == 'SASD':
89538955
if len(data['Size']['Distribution']):
89548956
G2plt.PlotSASDSizeDist(G2frame)
@@ -8971,7 +8973,7 @@ def OnShowShift(event):
89718973
G2frame.GPXtree.SetItemPyData(item,data)
89728974

89738975
G2pdG.UpdateSampleGrid(G2frame,data)
8974-
G2pwpl.PlotPatterns(G2frame,True,plotType=datatype)
8976+
G2pwpl.PlotPatterns(G2frame,True,plotType=datatype,fromTree=True)
89758977
elif G2frame.GPXtree.GetItemText(item) == 'Index Peak List':
89768978
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89778979
data = G2frame.GPXtree.GetItemPyData(item)
@@ -8990,7 +8992,7 @@ def OnShowShift(event):
89908992
if G2frame.Contour:
89918993
G2frame.Contour = False
89928994
newPlot = True
8993-
G2pwpl.PlotPatterns(G2frame,newPlot)
8995+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
89948996
elif G2frame.GPXtree.GetItemText(item) == 'Unit Cells List':
89958997
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
89968998
data = G2frame.GPXtree.GetItemPyData(item)
@@ -9021,7 +9023,7 @@ def OnShowShift(event):
90219023
if G2frame.Contour:
90229024
G2frame.Contour = False
90239025
newPlot = True
9024-
G2pwpl.PlotPatterns(G2frame,newPlot)
9026+
G2pwpl.PlotPatterns(G2frame,newPlot,fromTree=True)
90259027
elif G2frame.GPXtree.GetItemText(item) == 'Reflection List': #HKLF reflections
90269028
G2frame.PatternId = G2frame.GPXtree.GetItemParent(item)
90279029
name = G2frame.GPXtree.GetItemText(G2frame.PatternId)

0 commit comments

Comments
 (0)