Skip to content

Commit a02a242

Browse files
committed
deal with phase import (CIF) problems: unparsable sym ops; better reporting of warnings
1 parent 4c15f5c commit a02a242

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

GSASII/GSASIIdataGUI.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,11 @@ def OnImportGeneric(self,reader,readerlist,label,multiple=False,
10611061
errorReport += ': '+rd.errors
10621062
if rd_list: # read succeeded, was there a warning or any errors?
10631063
if rd.warnings:
1064-
self.ErrorDialog('Read Warning','The '+ rd.formatName+
1065-
' reader reported a warning message:\n\n'+rd.warnings)
1064+
# self.ErrorDialog('Read Warning','The '+ rd.formatName+
1065+
# ' reader reported warning message(s):\n\n'+rd.warnings)
1066+
msg = f'The {rd.formatName} reader reported warning message(s):\n\n{rd.warnings}'
1067+
print(msg)
1068+
G2G.ShowScrolledInfo(self,msg,header='Read Warning')
10661069
break # success in reading, try no further
10671070
else:
10681071
if singlereader:

GSASII/GSASIIspc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3911,7 +3911,11 @@ def CompareSym(symList,sgName=None,SGData=None):
39113911
raise Exception('CompareSym called without symmetry input')
39123912

39133913
for sym in symList:
3914-
syMat = ParseXYZ(sym)
3914+
try:
3915+
syMat = ParseXYZ(sym)
3916+
except:
3917+
print(f'Ignoring unparsable sym op {sym}')
3918+
continue
39153919

39163920
for i,mat in enumerate(matList):
39173921
if np.allclose(mat[0],syMat[0]) and np.allclose(offsetNorm(mat[1]),offsetNorm(syMat[1])):

GSASII/imports/G2phase_CIF.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def Reader(self,filename, ParentFrame=None, usedRanIdList=[], **unused):
516516
self.Phase['Atoms'].append(atomlist)
517517
ranIdlookup[atomlist[0]] = atomlist[-1]
518518
if atomlist[0] in atomlbllist:
519-
self.warnings += ' ERROR: repeated atom label: '+atomlist[0]
519+
self.warnings += f' note: repeated atom label: {atomlist[0]}\n'
520520
else:
521521
atomlbllist.append(atomlist[0])
522522

0 commit comments

Comments
 (0)