Skip to content

Commit 6e98f63

Browse files
committed
clean up dead code & add patch for spin RBs
1 parent a74dadc commit 6e98f63

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

GSASII/GSASIIrestrGUI.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,14 +2157,11 @@ def OnCellChange(event):
21572157
if len(spinRestData['SpinRBs']):
21582158
table = []
21592159
rowLabels = []
2160-
# Types = [wg.GRID_VALUE_STRING,wg.GRID_VALUE_FLOAT+':10,2',
2161-
# wg.GRID_VALUE_BOOL,wg.GRID_VALUE_FLOAT+':10,2']
2162-
# colLabels = ['atom','neg esd','use unit?','unit esd']
2163-
# for i,[atomid,esd1,ifesd2,esd2] in enumerate(spinRestData['SpinRBs']):
2164-
# table.append(['%s'%G2mth.GetAtomItemsById(Atoms,AtLookUp,atomid,ct-1)[0],esd1,ifesd2,esd2])
2165-
# rowLabels.append(str(i))
21662160
Types = [wg.GRID_VALUE_STRING,wg.GRID_VALUE_FLOAT+':10,2']
21672161
colLabels = ['atom','neg esd']
2162+
for i,item in enumerate(spinRestData['SpinRBs']):
2163+
if item[0] not in AtLookUp:
2164+
del spinRestData['SpinRBs'][i]
21682165
for i,[atomid,esd1,ifesd2,esd2] in enumerate(spinRestData['SpinRBs']):
21692166
table.append(['%s'%G2mth.GetAtomItemsById(Atoms,AtLookUp,atomid,ct-1)[0],esd1])
21702167
rowLabels.append(str(i))
@@ -2174,11 +2171,7 @@ def OnCellChange(event):
21742171
SpinRBs.AutoSizeColumns(False)
21752172
for r in range(len(spinRestData['SpinRBs'])):
21762173
SpinRBs.SetReadOnly(r,0,True)
2177-
SpinRBs.SetCellStyle(r,0,VERY_LIGHT_GREY,True) # if not spinRBTable.GetValue(r,2):
2178-
# SpinRBs.SetReadOnly(r,3,True)
2179-
# SpinRBs.SetCellStyle(r,3,VERY_LIGHT_GREY,True)
2180-
# SpinRBs.SetCellTextColour(r,3,VERY_LIGHT_GREY)
2181-
2174+
SpinRBs.SetCellStyle(r,0,VERY_LIGHT_GREY,True)
21822175
SpinRBs.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
21832176
SpinRBs.Bind(wg.EVT_GRID_CELL_CHANGED, OnCellChange)
21842177
G2frame.dataWindow.RestraintEdit.Enable(id=G2G.wxID_RESTDELETE,enable=True)

0 commit comments

Comments
 (0)