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
__init__
def __init__(self,parent,msg='',helpIndex='',wrap=None):if sys.platform == "darwin":wx.Button.__init__(self,parent,wx.ID_HELP)else:wx.Button.__init__(self,parent,wx.ID_ANY,' ? ',style=wx.BU_EXACTFIT)self.SetBackgroundColour('yellow')self.SetForegroundColour('black')f = wx.Font(self.GetFont()).Bold()f.SetPointSize(f.Poi...
3
19
5
172
0
6,054
6,072
6,054
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 6054 and ends at 6072. It contains 19 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [6054.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onClose
def _onClose(self,event):self.dlg.EndModal(wx.ID_CANCEL)
1
2
2
17
0
6,073
6,074
6,073
null
[]
None
null
0
0
0
null
0
null
The function (_onClose) defined within the public class called public.The function start at line 6073 and ends at 6074. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [6073.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onPress
def _onPress(self,event):'Respond to a button press by displaying the requested text'if self.helpIndex:ShowHelp(self.helpIndex,self.parent)returnself.dlg = wx.Dialog(self.parent,wx.ID_ANY,'Help information',style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)mainSizer = wx.BoxSizer(wx.VERTICAL)txt = wx.StaticText(self.dlg,w...
3
23
2
223
0
6,075
6,097
6,075
null
[]
None
null
0
0
0
null
0
null
The function (_onPress) defined within the public class called public.The function start at line 6075 and ends at 6097. It contains 23 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [6075.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
updateNotifier.tblLine
def tblLine(dlg,pixels=3):'place line in table'txtbox = wx.StaticText(dlg,wx.ID_ANY,'',size=(-1,pixels))txtbox.SetBackgroundColour(wx.Colour(0,0,0))tblSizer.Add(txtbox,0,wx.EXPAND)txtbox = wx.StaticText(dlg,wx.ID_ANY,'',size=(-1,pixels))txtbox.SetBackgroundColour(wx.Colour(0,0,0))tblSizer.Add(txtbox,0,wx.EXPAND)
1
8
2
110
0
6,113
6,120
6,113
null
[]
None
null
0
0
0
null
0
null
The function (updateNotifier.tblLine) defined within the public class called public.The function start at line 6113 and ends at 6120. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [6113.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
updateNotifier
def updateNotifier(G2frame,fileVersion):'''Posts an update notice when a a specially tagged GSAS-II versionis seen for the first time. Versions to be tagged are set in globalupdateNoticeDict; version info is found in file versioninfo.txt.:param wx.Frame G2frame: GSAS-II main window:param int fileVersion: version of GSA...
25
111
2
872
18
6,104
6,231
6,104
null
['vers', 'btnsizer', 'panel', 'rev', 'OKbtn', 'fp', 'noticeDict', 'sizer', 'txtbox', 'filnam', 'allProjects', 'tblSizer', 'btn', 'dlg', 'vars', 'lastNotice', 'size', 'show']
None
null
0
0
0
null
0
null
The function (updateNotifier) defined within the public class called public.The function start at line 6104 and ends at 6231. It contains 111 lines of code and it has a cyclomatic complexity of 25. It takes 2 parameters, represented as [6104.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
viewWebPage.copyURL
def copyURL(event):'''Copies URL name to paste buffer'''txt = event.GetEventObject().GetValue()if wx.TheClipboard.Open():wx.TheClipboard.SetData(wx.TextDataObject(txt))wx.TheClipboard.Close()
2
5
1
46
0
6,256
6,262
6,256
null
[]
None
null
0
0
0
null
0
null
The function (viewWebPage.copyURL) defined within the public class called public.The function start at line 6256 and ends at 6262. It contains 5 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
viewWebPage
def viewWebPage(parent,URL,size=(750,450),newFrame=False,HTML=''):'''Creates a child wx.Frame with an OS-managed web browser. The windowis modeless, so it can be left open without affecting GSAS-II operations,but will be closed when GSAS-II is ended if a ``parent`` window isspecified.The web browser is filled with a su...
6
46
4
450
7
6,234
6,314
6,234
null
['txt', 'close', 'sizer', 'bsizer', 'lastWebFrame', 'dlg', 'urltxt']
None
null
0
0
0
null
0
null
The function (viewWebPage) defined within the public class called public.The function start at line 6234 and ends at 6314. It contains 46 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [6234.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
StripIndents
def StripIndents(msg,singleLine=False):'''Strip unintended indentation from multiline strings.When singleLine is True, all newline are removed, but inserting "%%"into the string will cause a blank line to be inserted at that pointand %t% will generate a new line and tab (to indent a line):param str msg: a string contai...
5
19
2
139
2
6,317
6,346
6,317
null
['msg1', 'msg']
None
null
0
0
0
null
0
null
The function (StripIndents) defined within the public class called public.The function start at line 6317 and ends at 6346. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [6317.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
StripUnicode
def StripUnicode(string,subs='.'):'''Strip non-ASCII characters from strings:param str string: string to strip Unicode characters from:param str subs: character(s) to place into string in place of eachUnicode character. Defaults to '.':returns: a new string with only ASCII characters'''s = ''for c in string:if ord(c) <...
3
8
2
43
1
6,348
6,363
6,348
null
['s']
None
null
0
0
0
null
0
null
The function (StripUnicode) defined within the public class called public.The function start at line 6348 and ends at 6363. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [6348.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
getTextSize
def getTextSize(txt):'Get the size of the text string txt in points, returns (x,y)'dc = wx.ScreenDC()return tuple(dc.GetTextExtent(txt))
1
4
1
23
1
6,365
6,368
6,365
null
['dc']
None
null
0
0
0
null
0
null
The function (getTextSize) defined within the public class called public.The function start at line 6365 and ends at 6368. 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
BlockSelector
def BlockSelector(ChoiceList, ParentFrame=None,title='Select a block',size=None, header='Block Selector',useCancel=True):''' Provide a wx dialog to select a single block where one mustbe selected. Used for selecting for banks for instrumentparameters if the file contains more than one set.'''if useCancel:dlg = wx.Singl...
4
18
6
125
2
6,371
6,392
6,371
null
['sel', 'dlg']
None
null
0
0
0
null
0
null
The function (BlockSelector) defined within the public class called public.The function start at line 6371 and ends at 6392. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [6371.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MultipleBlockSelector
def MultipleBlockSelector(ChoiceList, ParentFrame=None,title='Select a block',size=None, header='Block Selector'):'''Provide a wx dialog to select a block of data if thefile contains more than one set of data and one must beselected. Used in :mod:`G2pwd_CIF` only.:returns: a list of the selected blocks'''dlg = wx.Multi...
4
18
5
117
3
6,394
6,417
6,394
null
['sel', 'selected', 'dlg']
None
null
0
0
0
null
0
null
The function (MultipleBlockSelector) defined within the public class called public.The function start at line 6394 and ends at 6417. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [6394.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,choicelist,headinglist, head='Select options', title='Please select from options below', parent=None):self.chosen = []wx.Dialog.__init__(self,parent,wx.ID_ANY,head,pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)panel = wx.Panel(self)mainSizer = wx.BoxSizer(wx.VERTICAL)mainSizer.Add((10,10),1)top...
2
35
6
374
0
6,431
6,466
6,431
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 6431 and ends at 6466. It contains 35 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [6431.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnOk
def OnOk(self,event):parent = self.GetParent()if parent is not None: parent.Raise()# save the results from the choice widgetsself.chosen = []for w in self.ChItems:self.chosen.append(w.GetSelection())self.EndModal(wx.ID_OK)
3
7
2
58
0
6,468
6,475
6,468
null
[]
None
null
0
0
0
null
0
null
The function (OnOk) defined within the public class called public.The function start at line 6468 and ends at 6475. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [6468.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnCancel
def OnCancel(self,event):parent = self.GetParent()if parent is not None: parent.Raise()self.chosen = []self.EndModal(wx.ID_CANCEL)
2
5
2
39
0
6,477
6,481
6,477
null
[]
None
null
0
0
0
null
0
null
The function (OnCancel) defined within the public class called public.The function start at line 6477 and ends at 6481. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [6477.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MultipleChoicesSelector
def MultipleChoicesSelector(choicelist, headinglist, ParentFrame=None, **kwargs):'''A modal dialog that offers a series of choices, each with a title and a wx.Choicewidget. Used in :mod:`G2pwd_CIF` only.Typical input: * choicelist=[ ('a','b','c'), ('test1','test2'),('no choice',)] * headinglist = [ 'select a, b or c', ...
2
9
4
61
2
6,483
6,503
6,483
null
['result', 'dlg']
None
null
0
0
0
null
0
null
The function (MultipleChoicesSelector) defined within the public class called public.The function start at line 6483 and ends at 6503. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [6483.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
PhaseSelector
def PhaseSelector(ChoiceList, ParentFrame=None,title='Select a phase', size=None,header='Phase Selector'):''' Provide a wx dialog to select a phase, used in importers if a filecontains more than one phase'''return BlockSelector(ChoiceList,ParentFrame,title,size,header)
1
4
5
35
0
6,505
6,511
6,505
null
[]
None
null
0
0
0
null
0
null
The function (PhaseSelector) defined within the public class called public.The function start at line 6505 and ends at 6511. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [6505.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
XformMatrix
def XformMatrix(panel,Trans,Uvec,Vvec,OnLeave=None,OnLeaveArgs={}):'''Display a transformation matrix and two vectors'''Trmat = wx.FlexGridSizer(4,6,0,0)Trmat.Add((10,0),0)Trmat.Add(wx.StaticText(panel,label='M'),wx.ALIGN_CENTER)Trmat.Add((10,0),0)Trmat.Add((10,0),0)Trmat.Add(wx.StaticText(panel,label='U'),wx.ALIGN_CEN...
3
21
6
285
3
6,513
6,535
6,513
null
['vec', 'item', 'Trmat']
None
null
0
0
0
null
0
null
The function (XformMatrix) defined within the public class called public.The function start at line 6513 and ends at 6535. It contains 21 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [6513.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
showUniqueCell
def showUniqueCell(frame,cellSizer,row,cell,SGData=None, editAllowed=False,OnCellChange=None):'''function to put cell values into a GridBagSizer.First column (#0) is reserved for labels etc.if editAllowed is True, values are placed in a wx.TextCtrl and if neededtwo rows are used in the table.'''cellGUIlist = [[['m3','m...
13
56
7
686
10
6,537
6,598
6,537
null
['cellList', 'col', 'useGUI', 'cellVal', 'laue', 'volVal', 'Fmt', 'volCol', 'cellGUIlist', 'cellrow']
None
null
0
0
0
null
0
null
The function (showUniqueCell) defined within the public class called public.The function start at line 6537 and ends at 6598. It contains 56 lines of code and it has a cyclomatic complexity of 13. It takes 7 parameters, represented as [6537.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SaveGPXdirectory
def SaveGPXdirectory(path,write=True):if GSASIIpath.GetConfigValue('Starting_directory') == path: returnvars = GetConfigValsDocs()try:vars['Starting_directory'][1] = pathif GSASIIpath.GetConfigValue('debug'): print('DBG_Saving GPX path: '+path)if write: SaveConfigVars(vars)except KeyError:pass
5
9
2
61
1
6,603
6,611
6,603
null
['vars']
None
null
0
0
0
null
0
null
The function (SaveGPXdirectory) defined within the public class called public.The function start at line 6603 and ends at 6611. It contains 9 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [6603.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SaveImportDirectory
def SaveImportDirectory(path):if GSASIIpath.GetConfigValue('Import_directory') == path: returnvars = GetConfigValsDocs()try:vars['Import_directory'][1] = pathif GSASIIpath.GetConfigValue('debug'): print('DBG_Saving Import path: '+path)SaveConfigVars(vars)except KeyError:pass
4
9
1
54
1
6,613
6,621
6,613
null
['vars']
None
null
0
0
0
null
0
null
The function (SaveImportDirectory) defined within the public class called public.The function start at line 6613 and ends at 6621. 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
GetConfigValsDocs
def GetConfigValsDocs():'''Reads the module referenced in fname (often <module>.__file__) andreturn a dict with names of global variables as keys.For each global variable, the value contains four items::returns: a dict where keys are names defined in module config_example.pywhere the value is a list of four items, as f...
6
23
0
195
7
6,623
6,658
6,623
null
['start', 'tree', 'fstr', 'fname', 'key', 'default', 'd']
None
null
0
0
0
null
0
null
The function (GetConfigValsDocs) defined within the public class called public.The function start at line 6623 and ends at 6658. It contains 23 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
SaveConfigVars
def SaveConfigVars(vars,parent=None):'''Write the current config variable values to~/.GSASII/config.ini:params dict vars: a dictionary of variable settings and meanings ascreated in :func:`GetConfigValsDocs`. Most of the information gatheredin GetConfigValsDocs is no longer used here.:param parent: wx.Frame object or N...
5
8
2
98
1
6,660
6,675
6,660
null
['configDict']
None
null
0
0
0
null
0
null
The function (SaveConfigVars) defined within the public class called public.The function start at line 6660 and ends at 6675. It contains 8 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [6660.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent):style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDERwx.Dialog.__init__(self, parent, wx.ID_ANY, 'Set Config Variable', style=style)self.sizer = wx.BoxSizer(wx.VERTICAL)self.vars = GetConfigValsDocs()self.G2frame = parentself.restart = Falseself.reload = Falselabel = wx.StaticText(self,wx.ID_ANY,'S...
3
38
2
433
0
6,680
6,722
6,680
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 6680 and ends at 6722. It contains 38 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [6680.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnChange
def OnChange(self,event=None):''' Check if anything been changed. Turn the save button on/off.'''for var in self.vars:if self.vars[var][0] is None and self.vars[var][1] is not None:# make blank strings into None, if that is the defaultif self.vars[var][1].strip() == '': self.vars[var][1] = Noneif self.vars[var][1] != s...
9
18
2
173
0
6,724
6,745
6,724
null
[]
None
null
0
0
0
null
0
null
The function (OnChange) defined within the public class called public.The function start at line 6724 and ends at 6745. It contains 18 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [6724.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowColor
def ShowColor(self):if self.colorChip:var = self.choice[0]if self.vars[var][1]:color = self.vars[var][1]else:color = self.vars[var][0]self.colorText.SetLabel(color)# set the color if validtry:self.colorChip.SetBackgroundColour(wx.Colour('#'+color))except:self.colorChip.SetLabel('Invalid color')self.colorChip.SetBackgro...
4
14
1
104
0
6,747
6,761
6,747
null
[]
None
null
0
0
0
null
0
null
The function (ShowColor) defined within the public class called public.The function start at line 6747 and ends at 6761. It contains 14 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
OnSave
def OnSave(self,event):'''Write the config variables to ~/.GSASII/config.inias the current settings'''SaveConfigVars(self.vars,parent=self)GSASIIpath.SetConfigValue(self.vars)self.EndModal(wx.ID_OK)
1
4
2
34
0
6,763
6,769
6,763
null
[]
None
null
0
0
0
null
0
null
The function (OnSave) defined within the public class called public.The function start at line 6763 and ends at 6769. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [6763.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnBoolSelect
def OnBoolSelect(self,event):'Respond to a change in a True/False variable'rb = event.GetEventObject()var = self.choice[0]self.vars[var][1] = (rb.GetSelection() == 0)self.OnChange()wx.CallAfter(self.OnSelection)
1
7
2
55
0
6,771
6,777
6,771
null
[]
None
null
0
0
0
null
0
null
The function (OnBoolSelect) defined within the public class called public.The function start at line 6771 and ends at 6777. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [6771.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onSelDir
def onSelDir(self,event):'Select a directory from a menu'dlg = wx.DirDialog(self, "Choose a directory:",style=wx.DD_DEFAULT_STYLE)if dlg.ShowModal() == wx.ID_OK:var = self.choice[0]self.vars[var][1] = dlg.GetPath()self.strEd.ChangeValue(self.vars[var][1])self.OnChange()dlg.Destroy()
2
9
2
84
0
6,779
6,787
6,779
null
[]
None
null
0
0
0
null
0
null
The function (onSelDir) defined within the public class called public.The function start at line 6779 and ends at 6787. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [6779.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onSelColor
def onSelColor(self,event):'Select a color from a menu'dlg = wx.ColourDialog(self)dlg.GetColourData().SetChooseFull(True) # Show the full color dialogif dlg.ShowModal() == wx.ID_OK:c = dlg.GetColourData().GetColour()#self.colorChip.SetBackgroundColour(c)# convert to mpl format w/o '#' prefixmplcolor = ''.join([f"{i:x}"...
4
11
2
103
0
6,789
6,802
6,789
null
[]
None
null
0
0
0
null
0
null
The function (onSelColor) defined within the public class called public.The function start at line 6789 and ends at 6802. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [6789.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onSelExec
def onSelExec(self,event):'Select an executable file from a menu'var = self.choice[0]is_exe = lambda fpath: os.path.isfile(fpath) and os.access(fpath, os.X_OK)defD = defF = ''if self.vars[var][1] is not None and os.path.exists(self.vars[var][1]):defD,defF=os.path.split(self.vars[var][1])repeat = Truewhile repeat:repeat...
9
32
2
263
0
6,804
6,835
6,804
null
[]
None
null
0
0
0
null
0
null
The function (onSelExec) defined within the public class called public.The function start at line 6804 and ends at 6835. It contains 32 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [6804.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSelection.OnNewColorBar
def OnNewColorBar(event):self.vars['Contour_color'][1] = self.colSel.GetValue()self.OnChange(event)
1
3
1
28
0
6,840
6,842
6,840
null
[]
None
null
0
0
0
null
0
null
The function (OnSelection.OnNewColorBar) defined within the public class called public.The function start at line 6840 and ends at 6842. 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
OnSelection
def OnSelection(self):'show a selected variable and allow it to be changed'def OnNewColorBar(event):self.vars['Contour_color'][1] = self.colSel.GetValue()self.OnChange(event)if 'phoenix' in wx.version():self.varsizer.Clear(True)else:self.varsizer.DeleteWindows()var = self.choice[0]showdef = Trueself.colorText = Nonesel...
28
115
1
1,293
0
6,838
6,962
6,838
null
[]
None
null
0
0
0
null
0
null
The function (OnSelection) defined within the public class called public.The function start at line 6838 and ends at 6962. It contains 115 lines of code and it has a cyclomatic complexity of 28. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnClear
def OnClear(self, event):var = self.choice[0]self.vars[var][1] = self.vars[var][0]self.OnChange()wx.CallAfter(self.OnSelection)
1
5
2
47
0
6,964
6,968
6,964
null
[]
None
null
0
0
0
null
0
null
The function (OnClear) defined within the public class called public.The function start at line 6964 and ends at 6968. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [6964.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, title='Residual', message='All data Rw =', maximum=101, parent=None, trialMode=False, seqLen=0, style=None):if style is None:style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORTsuper(self.__class__,self).__init__(title, message, int(maximum), parent, style)Size = self.GetSize()if 50 < Size[0] <...
3
11
8
125
0
6,978
6,988
6,978
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 6978 and ends at 6988. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 8 parameters, represented as [6978.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Update
def Update(self,value, newmsg=""):wx.GetApp().Yield()#print('wx Yield called')#print('Update:',value,newmsg)return super(self.__class__,self).Update(int(value), newmsg)
1
3
3
39
0
6,990
6,994
6,990
null
[]
None
null
0
0
0
null
0
null
The function (Update) defined within the public class called public.The function start at line 6990 and ends at 6994. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [6990.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, title='Refinement progress', message='All data Rw =',maximum=101, parent=None, trialMode=False,seqLen=0, seqShow=3,style=None):#import matplotlib as mpltry:from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvasexcept ImportError:from matplotlib.backends.backend_wx import FigureCanv...
6
85
9
890
0
7,018
7,110
7,018
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 7018 and ends at 7110. It contains 85 lines of code and it has a cyclomatic complexity of 6. It takes 9 parameters, represented as [7018.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onClose
def _onClose(self,event):'''Respond to abort button or close of window'''self.abortStatus = Trueself.Show(False)
1
3
2
19
0
7,112
7,116
7,112
null
[]
None
null
0
0
0
null
0
null
The function (_onClose) defined within the public class called public.The function start at line 7112 and ends at 7116. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [7112.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Destroy
def Destroy(self):'''Destroy the window, but allow events to clear before doing so'''wx.CallAfter(wx.Dialog.Destroy,self)
1
2
1
18
0
7,118
7,121
7,118
null
[]
None
null
0
0
0
null
0
null
The function (Destroy) defined within the public class called public.The function start at line 7118 and ends at 7121. 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
_makeLabeledTable
def _makeLabeledTable(self):'''Create two grid sizers, one with row labels and one scrolled.Use _xferLabeledTable to make the row heights match.'''lblSizer = wx.BoxSizer(wx.HORIZONTAL)self.Labels = wx.GridBagSizer(2,2)lblSizer.Add(self.Labels)self.RwPanel = wx.lib.scrolledpanel.ScrolledPanel(self, wx.ID_ANY, size=(180,...
2
20
1
221
0
7,123
7,146
7,123
null
[]
None
null
0
0
0
null
0
null
The function (_makeLabeledTable) defined within the public class called public.The function start at line 7123 and ends at 7146. It contains 20 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
_xferLabeledTable
def _xferLabeledTable(self):'''Matches the row sizes of the labels to the row heights in the table'''for i,h in enumerate(self.gridSiz.GetRowHeights()):self.Labels.label[i].SetMinSize((-1,h))self.Labels.Layout()
2
4
1
47
0
7,148
7,153
7,148
null
[]
None
null
0
0
0
null
0
null
The function (_xferLabeledTable) defined within the public class called public.The function start at line 7148 and ends at 7153. 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
SetMaxCycle
def SetMaxCycle(self,value):'''Set the maximum number of cycles or histograms (sequential fit).Used to scale settings so the gauge bar completes close to 100%.Ignored for sequential refinements.'''if self.SeqLen: returnself.maxCycle = value
2
3
2
19
0
7,155
7,161
7,155
null
[]
None
null
0
0
0
null
0
null
The function (SetMaxCycle) defined within the public class called public.The function start at line 7155 and ends at 7161. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [7155.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_AddTableColumn
def _AddTableColumn(self,label='',col=None):'add a column to the Rfactor table'if col is None:self.cols += 1col = self.colslbls = []for i in range(self.rows-1):lbls.append(wx.StaticText(self.RwPanel,wx.ID_ANY,'',style=wx.ALIGN_CENTER))self.gridSiz.Add(lbls[-1],(1+i,col))return col,lbls
3
10
3
94
0
7,163
7,172
7,163
null
[]
None
null
0
0
0
null
0
null
The function (_AddTableColumn) defined within the public class called public.The function start at line 7163 and ends at 7172. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [7163.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetHistogram
def SetHistogram(self,nextHist,histLbl):'''Set this before beginning processing of each histogram'''if nextHist is None:self.curHist = Noneself.msgLine1.SetLabel(histLbl)returnif self.SeqLen:self._SetSeqHistogram(nextHist,histLbl)returncol = Nonelbl = 'Hist {}'.format(nextHist)if nextHist == -1:# overall fit goes in th...
7
23
3
151
0
7,174
7,199
7,174
null
[]
None
null
0
0
0
null
0
null
The function (SetHistogram) defined within the public class called public.The function start at line 7174 and ends at 7199. It contains 23 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [7174.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_SetSeqHistogram
def _SetSeqHistogram(self,nextHist,histLbl):'''Set this before beginning processing of each histogram in a sequential fit.Advances the completion gauge.'''if nextHist == -1:# overall fit is not shownself.curHist = nextHistreturnelif nextHist == -2:# Restraint Chi2 contribution goes in the 1st colif nextHist not in self...
12
31
3
298
0
7,201
7,235
7,201
null
[]
None
null
0
0
0
null
0
null
The function (_SetSeqHistogram) defined within the public class called public.The function start at line 7201 and ends at 7235. It contains 31 lines of code and it has a cyclomatic complexity of 12. It takes 3 parameters, represented as [7201.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_plotBar
def _plotBar(self,h):'plot a vertical bar for a histogram'sym,lbl = self._getPlotSetting(h)l = len(self.fitVals[h])wid = 10.if h < 0:if h == -2 and -1 in self.fitVals:self.histOff[h] = h/widelse:self.histOff[h] = -1/widelse:self.histOff[h] = len([i for i in self.plotted if i >= 0])/widself.plotaxis.bar(np.array(range(l...
6
15
2
153
0
7,237
7,251
7,237
null
[]
None
null
0
0
0
null
0
null
The function (_plotBar) defined within the public class called public.The function start at line 7237 and ends at 7251. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [7237.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_getPlotSetting
def _getPlotSetting(self,h):'determines how a plot is drawn'if h == -1:sym = "m" # magentalbl = 'o'elif h == -2:sym = "c" # cyanlbl = 'r'else:symbols = ['b','r','g']sym = symbols[h%3]lbl = str(h)return sym,lbl
3
13
2
61
0
7,253
7,265
7,253
null
[]
None
null
0
0
0
null
0
null
The function (_getPlotSetting) defined within the public class called public.The function start at line 7253 and ends at 7265. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [7253.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_SetCycleRw
def _SetCycleRw(self,value):'''Used to process an Rwp value from the :meth:`Update` method.The value will be associated with the current histogram (as setin :meth:`SetHistogram`). If this is the 1st supplied value forthat histogram, the value is set and displayed as as the startingRwp. If :data`:self.trialRw` is False,...
21
41
2
429
0
7,267
7,317
7,267
null
[]
None
null
0
0
0
null
0
null
The function (_SetCycleRw) defined within the public class called public.The function start at line 7267 and ends at 7317. It contains 41 lines of code and it has a cyclomatic complexity of 21. It takes 2 parameters, represented as [7267.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AdvanceCycle
def AdvanceCycle(self,cycle=None):'''Call this directly with Levenberg-Marquardt fitting after acycle completes.Plots the results.'''self.plotaxis.clear()self.trialcount = 0self.plotted = []for h,value in self.trialVals.items():if h not in self.fitVals or h not in self.tblLbls: continueself.fitVals[h].append(value)self...
8
13
2
149
0
7,319
7,335
7,319
null
[]
None
null
0
0
0
null
0
null
The function (AdvanceCycle) defined within the public class called public.The function start at line 7319 and ends at 7335. It contains 13 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [7319.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Update
def Update(self, value=None, newmsg=""):'''designed to work with calls intended for wx.ProgressDialog.Updatethe value is assumed to be the current wR value for the histogramselected with SetHistogram and newmsg goes into the 2nd status line.'''if self.curHist is not None and value != 101.:self._SetCycleRw(value)if newm...
4
10
3
113
0
7,337
7,350
7,337
null
[]
None
null
0
0
0
null
0
null
The function (Update) defined within the public class called public.The function start at line 7337 and ends at 7350. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [7337.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,parent=None):#import gitself.g2repo = GSASIIpath.openGitRepo(path2GSAS2)self.githistory = GSASIIpath.gitHistory('hash',self.g2repo)# patch Feb 2024: don't allow access to versions that are too old# since they are hard-coded to use svnimport datetimetz = self.g2repo.commit(self.githistory[0]).committed...
4
93
2
868
0
7,357
7,463
7,357
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 7357 and ends at 7463. It contains 93 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [7357.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_onSpin
def _onSpin(self,event):'Called to load info about the selected version in the dialog'if event: event.Skip()try:commit_info = self.docCommit(self.githistory[-self.spin.GetValue()])self.text.SetLabel(commit_info)self.text.Wrap(435)except IndexError:returnself.spanel.SetAutoLayout(1)self.spanel.SetupScrolling()
3
11
2
73
0
7,465
7,475
7,465
null
[]
None
null
0
0
0
null
0
null
The function (_onSpin) defined within the public class called public.The function start at line 7465 and ends at 7475. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [7465.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
getVersion
def getVersion(self):'''Gets the selected version that should be installed:return: returns one of three values: * 0: if the newest version is selected, so that the installation should be updated rather than regressed * None: if the currently installed version is selected, so that nothing need be done * A hexsha string:...
3
7
1
52
0
7,477
7,494
7,477
null
[]
None
null
0
0
0
null
0
null
The function (getVersion) defined within the public class called public.The function start at line 7477 and ends at 7494. 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
docCommit
def docCommit(self,commit):'''Provides a string with information about a specific git commit.:returns: a multi-line string'''#import datetimefmtdate = lambda c:"{:%d-%b-%Y %H:%M}".format(c.committed_datetime)commit = self.g2repo.commit(commit)# converts a hash, if suppliedmsg = f'git {commit.hexsha[:10]} from {fmtdate(...
2
9
2
74
0
7,496
7,509
7,496
null
[]
None
null
0
0
0
null
0
null
The function (docCommit) defined within the public class called public.The function start at line 7496 and ends at 7509. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [7496.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent):wx.Panel.__init__(self, parent, wx.ID_ANY)#, style=wx.WANTS_CHARS)sizer = wx.BoxSizer(wx.VERTICAL)self.list = G2LstCtrl(self, wx.ID_ANY, style=wx.LC_REPORT| wx.BORDER_SUNKEN)sizer.Add(self.list, 1, wx.EXPAND)self.SetSizer(sizer)self.SetAutoLayout(True)
1
7
2
79
0
7,525
7,531
7,525
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 7525 and ends at 7531. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [7525.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
PopulateHeader
def PopulateHeader(self, header, justify):'''Defines the column labels:param list header: a list of strings with header labels:param list justify: a list of int values where 0 causes left justification,1 causes right justification, and -1 causes centering'''info = wx.ListItem()info.Mask = wx.LIST_MASK_TEXT | wx.LIST_MA...
4
15
3
126
0
7,534
7,554
7,534
null
[]
None
null
0
0
0
null
0
null
The function (PopulateHeader) defined within the public class called public.The function start at line 7534 and ends at 7554. It contains 15 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [7534.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
PopulateLine
def PopulateLine(self, key, data):'''Enters each row into the table:param int key: a unique int value for each line, probably shouldbe sequential:param list data: a list of strings for each column in that row'''index = self.list.InsertItem(self.list.GetItemCount(), data[0])for i,d in enumerate(data[1:]):self.list.SetIt...
2
6
3
79
0
7,556
7,567
7,556
null
[]
None
null
0
0
0
null
0
null
The function (PopulateLine) defined within the public class called public.The function start at line 7556 and ends at 7567. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [7556.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetColWidth
def SetColWidth(self,col,width=None,auto=True,minwidth=0,maxwidth=None):'''Sets the column width.:param int width: the column width in pixels:param bool auto: if True (default) and width is None (default) thewidth is set by the maximum width entry in the column:param int minwidth: used when auto is True, sets a minimum...
7
11
6
106
0
7,569
7,589
7,569
null
[]
None
null
0
0
0
null
0
null
The function (SetColWidth) defined within the public class called public.The function start at line 7569 and ends at 7589. It contains 11 lines of code and it has a cyclomatic complexity of 7. It takes 6 parameters, represented as [7569.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent, ID=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0):wx.ListCtrl.__init__(self, parent, ID, pos, size, style)listmix.ListCtrlAutoWidthMixin.__init__(self)from wx.lib.embeddedimage import PyEmbeddedImage# from demo/images.pySmallUpArrow = PyEmbeddedImage(b"iVBORw0KGgoAAAANSUhEUg...
1
18
6
146
0
7,595
7,613
7,595
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 7595 and ends at 7613. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [7595.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetListCtrl
def GetListCtrl(self): # needed for sortingreturn self
1
2
1
7
0
7,615
7,616
7,615
null
[]
None
null
0
0
0
null
0
null
The function (GetListCtrl) defined within the public class called public.The function start at line 7615 and ends at 7616. 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
GetSortImages
def GetSortImages(self):#return (self.parent.DownArrow, self.parent.UpArrow)return (self.DownArrow, self.UpArrow)
1
2
1
15
0
7,617
7,619
7,617
null
[]
None
null
0
0
0
null
0
null
The function (GetSortImages) defined within the public class called public.The function start at line 7617 and ends at 7619. 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
ShowHelp
def ShowHelp(helpType,frame,helpMode=None):'''Called to bring up a web page for documentation.'''global htmlFirstUse,htmlPanel,htmlFrameif not helpLocDict: # load the anchor indexindx = os.path.abspath(os.path.join(path2GSAS2,'help','anchorIndex.txt'))print('reading file',indx)with open(indx,'r') as indexfile:for line ...
14
68
3
385
11
7,638
7,716
7,638
null
['appleScript', 'wb', 'a', 'helplink', 'pfx', 'indx', 'helpMode', 'f', 'browser', 'anchor', 'htmlFirstUse']
None
null
0
0
0
null
0
null
The function (ShowHelp) defined within the public class called public.The function start at line 7638 and ends at 7716. It contains 68 lines of code and it has a cyclomatic complexity of 14. It takes 3 parameters, represented as [7638.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowWebPage
def ShowWebPage(URL,frame,browser=False,internal=False):'''Called to show a tutorial web page.:param str URL: web page URL:param wx.Frame frame: parent window (or None):param bool browser: If True, forces the page to be opened in a webbrowser, regardless of the ``Help_mode`` config setting.'''global htmlFirstUse,htmlPa...
9
23
4
135
3
7,718
7,750
7,718
null
['pfx', 'helpMode', 'htmlFirstUse']
None
null
0
0
0
null
0
null
The function (ShowWebPage) defined within the public class called public.The function start at line 7718 and ends at 7750. It contains 23 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [7718.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OpenTutorial
def OpenTutorial(parent):#how_install = GSASIIpath.HowIsG2Installed()#if how_install.startswith('git'):#return OpenGitTutorial(parent)#else:return OpenGitTutorial(parent)
1
2
1
10
0
7,757
7,762
7,757
null
[]
None
null
0
0
0
null
0
null
The function (OpenTutorial) defined within the public class called public.The function start at line 7757 and ends at 7762. 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
__init__
def __init__(self,parent):style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDERwx.Dialog.__init__(self, parent, wx.ID_ANY, 'Open Tutorial', style=style)self.G2frame = self.frame = parentpnl = wx.Panel(self)sizer = wx.BoxSizer(wx.VERTICAL)sizer1 = wx.BoxSizer(wx.HORIZONTAL)msg = ('To open a tutorial, select below the mode to...
1
60
2
518
0
7,771
7,832
7,771
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 7771 and ends at 7832. It contains 60 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [7771.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetTutorialPath
def SetTutorialPath(self):'''Get the tutorial location if set; if not pick a defaultdirectory in a logical place'''# has the user set a location and is it valid?if GSASIIpath.GetConfigValue('Tutorial_location'):tutorialPath = os.path.abspath(GSASIIpath.GetConfigValue('Tutorial_location'))if os.path.exists(tutorialPath)...
17
56
1
362
0
7,834
7,896
7,834
null
[]
None
null
0
0
0
null
0
null
The function (SetTutorialPath) defined within the public class called public.The function start at line 7834 and ends at 7896. It contains 56 lines of code and it has a cyclomatic complexity of 17. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SelectAndDownload
def SelectAndDownload(self,event):'''Shows a list of all tutorials so user can select one to view.The data files associated with that directory are then downloaded.'''tutdir = self.onWebBrowse(event)if tutdir is None: returnGSASIIpath.downloadDirContents([tutdir,'data'],self.tutorialPath)
2
4
2
36
0
7,898
7,904
7,898
null
[]
None
null
0
0
0
null
0
null
The function (SelectAndDownload) defined within the public class called public.The function start at line 7898 and ends at 7904. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [7898.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onWebBrowse
def onWebBrowse(self,event):'''Shows a list of all tutorials so user can select one to view.:returns: the name of the directory where the tutorial is located,which is used if called from :meth:`SelectAndDownload`.'''choices2 = [i[2:4] for i in tutorialCatalog]selected = self.ChooseTutorial2(choices2)if selected is None...
3
10
2
85
0
7,906
7,922
7,906
null
[]
None
null
0
0
0
null
0
null
The function (onWebBrowse) defined within the public class called public.The function start at line 7906 and ends at 7922. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [7906.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ChooseTutorial2
def ChooseTutorial2(self,choices):'''Select tutorials from a two-column table, when possible'''lbls = ('tutorial name (indent indicates previous is required)','description')colWidths=[400,400]dlg = MultiColumnSelection(self,'select tutorial',lbls,choices,colWidths)selection = dlg.Selectiondlg.Destroy()if selection is n...
3
9
2
61
0
7,924
7,934
7,924
null
[]
None
null
0
0
0
null
0
null
The function (ChooseTutorial2) defined within the public class called public.The function start at line 7924 and ends at 7934. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [7924.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SelectDownloadLoc
def SelectDownloadLoc(self,event):'''Select a download location,Cancel resets to the default'''dlg = wx.DirDialog(self, "Choose a directory for tutorial downloads:",defaultPath=self.tutorialPath)#,style=wx.DD_DEFAULT_STYLE)try:if dlg.ShowModal() != wx.ID_OK:returnpth = dlg.GetPath()finally:dlg.Destroy()if not os.path.e...
10
34
2
237
0
7,936
7,973
7,936
null
[]
None
null
0
0
0
null
0
null
The function (SelectDownloadLoc) defined within the public class called public.The function start at line 7936 and ends at 7973. It contains 34 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [7936.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.OnBrowse
def OnBrowse(event):'''Responds when the Browse button is pressed to load a file.The routine determines which button was pressed and gets theappropriate file type and loads it into the appropriate placein the dict.'''if btn3 == event.GetEventObject():d = wx.DirDialog(dlg,'Select directory for input files',Settings['ind...
9
31
1
230
0
7,980
8,016
7,980
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.OnBrowse) defined within the public class called public.The function start at line 7980 and ends at 8016. It contains 31 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.OnFileOfFiles
def OnFileOfFiles(event):'''Read from a list of files and add those files in the orderspecified in that file.'''# get a list of existing histogramsif FileTyp == 'pwd':treePrfx = 'PWDR 'else:treePrfx = 'PDF'ReadList = []if G2frame.GPXtree.GetCount():item, cookie = G2frame.GPXtree.GetFirstChild(G2frame.root)while item:na...
15
40
1
328
0
8,018
8,061
8,018
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.OnFileOfFiles) defined within the public class called public.The function start at line 8018 and ends at 8061. It contains 40 lines of code and it has a cyclomatic complexity of 15. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.onSetFmtSelection
def onSetFmtSelection():extSel.Clear()extSel.AppendItems(fileReaders[Settings['fmt']].extensionlist)Settings['extStr'] = fileReaders[Settings['fmt']].extensionlist[0]extSel.SetSelection(0)onSetExtSelection()
1
6
0
49
0
8,062
8,067
8,062
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.onSetFmtSelection) defined within the public class called public.The function start at line 8062 and ends at 8067. It contains 6 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
AutoLoadFiles.onSetExtSelection
def onSetExtSelection():Settings['filter'] = os.path.splitext(Settings['filter'])[0] + Settings['extStr']flterInp.SetValue(Settings['filter'])TestInput()
1
4
0
40
0
8,068
8,071
8,068
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.onSetExtSelection) defined within the public class called public.The function start at line 8068 and ends at 8071. 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
AutoLoadFiles.OnQuit
def OnQuit(event):Settings['timer'].Stop()wx.CallAfter(dlg.Destroy)
1
3
1
21
0
8,072
8,074
8,072
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.OnQuit) defined within the public class called public.The function start at line 8072 and ends at 8074. 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
AutoLoadFiles.TestInput
def TestInput(*args,**kwargs):valid = Trueif not os.path.exists(Settings['indir']):valid = Falseif FileTyp == 'pwd' and not os.path.exists(Settings['instfile']):valid = Falsebtnstart.Enable(valid)FofFbtn.Enable(valid)
4
8
2
62
0
8,075
8,082
8,075
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.TestInput) defined within the public class called public.The function start at line 8075 and ends at 8082. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [8075.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.OnStart
def OnStart(event):if btnstart.GetLabel() == 'Pause':Settings['timer'].Stop()btnstart.SetLabel('Continue')returnelse:btnstart.SetLabel('Pause')if Settings['timer'].IsRunning(): returnPollTime = 1 # secG2frame.CheckNotebook()Settings['timer'].Start(int(1000*PollTime),oneShot=False)# get a list of existing histogramsif F...
8
24
1
168
0
8,083
8,108
8,083
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.OnStart) defined within the public class called public.The function start at line 8083 and ends at 8108. It contains 24 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.RunTimerPWDR
def RunTimerPWDR(event,filelist=None):if filelist is None:if GSASIIpath.GetConfigValue('debug'):import datetimeprint ("DBG_Timer tick at {:%d %b %Y %H:%M:%S}\n".format(datetime.datetime.now()))filelist = glob.glob(os.path.join(Settings['indir'],Settings['filter']))if not filelist: return#if GSASIIpath.GetConfigValue('d...
22
134
2
1,314
0
8,109
8,252
8,109
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.RunTimerPWDR) defined within the public class called public.The function start at line 8109 and ends at 8252. It contains 134 lines of code and it has a cyclomatic complexity of 22. It takes 2 parameters, represented as [8109.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles.RunTimerGR
def RunTimerGR(event):if GSASIIpath.GetConfigValue('debug'):import datetimeprint ("DBG_Timer tick at {:%d %b %Y %H:%M:%S}\n".format(datetime.datetime.now()))filelist = glob.glob(os.path.join(Settings['indir'],Settings['filter']))if not filelist: return#if GSASIIpath.GetConfigValue('debug'): print(filelist)Id = Nonefor ...
13
68
1
551
0
8,254
8,328
8,254
null
[]
None
null
0
0
0
null
0
null
The function (AutoLoadFiles.RunTimerGR) defined within the public class called public.The function start at line 8254 and ends at 8328. It contains 68 lines of code and it has a cyclomatic complexity of 13. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AutoLoadFiles
def AutoLoadFiles(G2frame,FileTyp='pwd'):from . import GSASIIscriptable as G2scdef OnBrowse(event):'''Responds when the Browse button is pressed to load a file.The routine determines which button was pressed and gets theappropriate file type and loads it into the appropriate placein the dict.'''if btn3 == event.GetEven...
13
116
2
939
48
7,978
8,440
7,978
null
['block', 'HistName', 'Ymax', 'Controls', 'AutoLoadWindow', 'npts', 'sizer', 'fInp4', 'FofFbtn', 'f', 'extList', 'msg', 'd', 'treePrfx', 'ReadList', 'Ifin', 'fInp3', 'Ymin', 'extSel', 'dlg', 'fmtchoices', 'valid', 'rdbuffer', 'Tmax', 'line', 'mnpnl', 'Tmin', 'Ibeg', 'valuesdict', 'fmtSel', 'cw', 'Settings', 'repeat', '...
None
null
0
0
0
null
0
null
The function (AutoLoadFiles) defined within the public class called public.The function start at line 7978 and ends at 8440. It contains 116 lines of code and it has a cyclomatic complexity of 13. It takes 2 parameters, represented as [7978.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ChooseOrigin
def ChooseOrigin(G2frame,rd):G2elem.SetupGeneral(rd.Phase,G2frame.dirname)# make copy of Phase but shift atoms Origin 1->2O2Phase = copy.deepcopy(rd.Phase)# make copy of atoms, shift to alternate originT = G2spc.spg2origins[rd.Phase['General']['SGData']['SpGrp']]O2atoms = O2Phase['Atoms']cx,ct,cs,cia = rd.Phase['Genera...
20
96
2
883
18
8,443
8,565
8,443
null
['cellContents', 'centro', 'btnSizer', 'txt', 'ans', 'DisAglData', 'txtbox', 'O2Phase', 'O2Btn', 'width', 'mainSizer', 'T', 'O2atoms', 'dlg', 'O1Btn', 'DisAglCtls', 'SGData', 'msg']
None
null
0
0
0
null
0
null
The function (ChooseOrigin) defined within the public class called public.The function start at line 8443 and ends at 8565. It contains 96 lines of code and it has a cyclomatic complexity of 20. It takes 2 parameters, represented as [8443.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makeContourSliders.updatePlot
def updatePlot():'updates plot after a change in values'wx.CallAfter(PlotPatterns,G2frame,newPlot=newPlot,plotType=plottype)
1
3
0
21
0
8,571
8,573
8,571
null
[]
None
null
0
0
0
null
0
null
The function (makeContourSliders.updatePlot) defined within the public class called public.The function start at line 8571 and ends at 8573. 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
makeContourSliders.OnSlider
def OnSlider(event):'respond when min or max slider is moved'obj = event.GetEventObject()val = obj.GetValue()/100.if obj.mode == 'max':G2frame.Cmax = valelse:G2frame.Cmin = valobj.txt.ChangeValue(int(Ymax*val))updatePlot()
2
10
1
58
0
8,574
8,583
8,574
null
[]
None
null
0
0
0
null
0
null
The function (makeContourSliders.OnSlider) defined within the public class called public.The function start at line 8574 and ends at 8583. It contains 10 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
makeContourSliders.OnNewVal
def OnNewVal(*args,**kwargs):'respond when a value is placed in the min or max text box'obj = kwargs['tc']if obj.mode == 'max':val = Range[1]G2frame.Cmax = val/Ymaxelse:val = Range[0]G2frame.Cmin = val/Ymaxobj.slider.SetValue(int((100*val/Ymax) + 0.5))updatePlot()
2
11
2
75
0
8,584
8,594
8,584
null
[]
None
null
0
0
0
null
0
null
The function (makeContourSliders.OnNewVal) defined within the public class called public.The function start at line 8584 and ends at 8594. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [8584.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makeContourSliders
def makeContourSliders(G2frame,Ymax,PlotPatterns,newPlot,plottype):'''Create a non-modal dialog for sliders to set contour plotintensity thresholds.'''def updatePlot():'updates plot after a change in values'wx.CallAfter(PlotPatterns,G2frame,newPlot=newPlot,plotType=plottype)def OnSlider(event):'respond when min or max ...
1
55
5
645
11
8,567
8,651
8,567
null
['obj', 'maxSel', 'vbox', 'btn', 'hbox', 'dlg', 'val', 'Range', 'minSel', 'maxVal', 'minVal']
None
null
0
0
0
null
0
null
The function (makeContourSliders) defined within the public class called public.The function start at line 8567 and ends at 8651. It contains 55 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [8567.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
skimGPX
def skimGPX(fl):'''pull out fit information from a .gpx file quickly:returns: dict with status info'''if fl is None: return {}result = {'other':[]}if not os.path.exists(fl):return {'error':'File does not exist!'}cnt = 0hist = 0fp = open(fl,'rb')result['last saved'] = time.ctime(os.stat(fl).st_mtime)try:while True:cnt +...
26
63
1
467
8
8,655
8,726
8,655
null
['cnt', 'hist', 'datum', 'fp', 'note', 'result', 'data', 'd']
None
null
0
0
0
null
0
null
The function (skimGPX) defined within the public class called public.The function start at line 8655 and ends at 8726. It contains 63 lines of code and it has a cyclomatic complexity of 26. 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,startdir='.',multiple=False,*args,**kwargs):self.timer = Noneself.delay = 1500 # time to wait before applying filter (1.5 sec)self.Selection = Noneself.Selections = []self.startDir = startdirif startdir == '.':self.startDir = os.getcwd()self.multiple = multiplewx.Dialog.__init__(self, parent=pa...
4
68
6
792
0
8,746
8,820
8,746
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 8746 and ends at 8820. It contains 68 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [8746.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_startUpdateTimer
def _startUpdateTimer(self,event):if self.timer:self.timer.Restart(self.delay)else:self.timer = wx.CallLater(self.delay,self.DirSelected)
2
5
2
40
0
8,822
8,826
8,822
null
[]
None
null
0
0
0
null
0
null
The function (_startUpdateTimer) defined within the public class called public.The function start at line 8822 and ends at 8826. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [8822.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
DirSelected
def DirSelected(self,event=None,*args,**kwargs):'''Respond to a directory being selected. List files found in fileBox andclear any selections. Also clear any reference to a timer.'''import retry:if self.timer: self.timer.Stop()except:passself.timer = Noneself.fileBox.Clear()self.rtc.Clear()self.Selection = Noneself.Sel...
13
33
4
347
0
8,828
8,863
8,828
null
[]
None
null
0
0
0
null
0
null
The function (DirSelected) defined within the public class called public.The function start at line 8828 and ends at 8863. It contains 33 lines of code and it has a cyclomatic complexity of 13. It takes 4 parameters, represented as [8828.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FileSelected
def FileSelected(self,event):'''Respond to a file being selected (or checked in multiple mode)'''if self.multiple:# disableOpen when nothing is selectedself.Selections = []OK = Falsefor i in self.fileBox.GetCheckedItems():self.Selections.append(self.sl[i][2])OK = Trueself.OKbtn.Enable(OK)else:self.OKbtn.Enable(True)sel...
3
13
2
107
0
8,865
8,879
8,865
null
[]
None
null
0
0
0
null
0
null
The function (FileSelected) defined within the public class called public.The function start at line 8865 and ends at 8879. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [8865.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
displayGPXrtc
def displayGPXrtc(self,result,fwp):'''Show info about selected file in a RichText display'''self.rtc.Clear()if fwp is None: returnself.rtc.Freeze()self.rtc.BeginSuppressUndo()self.rtc.BeginAlignment(wx.TEXT_ALIGNMENT_CENTER)self.rtc.BeginFontSize(14)self.rtc.BeginBold()self.rtc.WriteText(os.path.split(fwp)[1])self.rtc....
10
63
3
520
0
8,881
8,946
8,881
null
[]
None
null
0
0
0
null
0
null
The function (displayGPXrtc) defined within the public class called public.The function start at line 8881 and ends at 8946. It contains 63 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [8881.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_fmtTimeStampDelta
def _fmtTimeStampDelta(self,tm):'Show file age relative to now'delta = time.time() - tmif delta > 60*60*24*365:return "{:.2f} years".format(delta/(60*60*24*365))elif delta > 60*60*24*7:return "{:.1f} weeks".format(delta/(60*60*24*7))elif delta > 60*60*24:return "{:.1f} days".format(delta/(60*60*24))elif delta > 60*60:r...
5
13
2
128
0
8,948
8,960
8,948
null
[]
None
null
0
0
0
null
0
null
The function (_fmtTimeStampDelta) defined within the public class called public.The function start at line 8948 and ends at 8960. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [8948.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
setColorButton.OnColor
def OnColor(event):array[key] = list(event.GetValue())[:3]if callback: callback(*callbackArgs)
2
3
1
30
0
8,967
8,969
8,967
null
[]
None
null
0
0
0
null
0
null
The function (setColorButton.OnColor) defined within the public class called public.The function start at line 8967 and ends at 8969. It contains 3 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
setColorButton.onSetColour
def onSetColour(event):dlg = wx.ColourDialog(parent.GetTopLevelParent())try:dlg.GetColourData().SetChooseFull(True)dlg.GetColourData().SetColour(array[key])if dlg.ShowModal() == wx.ID_OK:data = dlg.GetColourData()array[key] = data.GetColour().Get()print('OK',array[key])finally:dlg.Destroy()
3
11
1
90
0
8,970
8,980
8,970
null
[]
None
null
0
0
0
null
0
null
The function (setColorButton.onSetColour) defined within the public class called public.The function start at line 8970 and ends at 8980. It contains 11 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
setColorButton
def setColorButton(parent,array,key,callback=None,callbackArgs=[]):'''Define a button for setting colorsThis bypasses the bug in wx4.1.x in ColourSelect'''import wx.lib.colourselect as wcsdef OnColor(event):array[key] = list(event.GetValue())[:3]if callback: callback(*callbackArgs)def onSetColour(event):dlg = wx.Colour...
2
11
5
105
3
8,962
8,987
8,962
null
['colorButton', 'data', 'dlg']
None
null
0
0
0
null
0
null
The function (setColorButton) defined within the public class called public.The function start at line 8962 and ends at 8987. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [8962.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SaveCite
def SaveCite(prog,text):'''Save citation information as it is referenced so that all of it can bedisplayed in the About GSAS-II window'''global CitationDictCitationDict[prog] = text
1
3
2
16
0
8,990
8,995
8,990
null
[]
None
null
0
0
0
null
0
null
The function (SaveCite) defined within the public class called public.The function start at line 8990 and ends at 8995. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [8990.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetCite
def GetCite(key,wrap=None,indent=None):'''Return citation information, optionally with text wrapping.'''if GSASIIpath.GetConfigValue('debug') and key not in CitationDict:print(f'Warning: GetCite citation ref {key!r} not defined.')txt = CitationDict.get(key,'')leftmargin = ''if indent:leftmargin=indent*' 'if wrap:import...
5
14
3
91
2
8,997
9,012
8,997
null
['leftmargin', 'txt']
None
null
0
0
0
null
0
null
The function (GetCite) defined within the public class called public.The function start at line 8997 and ends at 9012. It contains 14 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [8997.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
NISTlatUse
def NISTlatUse(msgonly=False):msg = f'Performing cell symmetry search using NIST*LATTICE.\n\nPlease cite: {GetCite("NIST*LATTICE")}'print(msg)if msgonly: return msgwx.MessageBox(msg,caption='Using NIST*LATTICE',style=wx.ICON_INFORMATION)
2
5
1
36
1
9,056
9,060
9,056
null
['msg']
None
null
0
0
0
null
0
null
The function (NISTlatUse) defined within the public class called public.The function start at line 9056 and ends at 9060. It contains 5 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
Load2Cells.setRatioMax
def setRatioMax(*arg,**kwarg):'''Set the value for the max volume used in the search accordingto the type of search selected.'''if nistInput[2] == 'I':volRatW.Validator.xmax = 40volMaxLbl.SetLabel(' (ratio, 1 to 40)')else:volRatW.Validator.xmax = 10volMaxLbl.SetLabel(' (ratio, 1 to 10)')volRatW.SetValue(min(volRatW.Val...
2
8
2
64
0
9,074
9,084
9,074
null
[]
None
null
0
0
0
null
0
null
The function (Load2Cells.setRatioMax) defined within the public class called public.The function start at line 9074 and ends at 9084. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [9074.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Load2Cells.computeNISTlatCompare
def computeNISTlatCompare(event):'run NIST*LATTICE after the compute button is pressed'from . import nistlatout = nistlat.CompareCell(cellLen[0], cellCntr[0],cellLen[1], cellCntr[1],tolerance=3*[nistInput[0]]+3*[nistInput[1]],mode=nistInput[2], vrange=nistInput[3])if len(out):msg = str(len(out))+' Transformations were ...
3
17
1
151
0
9,085
9,101
9,085
null
[]
None
null
0
0
0
null
0
null
The function (Load2Cells.computeNISTlatCompare) defined within the public class called public.The function start at line 9085 and ends at 9101. It contains 17 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..