Skip to content

Commit a10a249

Browse files
committed
fix replot on ref bug; better error msg for bad CIF import
1 parent 603fc3a commit a10a249

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

GSASII/GSASIIpwdplot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,11 @@ def refPlotUpdate(Histograms,cycle=None,restore=False):
14331433
DZ = (xye[1]-xye[3])*np.sqrt(xye[2])
14341434
DifLine[0].set_xdata(X[Ibeg:Ifin])
14351435
DifLine[0].set_ydata(DZ[Ibeg:Ifin])
1436-
lims = [min(DZ[Ibeg:Ifin]),max(DZ[Ibeg:Ifin])]
1437-
if all(np.isfinite(lims)): Plot1.set_ylim(lims)
1436+
try:
1437+
lims = [min(DZ[Ibeg:Ifin]),max(DZ[Ibeg:Ifin])]
1438+
if all(np.isfinite(lims)): Plot1.set_ylim(lims)
1439+
except:
1440+
pass
14381441
CalcLine[0].set_xdata(X)
14391442
ObsLine[0].set_xdata(X)
14401443
BackLine[0].set_xdata(X)

GSASII/imports/G2phase_CIF.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(self):
4242
def ContentsValidator(self, filename):
4343
fp = open(filename,'r')
4444
ok = self.CIFValidator(fp)
45+
print('validator: ',ok)
4546
fp.close()
4647
return ok
4748

@@ -75,7 +76,7 @@ def Reader(self,filename, ParentFrame=None, usedRanIdList=[], **unused):
7576
try:
7677
cf = G2obj.ReadCIF(filename)
7778
except cif.StarError as msg:
78-
msg = 'Unreadable cif file\n'+str(msg)
79+
msg = f'\nThis file does not have valid CIF syntax. Web site https://checkcif.iucr.org/ can help find CIF errors. If VESTA or https://addie.ornl.gov/conf_viewer is able to read this CIF, it may allow you to rewrite it as a valid file. \n\nError from PyCifRW: {msg}'
7980
self.errors = msg
8081
self.warnings += msg
8182
return False
File renamed without changes.
81.3 KB
Loading
115 KB
Loading

docs/source/images/menu.png

114 KB
Loading

0 commit comments

Comments
 (0)