Changeset 1589 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Dec 1, 2014 12:39:26 PM (9 years ago)
Author:
toby
Message:

2 bugs: import phase w/invalid element; prevent 3 overlapped buttons for H in Periodic table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1581 r1589  
    142142        generalData['Color'] = []
    143143        generalData['Mydir'] = G2frame.dirname
     144        badList = {}
    144145        for atom in atomData:
    145146            atom[ct] = atom[ct].lower().capitalize()              #force to standard form
     
    148149            elif atom[ct] != 'UNK':
    149150                Info = G2elem.GetAtomInfo(atom[ct])
     151                if not Info:
     152                    if atom[ct] not in badList:
     153                        badList[atom[ct]] = 0
     154                    badList[atom[ct]] += 1
     155                    atom[ct] = 'UNK'
     156                    continue
     157                atom[ct] = Info['Symbol'] # N.B. symbol might be changed by GetAtomInfo
    150158                generalData['AtomTypes'].append(atom[ct])
    151159                generalData['Z'] = Info['Z']
     
    161169                generalData['NoAtoms'][atom[ct]] = atom[cs-1]*float(atom[cs+1])
    162170                generalData['Color'].append(Info['Color'])
     171        if badList:
     172            msg = 'Warning: element symbol(s) not found:'
     173            for key in badList:
     174                msg += '\n\t' + key
     175                if badList[key] > 1:
     176                    msg += ' (' + str(badList[key]) + ' times)'
     177            wx.MessageBox(msg,caption='Element symbol error')
    163178        F000X = 0.
    164179        F000N = 0.
Note: See TracChangeset for help on using the changeset viewer.