project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbNameSizer
def rbNameSizer(rbid,rbData):def OnRBName(event):event.Skip()Obj = event.GetEventObject()name = Obj.GetValue()if name == rbData['RBname']: return # no changenamelist = [data['Residue'][key]['RBname'] for key indata['Residue'] if 'RBname' in data['Residue'][key]]name = G2obj.MakeUniqueLabel(name,namelist)rbData['RBname'...
3
32
2
352
0
3,544
3,613
3,544
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbNameSizer) defined within the public class called public.The function start at line 3544 and ends at 3613. It contains 32 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [3544.0] and does not return any valu...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.TypeSelect
def TypeSelect(event):AtInfo = data['Residue']['AtInfo']r,c = event.GetRow(),event.GetCol()if resGrid.GetColLabelValue(c) == 'Type':PE = G2elemGUI.PickElement(G2frame,oneOnly=True)if PE.ShowModal() == wx.ID_OK:if PE.Elem != 'None':El = PE.Elem.strip().lower().capitalize()if El not in AtInfo:Info = G2elem.GetAtomInfo(El...
5
14
1
140
0
3,617
3,630
3,617
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.TypeSelect) defined within the public class called public.The function start at line 3617 and ends at 3630. It contains 14 lines of code and it has a cyclomatic complexity of 5. The function ...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.ChangeCell
def ChangeCell(event):r,c =event.GetRow(),event.GetCol()if c == 0:rbData['atNames'][r] = resGrid.GetCellValue(r,c)if r >= 0 and (2 <= c <= 4):try:val = float(resGrid.GetCellValue(r,c))rbData['rbXYZ'][r][c-2] = valexcept ValueError:passG2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)
5
11
1
101
0
3,632
3,642
3,632
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.ChangeCell) defined within the public class called public.The function start at line 3632 and ends at 3642. It contains 11 lines of code and it has a cyclomatic complexity of 5. The function ...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnRefSel
def OnRefSel(event):Obj = event.GetEventObject()iref,res,jref = Indx[Obj.GetId()]sel = Obj.GetValue()ind = atNames.index(sel)if rbData['rbTypes'][ind] == 'H':G2G.G2MessageBox(G2frame,'You should not select an H-atom for rigid body orientation')rbData['rbRef'][iref] = indFillRefChoice(rbid,rbData)for i,ref in enumerate(...
6
31
1
302
0
3,644
3,674
3,644
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnRefSel) defined within the public class called public.The function start at line 3644 and ends at 3674. It contains 31 lines of code and it has a cyclomatic complexity of 6. The function do...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnMolCent
def OnMolCent(event):rbData['molCent'] = not rbData['molCent']if rbData['molCent']:Obj = event.GetEventObject()res = Indx[Obj.GetId()]rbXYZ = rbData['rbXYZ']rbCent = np.array([np.sum(rbXYZ[:,0]),np.sum(rbXYZ[:,1]),np.sum(rbXYZ[:,2])])/rbXYZ.shape[0]rbXYZ -= rbCentrbData['rbXYZ'] = rbXYZres.ClearSelection()resTable = re...
3
17
1
174
0
3,676
3,692
3,676
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnMolCent) defined within the public class called public.The function start at line 3676 and ends at 3692. It contains 17 lines of code and it has a cyclomatic complexity of 3. The function d...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnHDswitch
def OnHDswitch(event):Obj = event.GetEventObject()res = Indx[Obj.GetId()]resTable = res.GetTable()AtInfo = data['Residue']['AtInfo']for r in range(res.GetNumberRows()):row = resTable.GetRowValues(r)if row[1] == 'H':row[0] = 'D'+row[0][1:]row[1] = 'D'elif row[1] == 'D':row[0] = 'H'+row[0][1:]row[1] = 'H'rbData['atNames'...
4
20
1
197
0
3,694
3,713
3,694
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnHDswitch) defined within the public class called public.The function start at line 3694 and ends at 3713. It contains 20 lines of code and it has a cyclomatic complexity of 4. The function ...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnCycleXYZ
def OnCycleXYZ(event):Obj = event.GetEventObject()res = Indx[Obj.GetId()]rbXYZ = rbData['rbXYZ']resTable = res.GetTable()for r in range(res.GetNumberRows()):rbXYZ[r] = np.roll(rbXYZ[r],1)row = resTable.GetRowValues(r)row[2:4] = rbXYZ[r]resTable.SetRowValues(r,row)res.ForceRefresh()G2plt.PlotRigidBody(G2frame,'Residue',...
2
12
1
109
0
3,715
3,726
3,715
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues.OnCycleXYZ) defined within the public class called public.The function start at line 3715 and ends at 3726. It contains 12 lines of code and it has a cyclomatic complexity of 2. The function ...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues
def rbResidues(rbid,rbData):def TypeSelect(event):AtInfo = data['Residue']['AtInfo']r,c = event.GetRow(),event.GetCol()if resGrid.GetColLabelValue(c) == 'Type':PE = G2elemGUI.PickElement(G2frame,oneOnly=True)if PE.ShowModal() == wx.ID_OK:if PE.Elem != 'None':El = PE.Elem.strip().lower().capitalize()if El not in AtInfo:...
11
92
2
763
0
3,615
3,814
3,615
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.rbResidues) defined within the public class called public.The function start at line 3615 and ends at 3814. It contains 92 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [3615.0] and does not return any valu...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.ChangeAngle
def ChangeAngle(event):event.Skip()Obj = event.GetEventObject()rbid,Seq = Indx[Obj.GetId()][:2]val = Seq[2]try:val = float(Obj.GetValue())Seq[2] = valexcept ValueError:passObj.SetValue('%8.2f'%(val))G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,data['Residue'][rbid],plotDefaults)
2
12
1
91
0
3,818
3,829
3,818
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.ChangeAngle) defined within the public class called public.The function start at line 3818 and ends at 3829. It contains 12 lines of code and it has a cyclomatic complexity of 2. The functi...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.OnRadBtn
def OnRadBtn(event):Obj = event.GetEventObject()Seq,iSeq,angId = Indx[Obj.GetId()]data['Residue'][rbid]['SelSeq'] = [iSeq,angId]angSlide.SetValue(int(100*Seq[2]))
1
5
1
56
0
3,831
3,835
3,831
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.OnRadBtn) defined within the public class called public.The function start at line 3831 and ends at 3835. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function d...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.OnDelBtn
def OnDelBtn(event):Obj = event.GetEventObject()rbid,Seq = Indx[Obj.GetId()]data['Residue'][rbid]['rbSeq'].remove(Seq)wx.CallAfter(UpdateResidueRB)
1
5
1
45
0
3,837
3,841
3,837
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer.OnDelBtn) defined within the public class called public.The function start at line 3837 and ends at 3841. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function d...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer
def Add2SeqSizer(seqSizer,angSlide,rbid,iSeq,Seq,atNames):def ChangeAngle(event):event.Skip()Obj = event.GetEventObject()rbid,Seq = Indx[Obj.GetId()][:2]val = Seq[2]try:val = float(Obj.GetValue())Seq[2] = valexcept ValueError:passObj.SetValue('%8.2f'%(val))G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,data['Residue'][rb...
3
36
6
368
0
3,816
3,874
3,816
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.Add2SeqSizer) defined within the public class called public.The function start at line 3816 and ends at 3874. It contains 36 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [3816.0] and does not return any val...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.SlideSizer.OnSlider
def OnSlider(event):Obj = event.GetEventObject()rbData = Indx[Obj.GetId()]iSeq,angId = rbData['SelSeq']val = float(Obj.GetValue())/100.rbData['rbSeq'][iSeq][2] = valIndx[angId][2].SetValue('%8.2f'%(val))G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)
1
8
1
85
0
3,878
3,885
3,878
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.SlideSizer.OnSlider) defined within the public class called public.The function start at line 3878 and ends at 3885. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function doe...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.SlideSizer
def SlideSizer():def OnSlider(event):Obj = event.GetEventObject()rbData = Indx[Obj.GetId()]iSeq,angId = rbData['SelSeq']val = float(Obj.GetValue())/100.rbData['rbSeq'][iSeq][2] = valIndx[angId][2].SetValue('%8.2f'%(val))G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)slideSizer = wx.BoxSizer(wx.HORIZON...
1
12
0
119
0
3,876
3,896
3,876
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.SlideSizer) defined within the public class called public.The function start at line 3876 and ends at 3896. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.FillRefChoice
def FillRefChoice(rbid,rbData):choiceIds = [i for i in range(len(rbData['atNames']))]for seq in rbData['rbSeq']:for i in seq[3]:try:choiceIds.remove(i)except ValueError:passrbRef = rbData['rbRef']for i in range(3):try:choiceIds.remove(rbRef[i])except ValueError:passrefChoice[rbid] = [choiceIds[:],choiceIds[:],choiceIds...
8
18
2
137
0
3,898
3,915
3,898
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.FillRefChoice) defined within the public class called public.The function start at line 3898 and ends at 3915. It contains 18 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [3898.0] and does not return any va...
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.OnRBSelect
def OnRBSelect(event):global resRBselsel = rbSelect.GetSelection()if sel == 0: return # 1st entry is blankrbname = rbchoice[sel-1]resRBsel = RBnames[rbname]rbData = data['Residue'][resRBsel]G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)wx.CallLater(100,UpdateResidueRB)
2
9
1
65
0
3,917
3,925
3,917
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateRigidBodies.UpdateResidueRB.OnRBSelect) defined within the public class called public.The function start at line 3917 and ends at 3925. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.UpdateResidueRB
def UpdateResidueRB():'''Draw the contents of the Residue Rigid Body tab for Rigid Bodies tree entry'''global resRBseldef rbNameSizer(rbid,rbData):def OnRBName(event):event.Skip()Obj = event.GetEventObject()name = Obj.GetValue()if name == rbData['RBname']: return # no changenamelist = [data['Residue'][key]['RBname'] fo...
11
66
0
534
0
3,540
3,992
3,540
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.UpdateResidueRB) defined within the public class called public.The function start at line 3540 and ends at 3992. It contains 66 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies.SetStatusLine
def SetStatusLine(text):G2frame.GetStatusBar().SetStatusText(text,1)
1
2
1
17
0
3,994
3,995
3,994
null
[]
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies.SetStatusLine) defined within the public class called public.The function start at line 3994 and ends at 3995. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateRigidBodies
def UpdateRigidBodies(G2frame,data):'''Called when Rigid bodies tree item is selected.Displays the rigid bodies in the data window'''def OnPageChanged(event):global resListresList = []if event: #page change event!page = event.GetSelection()else:try:page = G2frame.rbBook.GetSelection()except:if GSASIIpath.GetConfigValue...
5
61
2
466
205
1,992
4,034
1,992
null
['txtfile', 'vecVal', 'DrawCallback', 'delRB', 'delBt', 'sellist', 'mSeq', 'namelist', 'XYZ', 'iAdd', 'rbCent', 'XP', 'RBname', 'page', 'macfile', 'nums', 'newAtms', 'RBnames', 'iref', 'VectorRB', 'El', 'Natoms', 'head', 'defDir', 'plotRB', 'refObj', 'ang', 'rbchoice', 'vecGrid', 'resRBsel', 'ResidueRBSizer', 'Radii', ...
None
null
0
0
0
null
0
null
The function (UpdateRigidBodies) defined within the public class called public.The function start at line 1992 and ends at 4034. It contains 61 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [1992.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowIsoDistortCalc._onClose
def _onClose(event):dlg.EndModal(wx.ID_CANCEL)
1
2
1
13
0
4,042
4,043
4,042
null
[]
None
null
0
0
0
null
0
null
The function (ShowIsoDistortCalc._onClose) defined within the public class called public.The function start at line 4042 and ends at 4043. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowIsoDistortCalc
def ShowIsoDistortCalc(G2frame,phase=None):'''Compute the ISODISTORT mode values from the current coordinates.Called in response to the (Phase/Atoms tab) AtomCompute or Constraints/Edit Constr. "Show ISODISTORT modes" menu item, which should be enabled only when Phase['ISODISTORT'] is defined. '''def _onClose(event):dl...
29
141
2
1,472
28
4,036
4,197
4,036
null
['aSizer', 'covdata', 'modeVals', 'ch', 'albl', 'dlg', 'isophases', 'subSizer1', 'constrDict', 'deltaList', 'panel1', 'Phases', 'btn', 'subSizer2', 'sub', 'phase', 'btnsizer', 'ISO', 'value', 'var', 'sel', 'mainSizer', 'sig', 'panel2', 'pval', 'data', 'Constraints', 'cval']
None
null
0
0
0
null
0
null
The function (ShowIsoDistortCalc) defined within the public class called public.The function start at line 4036 and ends at 4197. It contains 141 lines of code and it has a cyclomatic complexity of 29. It takes 2 parameters, represented as [4036.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowIsoModes._onClose
def _onClose(event):dlg.EndModal(wx.ID_CANCEL)
1
2
1
13
0
4,203
4,204
4,203
null
[]
None
null
0
0
0
null
0
null
The function (ShowIsoModes._onClose) defined within the public class called public.The function start at line 4203 and ends at 4204. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowIsoModes
def ShowIsoModes(G2frame,phase):'''Show details about the ISODISTORT mode and the displacements they translate to.'''def _onClose(event):dlg.EndModal(wx.ID_CANCEL)# make a lookup table for named NewVar Phase constraintssub = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Constraints') Constraints = G2frame.GPXtree.GetItem...
27
121
2
1,360
23
4,199
4,336
4,199
null
['l', 'l1', 'modeExp', 'ch', 'crdExp', 'dlg', 'subSizer1', 'line', 'constrDict', 'panel1', 'Phases', 'btn', 'subSizer2', 'sub', 'btnsizer', 'ISO', 'k', 'var', 'mainSizer', 'G2var', 'panel2', 'data', 'Constraints']
None
null
0
0
0
null
0
null
The function (ShowIsoModes) defined within the public class called public.The function start at line 4199 and ends at 4336. It contains 121 lines of code and it has a cyclomatic complexity of 27. It takes 2 parameters, represented as [4199.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
fmtHelp
def fmtHelp(item,fullname):helptext = "A new variable"if item[-3]:helptext += " named "+str(item[-3])helptext += " is a linear combination of the following parameters:\n"first = Truefor term in item[:-3]:line = ''var = str(term[1])m = term[0]if first:first = Falseline += ' = 'else:if m >= 0:line += ' + 'else:line += ' ...
5
24
2
131
6
4,338
4,361
4,338
null
['line', 'm', 'first', 'helptext', 'var', 'varMean']
None
null
0
0
0
null
0
null
The function (fmtHelp) defined within the public class called public.The function start at line 4338 and ends at 4361. It contains 24 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [4338.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Define_wxId
def Define_wxId(*args):'''routine to create unique global wx Id symbols in this module.'''for arg in args:if GSASIIpath.GetConfigValue('debug') and not arg.startswith('wxID_'):print (f'DBG_Problem in ID name: {arg} needs to start w/wxID_')if arg in globals():if GSASIIpath.GetConfigValue('debug'):print (f'DBG_Warning: {...
6
9
1
59
0
72
82
72
null
[]
None
null
0
0
0
null
0
null
The function (Define_wxId) defined within the public class called public.The function start at line 72 and ends at 82. It contains 9 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent=None,*args,**kwargs):super(self.__class__,self).__init__(parent=parent,*args,**kwargs)fontIncr = GSASIIpath.GetConfigValue('FontSize_incr')self.font = Noneself.G2frame = parent.GetTopLevelParent()self.root = self.AddRoot('Loaded Data: ')if fontIncr is not None and fontIncr != 0:self.font = wx.F...
3
12
4
128
0
89
100
89
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 89 and ends at 100. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [89.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AppendItem
def AppendItem(self, parent, text, image=-1, selImage=-1, data=None):'override the standard method so font size can be set'item = super(self.__class__,self).AppendItem(parent, text, image, selImage, data)if self.font: self.SetItemFont(item, self.font)return item
2
5
6
64
0
102
106
102
null
[]
None
null
0
0
0
null
0
null
The function (AppendItem) defined within the public class called public.The function start at line 102 and ends at 106. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [102.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_getTreeItemsList
def _getTreeItemsList(self,item):'''Get the full tree hierarchy from a reference to a tree item.Note that this effectively hard-codes phase and histogram names in thereturned list. We may want to make these names relative in the future.'''textlist = [self.GetItemText(item)]parent = self.GetItemParent(item)while parent:...
3
8
2
60
0
108
119
108
null
[]
None
null
0
0
0
null
0
null
The function (_getTreeItemsList) defined within the public class called public.The function start at line 108 and ends at 119. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [108.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetItemPyData
def GetItemPyData(self,treeId):return wx.TreeCtrl.GetItemData(self,treeId)
1
2
2
18
0
121
122
121
null
[]
None
null
0
0
0
null
0
null
The function (GetItemPyData) defined within the public class called public.The function start at line 121 and ends at 122. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [121.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetItemPyData
def SetItemPyData(self,treeId,data):return wx.TreeCtrl.SetItemData(self,treeId,data)
1
2
3
22
0
124
125
124
null
[]
None
null
0
0
0
null
0
null
The function (SetItemPyData) defined within the public class called public.The function start at line 124 and ends at 125. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [124.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateSelection
def UpdateSelection(self):TId = self.GetFocusedItem()self.SelectItem(self.root)self.SelectItem(TId)
1
4
1
26
0
127
130
127
null
[]
None
null
0
0
0
null
0
null
The function (UpdateSelection) defined within the public class called public.The function start at line 127 and ends at 130. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetRelativeHistNum
def GetRelativeHistNum(self,histname):'''Returns list with a histogram type and a relative number for thathistogram, or the original string if not a histogram'''histtype = histname.split()[0]if histtype != histtype.upper(): # histograms (only) have a keyword all in capsreturn histnameitem, cookie = self.GetFirstChild(s...
5
15
2
102
0
132
149
132
null
[]
None
null
0
0
0
null
0
null
The function (GetRelativeHistNum) defined within the public class called public.The function start at line 132 and ends at 149. It contains 15 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [132.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ConvertRelativeHistNum
def ConvertRelativeHistNum(self,histtype,histnum):'''Converts a histogram type and relative histogram number to ahistogram name in the current project'''item, cookie = self.GetFirstChild(self.root)i = 0while item:itemtext = self.GetItemText(item)if itemtext.split()[0] == histtype:if i == histnum: return itemtexti += 1i...
4
11
3
83
0
151
164
151
null
[]
None
null
0
0
0
null
0
null
The function (ConvertRelativeHistNum) defined within the public class called public.The function start at line 151 and ends at 164. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [151.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetRelativePhaseNum
def GetRelativePhaseNum(self,phasename):'''Returns a phase number if the string matches a phase nameor else returns the original string'''item, cookie = self.GetFirstChild(self.root)while item:itemtext = self.GetItemText(item)if itemtext == "Phases":parent = itemitem, cookie = self.GetFirstChild(parent)i = 0while item:...
5
19
2
110
0
166
187
166
null
[]
None
null
0
0
0
null
0
null
The function (GetRelativePhaseNum) defined within the public class called public.The function start at line 166 and ends at 187. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [166.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ConvertRelativePhaseNum
def ConvertRelativePhaseNum(self,phasenum):'''Converts relative phase number to a phase name inthe current project'''item, cookie = self.GetFirstChild(self.root)while item:itemtext = self.GetItemText(item)if itemtext == "Phases":parent = itemitem, cookie = self.GetFirstChild(parent)i = 0while item:if i == phasenum:retu...
5
18
2
117
0
189
209
189
null
[]
None
null
0
0
0
null
0
null
The function (ConvertRelativePhaseNum) defined within the public class called public.The function start at line 189 and ends at 209. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [189.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetImageLoc
def GetImageLoc(self,TreeId):'''Get Image data from the Tree. Handles cases where theimage name is specified, as well as where the image file name isa tuple containing the image file and an image number'''size,imagefile = self.GetItemPyData(TreeId)if type(imagefile) is tuple or type(imagefile) is list:return size,image...
3
6
2
53
0
211
221
211
null
[]
None
null
0
0
0
null
0
null
The function (GetImageLoc) defined within the public class called public.The function start at line 211 and ends at 221. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [211.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateImageLoc
def UpdateImageLoc(self,TreeId,imagefile):'''Saves a new imagefile name in the Tree. Handles cases where theimage name is specified, as well as where the image file name isa tuple containing the image file and an image number'''idata = self.GetItemPyData(TreeId)if type(idata[1]) is tuple or type(idata[1]) is list:idata...
3
7
3
78
0
223
234
223
null
[]
None
null
0
0
0
null
0
null
The function (UpdateImageLoc) defined within the public class called public.The function start at line 223 and ends at 234. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [223.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SaveExposedItems
def SaveExposedItems(self):'''Traverse the top level tree items and save names of exposed (expanded) tree items.Done before a refinement.'''self.ExposedItems = []item, cookie = self.GetFirstChild(self.root)while item:name = self.GetItemText(item)if self.IsExpanded(item): self.ExposedItems.append(name)item, cookie = sel...
3
7
1
65
0
236
245
236
null
[]
None
null
0
0
0
null
0
null
The function (SaveExposedItems) defined within the public class called public.The function start at line 236 and ends at 245. It contains 7 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
RestoreExposedItems
def RestoreExposedItems(self):'''Traverse the top level tree items and restore exposed (expanded) tree itemsback to their previous state (done after a reload of the tree after a refinement)'''item, cookie = self.GetFirstChild(self.root)while item:name = self.GetItemText(item)if name in self.ExposedItems: self.Expand(it...
3
6
1
56
0
248
256
248
null
[]
None
null
0
0
0
null
0
null
The function (RestoreExposedItems) defined within the public class called public.The function start at line 248 and ends at 256. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadOnlyTextCtrl
def ReadOnlyTextCtrl(*args,**kwargs):'''Create a read-only TextCtrl for display of constantsThis is probably not ideal as it mixes visual cues, but it does look nice.Addresses 4.2 bug where TextCtrl has no default size'''kwargs['style'] = wx.TE_READONLYif wx.__version__.startswith('4.2') and 'size' not in kwargs:kwargs...
3
7
2
72
1
258
268
258
null
['Txt']
None
null
0
0
0
null
0
null
The function (ReadOnlyTextCtrl) defined within the public class called public.The function start at line 258 and ends at 268. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [258.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,loc,key,nDig=None,notBlank=True,xmin=None,xmax=None,OKcontrol=None,OnLeave=None,typeHint=None,CIFinput=False,exclLim=[False,False],OnLeaveArgs={}, ASCIIonly=False, **kw):# save passed values needed outside __init__self.result = locself.key = keyself.nDig = nDigself.OKcontrol=OKcontrolself.OnLea...
17
78
16
601
0
372
456
372
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 372 and ends at 456. It contains 78 lines of code and it has a cyclomatic complexity of 17. It takes 16 parameters, represented as [372.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetValue
def SetValue(self,val,warn=True):'''Place a value into the text widget and save it into theassociated array element. Note that, unlike the stock wx.TextCtrl,val is expected to be in the form expected by the widget(float/int/str) rather than only str's.For float val values, the value is formatted when placed in theTextC...
4
8
3
73
0
458
478
458
null
[]
None
null
0
0
0
null
0
null
The function (SetValue) defined within the public class called public.The function start at line 458 and ends at 478. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [458.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ChangeValue
def ChangeValue(self,val):'''Place a value into the text widget and save it into theassociated array element. Note that, unlike the stock wx.TextCtrl,val is expected to be in the form expected by the widget(float/int/str) rather than only str's.For float val values, the value is formatted when placed in theTextCtrl, bu...
2
4
2
32
0
480
493
480
null
[]
None
null
0
0
0
null
0
null
The function (ChangeValue) defined within the public class called public.The function start at line 480 and ends at 493. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [480.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_setValue
def _setValue(self,val,show=True):'''Check the validity of an int or float value and convert to a str.Possibly format it. If show is True, display the formatted value inthe Text widget.'''self.invalid = Falseif self.type is int:try:if int(val) != val:self.invalid = Trueelse:val = int(val)except:if self.CIFinput and (va...
27
50
3
323
0
495
549
495
null
[]
None
null
0
0
0
null
0
null
The function (_setValue) defined within the public class called public.The function start at line 495 and ends at 549. It contains 50 lines of code and it has a cyclomatic complexity of 27. It takes 3 parameters, represented as [495.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnKeyDown
def OnKeyDown(self,event):'Special callback for wx 2.9+ on Mac where backspace is not processed by validator'key = event.GetKeyCode()if key in [wx.WXK_BACK, wx.WXK_DELETE]:if self.Validator: wx.CallAfter(self.Validator.TestValid,self)if key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER:self._onLoseFocus(None)if event:...
7
10
2
87
0
551
560
551
null
[]
None
null
0
0
0
null
0
null
The function (OnKeyDown) defined within the public class called public.The function start at line 551 and ends at 560. It contains 10 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [551.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onStringKey
def _onStringKey(self,event):if event: event.Skip()if self.invalid: # check for validity after processing the keystrokewx.CallAfter(self.ShowStringValidity,True) # was invalidelse:wx.CallAfter(self.ShowStringValidity,False) # was valid
3
6
2
42
0
562
567
562
null
[]
None
null
0
0
0
null
0
null
The function (_onStringKey) defined within the public class called public.The function start at line 562 and ends at 567. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [562.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_IndicateValidity
def _IndicateValidity(self):'Set the control colors to show invalid input'if self.invalid:ins = self.GetInsertionPoint()self.SetForegroundColour("red")self.SetBackgroundColour("yellow")if not sys.platform.startswith("linux"):self.SetFocus()self.Refresh() # this selects text on some Linuxesself.SetSelection(0,0) # unsel...
4
17
1
118
0
569
585
569
null
[]
None
null
0
0
0
null
0
null
The function (_IndicateValidity) defined within the public class called public.The function start at line 569 and ends at 585. It contains 17 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_GetNumValue
def _GetNumValue(self):'Get and where needed convert string from GetValue into int or float'try:val = self.GetValue()if self.type is int:val = int(val)elif self.type is float:val = float(val)except:if self.CIFinput and (val == '?' or val == '.'):passelse:self.invalid = Truereturn val
7
14
1
68
0
587
600
587
null
[]
None
null
0
0
0
null
0
null
The function (_GetNumValue) defined within the public class called public.The function start at line 587 and ends at 600. It contains 14 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowStringValidity
def ShowStringValidity(self,previousInvalid=True):'''Check if input is valid. Anytime the input isinvalid, call self.OKcontrol (if defined) because it is fast.If valid, check for any other invalid entries only whenchanging from invalid to valid, since that is slower.:param bool previousInvalid: True if the TextCtrl con...
6
13
2
78
0
602
623
602
null
[]
None
null
0
0
0
null
0
null
The function (ShowStringValidity) defined within the public class called public.The function start at line 602 and ends at 623. It contains 13 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [602.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_GetStringValue
def _GetStringValue(self,event):'''Get string input and store.'''if event: event.Skip() # process keystrokewx.CallAfter(self._SaveStringValue)
2
3
2
24
0
625
629
625
null
[]
None
null
0
0
0
null
0
null
The function (_GetStringValue) defined within the public class called public.The function start at line 625 and ends at 629. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [625.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_SaveStringValue
def _SaveStringValue(self):try:val = self.GetValue().strip()except RuntimeError:# ignore if control has been deletedreturn# always store the resultif self.CIFinput and '2' in platform.python_version_tuple()[0]: # Py2/CIF make results ASCIIself.result[self.key] = val.encode('ascii','replace')else:self.result[self.key] =...
4
9
1
67
0
631
640
631
null
[]
None
null
0
0
0
null
0
null
The function (_SaveStringValue) defined within the public class called public.The function start at line 631 and ends at 640. It contains 9 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onLeaveWindow.delayedUpdate
def delayedUpdate():self.timer = Nonetry:self._setValue(self.result[self.key])except:pass
2
6
0
27
0
647
652
647
null
[]
None
null
0
0
0
null
0
null
The function (_onLeaveWindow.delayedUpdate) defined within the public class called public.The function start at line 647 and ends at 652. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onLeaveWindow
def _onLeaveWindow(self,event):'''If the mouse leaves the text box, save the result, if valid,but (unlike _onLoseFocus) there is a two second delay beforethe textbox contents are updated with the value from the formula.'''def delayedUpdate():self.timer = Nonetry:self._setValue(self.result[self.key])except:passif self.t...
11
20
2
164
0
642
670
642
null
[]
None
null
0
0
0
null
0
null
The function (_onLeaveWindow) defined within the public class called public.The function start at line 642 and ends at 670. It contains 20 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [642.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onLoseFocus
def _onLoseFocus(self,event):'''Enter has been pressed or focus transferred to another control,Evaluate and update the current control contents'''if event: event.Skip()if self.type is not str:if not self.IsModified(): return#ignore mouse crusingelif self.result[self.key] == self.GetValue(): # .IsModified() seems unreli...
11
21
2
160
0
672
696
672
null
[]
None
null
0
0
0
null
0
null
The function (_onLoseFocus) defined within the public class called public.The function start at line 672 and ends at 696. It contains 21 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [672.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, typ, positiveonly=False, xmin=None, xmax=None,exclLim=[False,False],result=None, key=None, OKcontrol=None, CIFinput=False):'Create the validator'wxValidator.__init__(self)# save passed parametersself.typ = typself.positiveonly = positiveonlyself.xmin = xminself.xmax = xmaxself.exclLim = exclLimself.r...
6
25
10
165
0
734
762
734
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 734 and ends at 762. It contains 25 lines of code and it has a cyclomatic complexity of 6. It takes 10 parameters, represented as [734.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Clone
def Clone(self):'Create a copy of the validator, a strange, but required component'return NumberValidator(typ=self.typ, positiveonly=self.positiveonly, xmin=self.xmin, xmax=self.xmax, result=self.result, key=self.key, OKcontrol=self.OKcontrol, CIFinput=self.CIFinput)
1
8
1
57
0
763
770
763
null
[]
None
null
0
0
0
null
0
null
The function (Clone) defined within the public class called public.The function start at line 763 and ends at 770. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TransferToWindow
def TransferToWindow(self):'Needed by validator, strange, but required component'return True # Prevent wxDialog from complaining.
1
3
1
8
0
771
773
771
null
[]
None
null
0
0
0
null
0
null
The function (TransferToWindow) defined within the public class called public.The function start at line 771 and ends at 773. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TransferFromWindow
def TransferFromWindow(self):'Needed by validator, strange, but required component'return True # Prevent wxDialog from complaining.
1
3
1
8
0
774
776
774
null
[]
None
null
0
0
0
null
0
null
The function (TransferFromWindow) defined within the public class called public.The function start at line 774 and ends at 776. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TestValid
def TestValid(self,tc):'''Check if the value is valid by casting the input stringinto the current type.Set the invalid variable in the TextCtrl object accordingly.If the value is valid, save it in the dict/list wherethe initial value was stored, if appropriate.:param wx.TextCtrl tc: A reference to the TextCtrl that the...
18
32
2
228
0
777
819
777
null
[]
None
null
0
0
0
null
0
null
The function (TestValid) defined within the public class called public.The function start at line 777 and ends at 819. It contains 32 lines of code and it has a cyclomatic complexity of 18. It takes 2 parameters, represented as [777.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowValidity
def ShowValidity(self,tc):'''Set the control colors to show invalid input:param wx.TextCtrl tc: A reference to the TextCtrl that the validatoris associated with.'''if tc.invalid:ins = tc.GetInsertionPoint()tc.SetForegroundColour("red")tc.SetBackgroundColour("yellow")tc.SetFocus()tc.Refresh() # this selects text on some...
2
15
2
97
0
821
841
821
null
[]
None
null
0
0
0
null
0
null
The function (ShowValidity) defined within the public class called public.The function start at line 821 and ends at 841. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [821.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CheckInput
def CheckInput(self,previousInvalid):'''called to test every change to the TextCtrl for validity andto change the appearance of the TextCtrlAnytime the input is invalid, call self.OKcontrol(if defined) because it is fast.If valid, check for any other invalid entries only whenchanging from invalid to valid, since that i...
6
8
2
60
0
843
862
843
null
[]
None
null
0
0
0
null
0
null
The function (CheckInput) defined within the public class called public.The function start at line 843 and ends at 862. It contains 8 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [843.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnChar
def OnChar(self, event):'''Called each type a key is pressedignores keys that are not allowed for int and float types'''key = event.GetKeyCode()tc = self.GetWindow()if key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER:if tc.invalid:self.CheckInput(True)else:self.CheckInput(False)if event: event.Skip()returnif key < wx...
13
25
2
163
0
864
891
864
null
[]
None
null
0
0
0
null
0
null
The function (OnChar) defined within the public class called public.The function start at line 864 and ends at 891. It contains 25 lines of code and it has a cyclomatic complexity of 13. It takes 2 parameters, represented as [864.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, result=None, key=None):'Create the validator'import stringwxValidator.__init__(self)# save passed parametersself.result = resultself.key = keyself.validchars = string.ascii_letters + string.digits + string.punctuation + string.whitespaceself.Bind(wx.EVT_CHAR, self.OnChar)
1
8
3
63
0
907
915
907
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 907 and ends at 915. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [907.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Clone
def Clone(self):'Create a copy of the validator, a strange, but required component'return ASCIIValidator(result=self.result, key=self.key)tc = self.GetWindow()tc.invalid = False # make sure the validity flag is defined in parent
1
5
1
33
0
916
920
916
null
[]
None
null
0
0
0
null
0
null
The function (Clone) defined within the public class called public.The function start at line 916 and ends at 920. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TransferToWindow
def TransferToWindow(self):'Needed by validator, strange, but required component'return True # Prevent wxDialog from complaining.
1
3
1
8
0
921
923
771
null
[]
None
null
0
0
0
null
0
null
The function (TransferToWindow) defined within the public class called public.The function start at line 921 and ends at 923. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TransferFromWindow
def TransferFromWindow(self):'Needed by validator, strange, but required component'return True # Prevent wxDialog from complaining.
1
3
1
8
0
924
926
774
null
[]
None
null
0
0
0
null
0
null
The function (TransferFromWindow) defined within the public class called public.The function start at line 924 and ends at 926. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TestValid
def TestValid(self,tc):'''Check if the value is valid by casting the input stringinto ASCII.Save it in the dict/list where the initial value was stored:param wx.TextCtrl tc: A reference to the TextCtrl that the validatoris associated with.'''if '2' in platform.python_version_tuple()[0]:self.result[self.key] = tc.GetVal...
2
5
2
57
0
927
939
927
null
[]
None
null
0
0
0
null
0
null
The function (TestValid) defined within the public class called public.The function start at line 927 and ends at 939. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [927.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnChar
def OnChar(self, event):'''Called each type a key is pressedignores keys that are not allowed for int and float types'''key = event.GetKeyCode()tc = self.GetWindow()if key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER:self.TestValid(tc)if event: event.Skip()returnif key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > ...
10
16
2
108
0
941
959
941
null
[]
None
null
0
0
0
null
0
null
The function (OnChar) defined within the public class called public.The function start at line 941 and ends at 959. It contains 16 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [941.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent, id=wx.ID_ANY, value=0, minValue=0, maxValue=100, *arg, **kwarg):wx.Slider.__init__(self, parent, id, ci(value), ci(minValue), ci(maxValue), *arg, **kwarg)self.iscale = 1
1
3
8
69
0
967
969
967
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 967 and ends at 969. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [967.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetScaling
def SetScaling(self,iscale):self.iscale = iscale
1
2
2
12
0
971
972
971
null
[]
None
null
0
0
0
null
0
null
The function (SetScaling) defined within the public class called public.The function start at line 971 and ends at 972. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [971.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetScaledRange
def SetScaledRange(self,xmin,xmax):self.SetRange(ci(xmin*self.iscale),ci(xmax*self.iscale))
1
2
3
31
0
974
975
974
null
[]
None
null
0
0
0
null
0
null
The function (SetScaledRange) defined within the public class called public.The function start at line 974 and ends at 975. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [974.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetScaledValue
def SetScaledValue(self,value):wx.Slider.SetValue(self, ci(self.iscale*value))
1
2
2
24
0
977
978
977
null
[]
None
null
0
0
0
null
0
null
The function (SetScaledValue) defined within the public class called public.The function start at line 977 and ends at 978. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [977.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetScaledValue
def GetScaledValue(self):return self.GetValue()/float(self.iscale)
1
2
1
18
0
980
981
980
null
[]
None
null
0
0
0
null
0
null
The function (GetScaledValue) defined within the public class called public.The function start at line 980 and ends at 981. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetValue
def SetValue(self,value):wx.Slider.SetValue(self, ci(value))
1
2
2
20
0
983
984
983
null
[]
None
null
0
0
0
null
0
null
The function (SetValue) defined within the public class called public.The function start at line 983 and ends at 984. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [983.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetMax
def SetMax(self,xmax):wx.Slider.SetMax(self,ci(xmax*self.iscale))
1
2
2
24
0
986
987
986
null
[]
None
null
0
0
0
null
0
null
The function (SetMax) defined within the public class called public.The function start at line 986 and ends at 987. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [986.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetMin
def SetMin(self,xmin):wx.Slider.SetMin(self,ci(xmin*self.iscale))
1
2
2
24
0
989
990
989
null
[]
None
null
0
0
0
null
0
null
The function (SetMin) defined within the public class called public.The function start at line 989 and ends at 990. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [989.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SliderWidget.onScale
def onScale(event):loc[key] = vScale.GetScaledValue()wx.TextCtrl.SetValue(vEntry,str(loc[key])) # will not trigger onValSetif onChange: onChange(*onChangeArgs)
2
4
1
39
0
1,028
1,031
1,028
null
[]
None
null
0
0
0
null
0
null
The function (G2SliderWidget.onScale) defined within the public class called public.The function start at line 1028 and ends at 1031. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SliderWidget.onValSet
def onValSet(*args,**kwargs):vScale.SetScaledValue(loc[key])if onChange: onChange(*onChangeArgs)
2
3
2
26
0
1,032
1,034
1,032
null
[]
None
null
0
0
0
null
0
null
The function (G2SliderWidget.onValSet) defined within the public class called public.The function start at line 1032 and ends at 1034. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1032.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SliderWidget
def G2SliderWidget(parent,loc,key,label,xmin,xmax,iscale,onChange=None,onChangeArgs=[],sizer=None,nDig=None,size=(50,20)):'''A customized combination of a wx.Slider and a validatedwx.TextCtrl (see :class:`ValidatedTxtCtrl`) that allows eithera slider or text entry to set a value within a range.:param wx.Panel parent: n...
4
27
13
307
4
992
1,057
992
null
['vScale', 'nDig', 'hSizer', 'vEntry']
None
null
0
0
0
null
0
null
The function (G2SliderWidget) defined within the public class called public.The function start at line 992 and ends at 1057. It contains 27 lines of code and it has a cyclomatic complexity of 4. It takes 13 parameters, represented as [992.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SpinWidget._onSpin
def _onSpin(event):Obj = event.GetEventObject()loc[key] += Obj.GetValue()# +1 or -1if xmin is not None and loc[key] < xmin:loc[key] = xminif xmax is not None and loc[key] > xmax:loc[key] = xmaxwx.TextCtrl.SetValue(vEntry,str(loc[key])) # will not trigger onValSetObj.SetValue(0)if onChange: onChange(*onChangeArgs)
6
10
1
90
0
1,093
1,102
1,093
null
[]
None
null
0
0
0
null
0
null
The function (G2SpinWidget._onSpin) defined within the public class called public.The function start at line 1093 and ends at 1102. It contains 10 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SpinWidget._onValSet
def _onValSet(*args,**kwargs):if onChange: onChange(*onChangeArgs)
2
2
2
17
0
1,103
1,104
1,103
null
[]
None
null
0
0
0
null
0
null
The function (G2SpinWidget._onValSet) defined within the public class called public.The function start at line 1103 and ends at 1104. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1103.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2SpinWidget
def G2SpinWidget(parent,loc,key,label,xmin=None,xmax=None,onChange=None,onChangeArgs=[],hsize=35):'''A customized combination of a wx.SpinButton and a validatedwx.TextCtrl (see :class:`ValidatedTxtCtrl`) that allows eithera the spin button or text entry to set a value within a range.:param wx.Panel parent: name of pane...
4
21
9
248
4
1,059
1,121
1,059
null
['spin', 'Obj', 'vEntry', 'hSizer']
None
null
0
0
0
null
0
null
The function (G2SpinWidget) defined within the public class called public.The function start at line 1059 and ends at 1121. It contains 21 lines of code and it has a cyclomatic complexity of 4. It takes 9 parameters, represented as [1059.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
HorizontalLine
def HorizontalLine(sizer,parent):'''Draws a horizontal line as wide as the window.'''if sys.platform == "darwin":#sizer.Add((-1,2))line = wx.Panel(parent, size=(-1, 2))#line.SetBackgroundColour('red')line.SetBackgroundColour((128,128,128))sizer.Add(line, 0, wx.EXPAND|wx.ALL, 0)sizer.Add((-1,5))else:line = wx.StaticLine...
2
9
2
116
1
1,124
1,136
1,124
null
['line']
None
null
0
0
0
null
0
null
The function (HorizontalLine) defined within the public class called public.The function start at line 1124 and ends at 1136. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1124.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,id=wx.ID_ANY,label='',locationcode='', handler=None,*args,**kwargs):super(self.__class__,self).__init__(parent,id,label,*args,**kwargs)self.label = labelself.handler = handlerself.locationcode = locationcodeself.Bind(wx.EVT_BUTTON,self.onPress)
1
7
8
81
0
1,147
1,153
1,147
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1147 and ends at 1153. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [1147.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onPress
def onPress(self,event):'create log event and call handler'self.handler(event)
1
3
2
14
0
1,154
1,156
1,154
null
[]
None
null
0
0
0
null
0
null
The function (onPress) defined within the public class called public.The function start at line 1154 and ends at 1156. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1154.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,dct,item,choices,values=None,OnChange=None,**kw):if values is None:values = choicesif dct[item] in values:i = values.index(dct[item])else:i = 0startval = choices[i]wx.ComboBox.__init__(self,parent,wx.ID_ANY,startval, choices = choices, style=wx.CB_DROPDOWN|wx.CB_READONLY, **kw)self.choices = ch...
3
18
8
132
0
1,196
1,213
1,196
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1196 and ends at 1213. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 8 parameters, represented as [1196.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onSelection
def onSelection(self,event):# respond to a selection by setting the enum value in the CIF dictionaryif self.GetValue() in self.choices: # should always be true!self.dct[self.item] = self.values[self.choices.index(self.GetValue())]else:self.dct[self.item] = self.values[0] # unknownif self.OnChange: self.OnChange(event)
3
6
2
72
0
1,214
1,220
1,214
null
[]
None
null
0
0
0
null
0
null
The function (onSelection) defined within the public class called public.The function start at line 1214 and ends at 1220. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1214.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,lbl,choices=None,selected=None, choiceDict=None, OnChange=None,**kw):self.parent = parentself.choices = choicesself.selected = selectedself.choiceDict = Noneif choiceDict is not None:self.choices = list(choiceDict.keys())self.selected = list(choiceDict.values())self.choiceDict = choiceDictself....
2
14
8
119
0
1,246
1,259
1,246
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1246 and ends at 1259. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 8 parameters, represented as [1246.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
popupSelector
def popupSelector(self,event):'''Show the menu and then get current values. Optionally call theOnChange routine.'''menu = wx.Menu()menuList = []#breakpoint()for i in range(len(self.choices)):menuList.append(menu.Append(wx.ID_ANY, self.choices[i], '', wx.ITEM_CHECK))if self.selected[i]: menuList[-1].Check()self.parent.P...
10
23
2
247
0
1,261
1,290
1,261
null
[]
None
null
0
0
0
null
0
null
The function (popupSelector) defined within the public class called public.The function start at line 1261 and ends at 1290. It contains 23 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [1261.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,choiceList,indLoc=None,indKey=None,strLoc=None,strKey=None, onChoice=None,**kwargs):wx.Choice.__init__(self,parent,choices=choiceList,id=wx.ID_ANY,**kwargs)self.choiceList = choiceListself.indLoc = indLocself.indKey = indKeyself.strLoc = strLocself.strKey = strKeyself.onChoice = Noneself.SetSel...
10
26
9
246
0
1,343
1,370
1,343
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1343 and ends at 1370. It contains 26 lines of code and it has a cyclomatic complexity of 10. It takes 9 parameters, represented as [1343.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_OnChoice
def _OnChoice(self,event):if self.indLoc is not None:self.indLoc[self.indKey] = self.GetSelection()if self.strLoc is not None:self.strLoc[self.strKey] = self.GetStringSelection()if self.onChoice:self.onChoice()
4
7
2
61
0
1,371
1,377
1,371
null
[]
None
null
0
0
0
null
0
null
The function (_OnChoice) defined within the public class called public.The function start at line 1371 and ends at 1377. It contains 7 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [1371.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
setByString
def setByString(self,string):'Find an entry matching string and select it'num = self.FindString(string)if num >= 0: self.SetSelection(num)
2
4
2
27
0
1,378
1,381
1,378
null
[]
None
null
0
0
0
null
0
null
The function (setByString) defined within the public class called public.The function start at line 1378 and ends at 1381. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1378.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,label,loc,key,OnChange=None):wx.CheckBox.__init__(self,parent,id=wx.ID_ANY,label=label)self.loc = locself.key = keyself.OnChange = OnChangeself.SetValue(self.loc[self.key]==True)self.Bind(wx.EVT_CHECKBOX, self._OnCheckBox)
1
7
6
79
0
1,403
1,409
1,403
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1403 and ends at 1409. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [1403.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_OnCheckBox
def _OnCheckBox(self,event):self.loc[self.key] = self.GetValue()if self.OnChange: self.OnChange(event)
2
3
2
32
0
1,410
1,412
1,410
null
[]
None
null
0
0
0
null
0
null
The function (_OnCheckBox) defined within the public class called public.The function start at line 1410 and ends at 1412. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1410.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2CheckBoxFrontLbl
def G2CheckBoxFrontLbl(parent,label,loc,key,OnChange=None):'''A customized version of a CheckBox that automatically initializesthe control to a supplied list or dict entry and updates thatentry as the widget is used. Same as :class:`G2CheckBox` except thelabel is placed before the CheckBox and returns a sizer rather th...
1
7
5
76
2
1,414
1,428
1,414
null
['Sizer', 'checkBox']
None
null
0
0
0
null
0
null
The function (G2CheckBoxFrontLbl) defined within the public class called public.The function start at line 1414 and ends at 1428. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1414.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2RadioButtons._OnEvent
def _OnEvent(event):if event.GetEventObject() not in buttons:if GSASIIpath.GetConfigValue('debug'): print('Strange: unknown button')returnloc[key] = values[buttons.index(event.GetEventObject())]if OnChange: OnChange(event)
4
6
1
53
0
1,447
1,452
1,447
null
[]
None
null
0
0
0
null
0
null
The function (G2RadioButtons._OnEvent) defined within the public class called public.The function start at line 1447 and ends at 1452. It contains 6 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2RadioButtons
def G2RadioButtons(parent,loc,key,choices,values=None,OnChange=None):'''A customized version of wx.RadioButton that returns a listof coupled RadioButtons:param wx.Panel parent: name of panel or frame that will bethe parent to the widgets. Can be None.:param dict/list loc: the dict or list with the initial value to bepl...
5
13
6
127
3
1,430
1,463
1,430
null
['kw', 'values', 'buttons']
None
null
0
0
0
null
0
null
The function (G2RadioButtons) defined within the public class called public.The function start at line 1430 and ends at 1463. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [1430.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CallScrolledMultiEditor
def CallScrolledMultiEditor(parent,dictlst,elemlst,prelbl=[],postlbl=[], title='Edit items',header='',size=(300,250), CopyButton=False, ASCIIonly=False, **kw):
1
3
9
46
0
1,466
1,468
1,466
null
[]
None
null
0
0
0
null
0
null
The function (CallScrolledMultiEditor) defined within the public class called public.The function start at line 1466 and ends at 1468. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [1466.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent,dictlst,elemlst,prelbl=[],postlbl=[], title='Edit items',header='',size=(300,250), CopyButton=False, ASCIIonly=False, minvals=[],maxvals=[],sizevals=[], checkdictlst=[], checkelemlst=[], checklabel=""):
1
5
10
74
0
1,570
1,574
1,570
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1570 and ends at 1574. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 10 parameters, represented as [1570.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_OnCopyButton
def _OnCopyButton(self,event):'Implements the copy down functionality'but = event.GetEventObject()n = self.ButtonIndex.get(but)if n is None: returnfor i,(d,k,ctrl) in enumerate(zip(self.dictlst,self.elemlst,self.ValidatedControlsList)):if i < n: continueif i == n:val = d[k]continued[k] = valctrl.ChangeValue(val)for i i...
7
16
2
162
0
1,679
1,694
1,679
null
[]
None
null
0
0
0
null
0
null
The function (_OnCopyButton) defined within the public class called public.The function start at line 1679 and ends at 1694. It contains 16 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [1679.0] and does not return any value..