Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fb63897
adding in isodistort after k vec searched
Kvieta1990 Jan 29, 2025
a35c101
successfully downloaded cif files
Kvieta1990 Jan 29, 2025
6f4a971
fix isofilename grabbing
Kvieta1990 Jan 30, 2025
04e374e
start to add in k vector grabber from the table
Kvieta1990 Jan 31, 2025
d5c7dbd
finalize k vector grabber. need testing
Kvieta1990 Jan 31, 2025
a7fd4ff
add in handlers
Kvieta1990 Feb 1, 2025
eba65ab
fix several issues with diaglog and so on
Kvieta1990 Feb 12, 2025
af7a024
working on project gen
Kvieta1990 Mar 11, 2025
64daf9c
working on proj creation from kvec
Kvieta1990 Apr 17, 2025
9134b59
fix merge conflicts
Kvieta1990 May 16, 2025
7ddaa29
Merge branch 'main' into kvec_isodistort_zyp
Kvieta1990 May 23, 2025
aecfedb
first trial adding in the gsasii proj save for isodistort
Kvieta1990 May 23, 2025
3697bcd
Merge branch 'main' into kvec_isodistort_zyp
Kvieta1990 Jun 6, 2025
f76a882
still working on the proj gen.
Kvieta1990 Jun 6, 2025
f7b8c0e
making progress in saving the project with the correct phase
Kvieta1990 Jun 6, 2025
7bec472
get phase tree item so that phase gets renamed ; misc cleanup
briantoby Jun 17, 2025
70b05ac
bring kvec branch up to date
briantoby Jun 17, 2025
b8a0849
finalize the project save for k vec with isodistort
Kvieta1990 Jun 19, 2025
b0f8703
Merge remote-tracking branch 'origin/main' into kvec_isodistort_zyp
briantoby Jun 23, 2025
ada3a98
working on crystal systems
Kvieta1990 Jul 11, 2025
279ed46
still a lot to work on
Kvieta1990 Jul 11, 2025
c80528d
Merge branch 'main' into kvec_isodistort_zyp
Kvieta1990 Aug 21, 2025
c5b8222
add in k vec solving routine
Kvieta1990 Aug 21, 2025
929ba36
finishing up the implementation for k vector routine to isodistort
Kvieta1990 Aug 21, 2025
bc2e4bc
debugging k vector talk to isodistort
Kvieta1990 Aug 25, 2025
a99ae99
fix the issue with talking to the new isodistort server
Kvieta1990 Aug 26, 2025
7d4b576
Merge branch 'main' into kvec_isodistort_zyp
Kvieta1990 Aug 26, 2025
1768fcf
make sympy import optional
briantoby Sep 7, 2025
acf93bf
Provide error msg when sympy is not installed
briantoby Sep 7, 2025
e36cb33
Postpone k_vec imports; error msg w/o requests
briantoby Sep 7, 2025
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
70 changes: 35 additions & 35 deletions GSASII/GSASIIphsGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ def OnPhaseName(event):
'called when the phase name is changed in "General"'
event.Skip()
newName = NameTxt.GetValue().strip()
renamePhaseName(Item,generalData,newName)
renamePhaseName(G2frame,data,Item,generalData,newName)
Copy link
Collaborator

@briantoby briantoby Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only used in phsGUI. This change is fine!

NameTxt.SetValue(newName)

def OnPhaseType(event):
Expand Down Expand Up @@ -5774,7 +5774,7 @@ def OnReplacePhase(event):
newname = rd.Phase['General']['Name']
data['General']['Name'] = phsnam
# rename phase to new name from file
renamePhaseName(G2frame.PickId, data['General'],newname)
renamePhaseName(G2frame,data,G2frame.PickId, data['General'],newname)
# force a reload of current tree item
G2frame.PickIdText = []
wx.CallAfter(G2gd.SelectDataTreeItem,G2frame,G2frame.PickId)
Expand Down Expand Up @@ -13264,39 +13264,6 @@ def rbKeyPress(event):
G2frame.Raise()
return

def renamePhaseName(phaseItem,generalData,newName):
'''Called to rename the phase. Updates the tree and items that
reference the file name.
'''
oldName = generalData['Name']
phaseRIdList,usedHistograms = G2frame.GetPhaseInfofromTree()
phaseNameList = usedHistograms.keys() # phase names in use
if newName and newName != oldName:
newName = G2obj.MakeUniqueLabel(newName,list(phaseNameList))
generalData['Name'] = newName
G2frame.G2plotNB.Rename(oldName,generalData['Name'])
G2frame.GPXtree.SetItemText(phaseItem,generalData['Name'])
# change phase name key in Reflection Lists for each histogram
for hist in data['Histograms']:
ht = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,hist)
rt = G2gd.GetGPXtreeItemId(G2frame,ht,'Reflection Lists')
if not rt: continue
RfList = G2frame.GPXtree.GetItemPyData(rt)
if oldName not in RfList:
print('Warning: '+oldName+' not in Reflection List for '+
hist)
continue
RfList[newName] = RfList[oldName]
del RfList[oldName]
# rename Restraints
resId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Restraints')
Restraints = G2frame.GPXtree.GetItemPyData(resId)
i = G2gd.GetGPXtreeItemId(G2frame,resId,oldName)
if i: G2frame.GPXtree.SetItemText(i,newName)
if len(Restraints) and oldName in Restraints:
Restraints[newName] = Restraints[oldName]
del Restraints[oldName]

#### UpdatePhaseData execution starts here
# make sure that the phase menu bars get created before selecting
# any (this will only be true on the first call to UpdatePhaseData)
Expand Down Expand Up @@ -13652,3 +13619,36 @@ def saveIsoNewPhase(G2frame,phData,newPhase,orgFilName):
G2frame.GSASprojectfile = f'{s[0]}_{num}.gpx'
G2IO.ProjFileSave(G2frame)
return G2frame.GSASprojectfile

def renamePhaseName(G2frame,data,phaseItem,generalData,newName):
'''Called to rename the phase. Updates the tree and items that
reference the file name.
'''
oldName = generalData['Name']
phaseRIdList,usedHistograms = G2frame.GetPhaseInfofromTree()
phaseNameList = usedHistograms.keys() # phase names in use
if newName and newName != oldName:
newName = G2obj.MakeUniqueLabel(newName,list(phaseNameList))
generalData['Name'] = newName
G2frame.G2plotNB.Rename(oldName,generalData['Name'])
G2frame.GPXtree.SetItemText(phaseItem,generalData['Name'])
# change phase name key in Reflection Lists for each histogram
for hist in data['Histograms']:
ht = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,hist)
rt = G2gd.GetGPXtreeItemId(G2frame,ht,'Reflection Lists')
if not rt: continue
RfList = G2frame.GPXtree.GetItemPyData(rt)
if oldName not in RfList:
print('Warning: '+oldName+' not in Reflection List for '+
hist)
continue
RfList[newName] = RfList[oldName]
del RfList[oldName]
# rename Restraints
resId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Restraints')
Restraints = G2frame.GPXtree.GetItemPyData(resId)
i = G2gd.GetGPXtreeItemId(G2frame,resId,oldName)
if i: G2frame.GPXtree.SetItemText(i,newName)
if len(Restraints) and oldName in Restraints:
Restraints[newName] = Restraints[oldName]
del Restraints[oldName]
Loading
Loading