Changeset 3848 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Mar 9, 2019 2:58:21 PM (4 years ago)
Author:
vondreele
Message:

since id is a python routine which could be useful in debugging, replaced id with Id (or pid in one place)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3827 r3848  
    208208        def OnAtomType(event):
    209209            Obj = event.GetEventObject()
    210             id = Ind[Obj.GetId()]
    211             self.atomTypes[id][1] = Obj.GetValue()
     210            Id = Ind[Obj.GetId()]
     211            self.atomTypes[Id][1] = Obj.GetValue()
    212212       
    213213        self.panel.Destroy()
     
    220220            topSizer.Add(wx.StaticText(self.panel,label=' Sphere centered at atoms: '),0,WACV)
    221221            cx,ct,cs = self.Drawing['atomPtrs'][:3]
    222             for id in self.indx:
    223                 atom = self.Drawing['Atoms'][id]
     222            for Id in self.indx:
     223                atom = self.Drawing['Atoms'][Id]
    224224                self.centers.append(atom[cx:cx+3])
    225225                atoms.append('%s(%s)'%(atom[ct-1],atom[cs-1]))
     
    22402240                try:
    22412241                    vals = Obj.GetValue().split()
    2242                     id = int(name.split('hkl')[1])
     2242                    Id = int(name.split('hkl')[1])
    22432243                    HKL = [int(val) for val in vals]
    2244                     Flip['testHKL'][id] = HKL
     2244                    Flip['testHKL'][Id] = HKL
    22452245                except ValueError:
    2246                     HKL = Flip['testHKL'][id]
     2246                    HKL = Flip['testHKL'][Id]
    22472247                Obj.SetValue('%3d %3d %3d'%(HKL[0],HKL[1],HKL[2]))
    22482248
     
    42054205           
    42064206            def OnRefWidth(event):
    4207                 id = Indx[event.GetEventObject()]
    4208                 Layers['Width'][1][id] = not Layers['Width'][1][id]
     4207                Id = Indx[event.GetEventObject()]
     4208                Layers['Width'][1][Id] = not Layers['Width'][1][Id]
    42094209           
    42104210            Labels = ['a','b']
     
    60566056            atom = atomDData[i]
    60576057            xyz.append([i,]+atom[cn:cn+2]+atom[cx:cx+4]) #also gets Sym Op
    6058             id = G2mth.FindAtomIndexByIDs(atomData,cid,[atom[cid],],False)[0]
    6059             Oxyz.append([id,]+atomData[id][cx+1:cx+4])
     6058            Id = G2mth.FindAtomIndexByIDs(atomData,cid,[atom[cid],],False)[0]
     6059            Oxyz.append([Id,]+atomData[Id][cx+1:cx+4])
    60606060        DATData['Datoms'] = xyz
    60616061        DATData['Oatoms'] = Oxyz
     
    69076907                if dlg.ShowModal() == wx.ID_OK:
    69086908                    sel = dlg.GetSelections()
    6909                     for id,item in enumerate(G2frame.dataWindow.HistsInPhase):
    6910                         if id in sel:
     6909                    for Id,item in enumerate(G2frame.dataWindow.HistsInPhase):
     6910                        if Id in sel:
    69116911                            data['Histograms'][item]['Use'] = True
    69126912                        else:
     
    71917191            if val != 'None':
    71927192                cia = data['General']['AtomPtrs'][3]
    7193                 for i,id in enumerate(RBObj['Ids']):
    7194                     data['Atoms'][AtLookUp[id]][cia] = Ttype
     7193                for i,Id in enumerate(RBObj['Ids']):
     7194                    data['Atoms'][AtLookUp[Id]][cia] = Ttype
    71957195            G2plt.PlotStructure(G2frame,data)
    71967196           
     
    72017201                Uout = G2mth.UpdateRBUIJ(Bmat,Cart,RBObj)
    72027202                cia = data['General']['AtomPtrs'][3]
    7203                 for i,id in enumerate(RBObj['Ids']):
     7203                for i,Id in enumerate(RBObj['Ids']):
    72047204                    if Uout[i][0] == 'I':
    7205                         data['Atoms'][AtLookUp[id]][cia+1] = Uout[i][1]
     7205                        data['Atoms'][AtLookUp[Id]][cia+1] = Uout[i][1]
    72067206                    else:
    7207                         data['Atoms'][AtLookUp[id]][cia+2:cia+8] = Uout[i][2:8]
     7207                        data['Atoms'][AtLookUp[Id]][cia+2:cia+8] = Uout[i][2:8]
    72087208                G2plt.PlotStructure(G2frame,data)
    72097209               
     
    72447244            def OnOrigX(invalid,value,tc):
    72457245                newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,rbType)[0]
    7246                 for i,id in enumerate(RBObj['Ids']):
    7247                     data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     7246                for i,Id in enumerate(RBObj['Ids']):
     7247                    data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    72487248                data['Drawing']['Atoms'] = []
    72497249                UpdateDrawAtoms(atomStyle)
     
    72697269                    RBObj['Orient'][0] = Q
    72707270                    newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,rbType)[0]
    7271                     for i,id in enumerate(RBObj['Ids']):
    7272                         data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     7271                    for i,Id in enumerate(RBObj['Ids']):
     7272                        data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    72737273                    data['Drawing']['Atoms'] = []
    72747274                    UpdateDrawAtoms(atomStyle)
     
    73157315            def OnTorsion(invalid,value,tc):
    73167316                newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')[0]
    7317                 for i,id in enumerate(RBObj['Ids']):
    7318                     data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     7317                for i,Id in enumerate(RBObj['Ids']):
     7318                    data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    73197319                data['Drawing']['Atoms'] = []
    73207320                UpdateDrawAtoms(atomStyle)
     
    75547554                    dist = G2mth.GetXYZDist(xyz,oldXYZ,Amat)
    75557555                    dmax = max(dmax,np.min(dist))
    7556                     id = np.argmin(dist)
    7557                     Id = atomData[id][-1]
     7556                    pid = np.argmin(dist)
     7557                    Id = atomData[pid][-1]
    75587558                    if Id in Ids:   #duplicate - 2 atoms on same site; invalidate & look again
    7559                         dist[id] = 100.
     7559                        dist[pid] = 100.
    75607560                        id =  np.argmin(dist)
    7561                         Id = atomData[id][-1]
     7561                        Id = atomData[pid][-1]
    75627562                    Ids.append(Id)
    7563                     atomData[id][cx:cx+3] = xyz
     7563                    atomData[pid][cx:cx+3] = xyz
    75647564                if dmax > 1.0:
    75657565                    print ('**** WARNING - some atoms not found or misidentified ****')
     
    79137913            for RBObj in RBObjs:
    79147914                newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')[0]
    7915                 for i,id in enumerate(RBObj['Ids']):
    7916                     data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     7915                for i,Id in enumerate(RBObj['Ids']):
     7916                    data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    79177917        finally:
    79187918            wx.EndBusyCursor()
     
    79447944                rbObj['ThermalMotion'][0] = parm
    79457945                if parm != 'None':
    7946                     for i,id in enumerate(rbObj['Ids']):
    7947                         data['Atoms'][AtLookUp[id]][cia] = Ttype
     7946                    for i,Id in enumerate(rbObj['Ids']):
     7947                        data['Atoms'][AtLookUp[Id]][cia] = Ttype
    79487948        dlg.Destroy()
    79497949        wx.CallAfter(FillRigidBodyGrid,True)
     
    94589458        else:
    94599459            G2frame.dataWindow.AtomEdit.Enable(G2G.wxID_UPDATEHATOM,False)
    9460         for id in G2frame.dataWindow.ReImportMenuId:     #loop over submenu items
    9461             G2frame.Bind(wx.EVT_MENU, OnReImport, id=id)
     9460        for Id in G2frame.dataWindow.ReImportMenuId:     #loop over submenu items
     9461            G2frame.Bind(wx.EVT_MENU, OnReImport, id=Id)
    94629462        # Wave Data
    94639463        if data['General']['Modulated']:
Note: See TracChangeset for help on using the changeset viewer.