Skip to content

Commit b705ad9

Browse files
committed
feeble attempt to address #183: suppress error & see if typehint will force values to be floats
1 parent 1337d03 commit b705ad9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

GSASII/GSASIIphsGUI.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11870,22 +11870,22 @@ def DistanceSettingSizer(var,key1,key2,key3):
1187011870
def onLeave(*args,**kwargs):
1187111871
G2plt.PlotStructure(G2frame,data)
1187211872
for key in key1,key2,key3:
11873-
if key not in var: var[key] = 0
11873+
if key not in var: var[key] = 0.
1187411874
mapSizer = wx.FlexGridSizer(0,3,5,5)
1187511875
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,'Show Map points within:'),0,WACV)
1187611876
mapSizer.Add(G2G.ValidatedTxtCtrl(drawOptions,var,key1,
1187711877
xmin=0.0,xmax=5.0,nDig=(10,1),size=(50,-1),
11878-
OnLeave=onLeave))
11878+
typeHint=float,OnLeave=onLeave))
1187911879
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,u"\u212B"),0,WACV)
1188011880
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,'Show atoms within:'),0,WACV)
1188111881
mapSizer.Add(G2G.ValidatedTxtCtrl(drawOptions,var,key2,
1188211882
xmin=0.0,xmax=15.0,nDig=(10,1),size=(50,-1),
11883-
OnLeave=onLeave))
11883+
typeHint=float,OnLeave=onLeave))
1188411884
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,u"\u212B"),0,WACV)
1188511885
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,'Label distance to atoms within:'),0,WACV)
1188611886
mapSizer.Add(G2G.ValidatedTxtCtrl(drawOptions,var,key3,
1188711887
xmin=0.0,xmax=15.0,nDig=(10,1),size=(50,-1),
11888-
OnLeave=onLeave))
11888+
typeHint=float,OnLeave=onLeave))
1188911889
mapSizer.Add(wx.StaticText(drawOptions,wx.ID_ANY,u"\u212B"),0,WACV)
1189011890
return mapSizer
1189111891

GSASII/GSASIIplot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7306,10 +7306,13 @@ def Draw(caller='',Fade=[],NPkey=False):
73067306
RenderLabel(x,y,z,' '+atom[ct-2],radius,wxGreen,matRot)
73077307
if not FourD and len(rhoXYZ) and drawingData['showMap']: #no green dot map for 4D - it's wrong!
73087308
RenderMap(rho,rhoXYZ,indx,Rok)
7309-
if (pageName == 'Draw Atoms' or pageName == 'Draw Options') and (
7310-
drawingData['VPPeakDistRad'] + drawingData['VPatomsExpandRad']
7311-
+ drawingData['VPatomsDistRad']
7312-
) > 0:
7309+
try:
7310+
disSum = (drawingData['VPPeakDistRad'] +
7311+
drawingData['VPatomsExpandRad'] +
7312+
drawingData['VPatomsDistRad'])
7313+
except:
7314+
disSum = 0
7315+
if (pageName == 'Draw Atoms' or pageName == 'Draw Options') and disSum > 0:
73137316
PeakDistRadius = drawingData['VPPeakDistRad']
73147317
atomsExpandRadius = drawingData['VPatomsExpandRad']
73157318
atomsdistRadius = drawingData['VPatomsDistRad']

0 commit comments

Comments
 (0)