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
Load2Cells.setCellFromPhase
def setCellFromPhase(event):'''respond to "set from phase" button. A phase is selected andthe unit cell info is loaded from that phase into the appropriatecell widgets.'''cell = event.GetEventObject().cellNumwidgets = event.GetEventObject().widgetsphaseList = list(Phases.keys())if len(Phases) == 0:print('No phases in p...
6
27
1
200
0
9,102
9,132
9,102
null
[]
None
null
0
0
0
null
0
null
The function (Load2Cells.setCellFromPhase) defined within the public class called public.The function start at line 9102 and ends at 9132. It contains 27 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
Load2Cells
def Load2Cells(G2frame,phase):'''Accept two unit cells and use NIST*LATTICE to search for a relationshipthat relates them.The first unit cell is initialized as the currently selected phase andthe second unit cell is set to the first different phase from the tree.The user can initialize the cell parameters to select a d...
8
95
2
1,076
21
9,062
9,229
9,062
null
['l', 'phaseList', 'sizer', 'volMaxLbl', 'cell', 'p', 'msg', 'cellCntr', 'tableSizer', 'dlg', 'w', 'out', 'ph2', 'btn', 'btnsizer', 'cellLen', 'nistInput', 'btnSizer', 'widgets', 'wlist', 'volRatW']
None
null
0
0
0
null
0
null
The function (Load2Cells) defined within the public class called public.The function start at line 9062 and ends at 9229. It contains 95 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [9062.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent, label='', delay=100, lbllen=15, dots=True, **kwargs):wx.StaticText.__init__(self, parent, wx.ID_ANY, '', **kwargs)self.fullmsg = labelself.lbllen = lbllenself.msgpos = 0self.dots = dotsself.onTimer(None)self.timer = wx.Timer(self)self.Bind(wx.EVT_TIMER, self.onTimer)self.timer.Start(delay, wx...
1
11
7
105
0
9,261
9,271
9,261
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 9261 and ends at 9271. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [9261.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onTimer
def onTimer(self,event):if self.dots and self.msgpos > 0:txt = '...'else:txt = ''txt += self.fullmsg[self.msgpos:self.msgpos+self.lbllen+1]if self.dots and self.msgpos+self.lbllen < len(self.fullmsg):txt += '...'try:self.SetLabel(txt)except:self.timer.Stop()self.msgpos += 1if self.msgpos >= len(self.fullmsg): self.msgp...
7
14
2
108
0
9,273
9,286
9,273
null
[]
None
null
0
0
0
null
0
null
The function (onTimer) defined within the public class called public.The function start at line 9273 and ends at 9286. It contains 14 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [9273.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExtractFileFromZip
def ExtractFileFromZip(filename, selection=None, confirmread=True, confirmoverwrite=True, parent=None, multipleselect=False,msg=''):'''If the filename is a zip file, extract a file from thatarchive.:param list selection: used to predefine the name of the fileto be extracted. Filename case and zip directory name areigno...
26
88
7
605
13
9,289
9,413
9,289
null
['zlist', 'outfile', 'fpin', 'zinfo', 'fpout', 'zloc', 'efil', 'dlg', 'result', 'z', 'zindex', 'outlist', 'choices']
None
null
0
0
0
null
0
null
The function (ExtractFileFromZip) defined within the public class called public.The function start at line 9289 and ends at 9413. It contains 88 lines of code and it has a cyclomatic complexity of 26. It takes 7 parameters, represented as [9289.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
askQuestion
def askQuestion(parent,question,title):'''Simple code to ask a Y/N question and get answer'''ans = Truetry:dlg = wx.MessageDialog(parent,question,title,wx.YES_NO | wx.ICON_QUESTION)ans = (dlg.ShowModal() == wx.ID_YES)finally:dlg.Destroy()return ans
2
8
3
57
2
9,415
9,423
9,415
null
['ans', 'dlg']
None
null
0
0
0
null
0
null
The function (askQuestion) defined within the public class called public.The function start at line 9415 and ends at 9423. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [9415.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
haveGUI
def haveGUI():'''Test if there is a GUI that can be accessed:returns: True if a GUI is available'''try:return wx.App.IsMainLoopRunning()except:return False
2
5
0
19
0
9,425
9,432
9,425
null
[]
None
null
0
0
0
null
0
null
The function (haveGUI) defined within the public class called public.The function start at line 9425 and ends at 9432. 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
gitFetch
def gitFetch(G2frame):wx.BeginBusyCursor()pdlg = wx.ProgressDialog('Updating','Performing git update',11,style = wx.PD_ELAPSED_TIME|wx.PD_CAN_ABORT,parent=G2frame)try:pdlg.CenterOnParent()if hasattr(G2frame,'UpdateTask'): # check if git update has completedcount = 0while G2frame.UpdateTask.poll() is None:count += 1if c...
8
28
1
154
2
9,435
9,464
9,435
null
['count', 'pdlg']
None
null
0
0
0
null
0
null
The function (gitFetch) defined within the public class called public.The function start at line 9435 and ends at 9464. It contains 28 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
gitCheckUpdates
def gitCheckUpdates(G2frame):'''Used to update to the latest GSAS-II version, but checks for a varietyof repository conditions that could make this process more complex. Ifthere are uncommitted local changes, these changes must be cached ordeleted first. If there are local changes that have been committed or a newbranc...
17
87
1
450
9
9,466
9,571
9,466
null
['regressmsg', 'cmds', 'status', 'now', 'dlg', 'localChanges', 'ans', 'g2repo', 'msg']
None
null
0
0
0
null
0
null
The function (gitCheckUpdates) defined within the public class called public.The function start at line 9466 and ends at 9571. It contains 87 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
gitAskLocalChanges
def gitAskLocalChanges(G2frame,cmds):msg = ('You have locally-made changes to the GSAS-II source '+'code files. Do you want to discard these changes?\n\n'+'If you select "Yes" the changes will be overwritten '+'before the update.\nIf you select "No" the changes will '+'be archived (git stash).\nSelect "Cancel" '+' to d...
3
18
2
96
3
9,573
9,590
9,573
null
['ans', 'msg', 'dlg']
None
null
0
0
0
null
0
null
The function (gitAskLocalChanges) defined within the public class called public.The function start at line 9573 and ends at 9590. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [9573.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
gitAskSave
def gitAskSave(G2frame,regressmsg,cmds):# before doing update, need to save projectmsg = ('Before continuing, do you want to save your project? '+ 'Select "Yes" to save, "No" to skip the save, or "Cancel"'+ ' to discontinue the update process.\n\n'+ 'If "Yes", GSAS-II will reopen the project after the update. '+ 'The u...
4
18
3
104
3
9,592
9,610
9,592
null
['ans', 'msg', 'dlg']
None
null
0
0
0
null
0
null
The function (gitAskSave) defined within the public class called public.The function start at line 9592 and ends at 9610. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [9592.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
gitSelectVersion
def gitSelectVersion(G2frame):'''Used to regress to a previous GSAS-II version, checking firstfor a variety of repository conditions that could make this processmore complex. If there are uncommitted local changes, these changesmust be cached or deleted before a different version can be installed.If there are local cha...
14
66
1
315
8
9,612
9,700
9,612
null
['regressmsg', 'githash', 'cmds', 'status', 'dlg', 'localChanges', 'ans', 'msg']
None
null
0
0
0
null
0
null
The function (gitSelectVersion) defined within the public class called public.The function start at line 9612 and ends at 9700. It contains 66 lines of code and it has a cyclomatic complexity of 14. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
gitSelectBranch
def gitSelectBranch(event):'''Pull in latest GSAS-II branches on origin server; Allow user toselect a branch; checkout that branch and restart GSAS-II.Expected to be used by developers and by expert users only.'''G2frame = wx.App.GetMainTopWindow()gitInst = GSASIIpath.HowIsG2Installed()if not gitInst.startswith('github...
22
79
1
523
12
9,702
9,801
9,702
null
['path2repo', 'ans', 'a', 'b', 'msg', 'branchlist', 'dlg', 'project', 'gitInst', 'g2repo', 'G2frame', 'choices']
None
null
0
0
0
null
0
null
The function (gitSelectBranch) defined within the public class called public.The function start at line 9702 and ends at 9801. It contains 79 lines of code and it has a cyclomatic complexity of 22. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
gitSwitchMaster2Main
def gitSwitchMaster2Main():'''This is "patch" code to switch from the master branchto the main branch. At some point this will be made part of theupdate process in the master branch. This routine is not needed in the main branch.Switching is a bit complicated as additional Python packages are neededand becuase the GSAS...
34
153
0
1,008
18
9,803
10,018
9,803
null
['path2repo', 'G2frame', 'ans', 'RunOptPackages', 'script', 'g2script', 'pkgnames', 'NewReqPackages', 'a', 'b', 'branchlist', 'install', 'project', 'dlg', 'gitInst', 'g2repo', 'msg', 'choices']
None
null
0
0
0
null
0
null
The function (gitSwitchMaster2Main) defined within the public class called public.The function start at line 9803 and ends at 10018. It contains 153 lines of code and it has a cyclomatic complexity of 34. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImportMsg
def ImportMsg(parent,msgs):'''Show a message with the warnings from importers thatcould not be installed (due to uninstalled Python packages). Thenoffer the chance to install GSAS-II packages using :func:`SelectPkgInstall`'''text = ('Warnings message(s) from load of importers:\n\n * '+'\n\n * '.join(msgs)+'\n\n\tTo use...
1
9
2
50
1
10,022
10,034
10,022
null
['text']
None
null
0
0
0
null
0
null
The function (ImportMsg) defined within the public class called public.The function start at line 10022 and ends at 10034. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [10022.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
patch_condarc
def patch_condarc():'''Comment out any references to "file:" locations in the .condarcfile. These should not be there and cause problems.'''rc = os.path.normpath(os.path.join(GSASIIpath.path2GSAS2,'..','..','.condarc'))if os.path.exists(rc):txt = open(rc,'r').read()else:returnif '\n- /' in txt:print(f'Patching file {rc...
3
10
0
88
2
10,036
10,049
10,036
null
['txt', 'rc']
None
null
0
0
0
null
0
null
The function (patch_condarc) defined within the public class called public.The function start at line 10036 and ends at 10049. It contains 10 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
SelectPkgInstall
def SelectPkgInstall(event):'''Offer the user a chance to install Python packages needed by one ormore importers. There might be times where something like this will beuseful for other GSAS-II actions.'''dlg = event.GetEventObject().GetParent()if hasattr(dlg,'EndModal'): # present when called from a dialogdlg.EndModal(...
18
73
1
409
11
10,051
10,128
10,051
null
['pkgs', 'G2frame', 'err', 'keylist', 'pdlg', 'sel', 'dlg', 'project', 'ans', 'msg', 'choices']
None
null
0
0
0
null
0
null
The function (SelectPkgInstall) defined within the public class called public.The function start at line 10051 and ends at 10128. It contains 73 lines of code and it has a cyclomatic complexity of 18. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
strTest
def strTest(text):if '.' in text: # no decimalsreturn Falseelif text.strip() in[' ','0','1','-1','3/2']: # specialsreturn Trueelif '/' in text: #process fractionnums = text.split('/')return (0 < int(nums[1]) < 10) and (0 < abs(int(nums[0])) < int(nums[1]))return False
5
9
1
85
0
10,159
10,167
10,159
null
[]
None
null
0
0
0
null
0
null
The function (strTest) defined within the public class called public.The function start at line 10159 and ends at 10167. It contains 9 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
new_util_find_library
def new_util_find_library( name ):res = orig_util_find_library( name )if res: return resreturn '/System/Library/Frameworks/'+name+'.framework/'+name
2
4
1
24
0
29
32
29
null
[]
None
null
0
0
0
null
0
null
The function (new_util_find_library) defined within the public class called public.The function start at line 29 and ends at 32. 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
GetDisplay
def GetDisplay(pos):'''Gets display number (0=main display) for window position (pos). If pos outside all displaysreturns None'''displays = np.array([list(wx.Display(i).GetGeometry()) for i in range(wx.Display.GetCount())])for ip,display in enumerate(displays):display[2:3] += display[0:1]if (display[0] < pos[0] < displ...
5
7
1
103
1
102
111
102
null
['displays']
None
null
0
0
0
null
0
null
The function (GetDisplay) defined within the public class called public.The function start at line 102 and ends at 111. It contains 7 lines of code and it has a cyclomatic complexity of 5. 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,data):wx.Dialog.__init__(self,parent,wx.ID_ANY,'Setup HKLF merge',pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)self.panel = wx.Panel(self) #just a dummy - gets destroyed in Draw!self.data = dataself.Super = data[1]['Super']if self.Super:self.Trans = np.eye(4)else:self.Trans = np.eye(3)s...
2
17
3
131
0
122
138
122
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 122 and ends at 138. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [122.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Draw.OnCent
def OnCent(event):Obj = event.GetEventObject()self.Cent = Obj.GetValue()self.Laue = ''wx.CallAfter(self.Draw)
1
5
1
34
0
142
146
142
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnCent) defined within the public class called public.The function start at line 142 and ends at 146. 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
Draw.OnLaue
def OnLaue(event):Obj = event.GetEventObject()self.Laue = Obj.GetValue()wx.CallAfter(self.Draw)
1
4
1
29
0
148
151
148
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnLaue) defined within the public class called public.The function start at line 148 and ends at 151. 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
Draw.OnClass
def OnClass(event):Obj = event.GetEventObject()self.Class = Obj.GetValue()self.Laue = ''wx.CallAfter(self.Draw)
1
5
1
34
0
153
157
153
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnClass) defined within the public class called public.The function start at line 153 and ends at 157. 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
Draw.OnCommon
def OnCommon(event):Obj = event.GetEventObject()self.Common = Obj.GetValue()self.Trans = commonTrans[self.Common]wx.CallAfter(self.Draw)
1
5
1
39
0
159
163
159
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnCommon) defined within the public class called public.The function start at line 159 and ends at 163. 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
Draw.OnSmart
def OnSmart(event):self.Smart = not self.Smart
1
2
1
13
0
165
166
165
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnSmart) defined within the public class called public.The function start at line 165 and ends at 166. 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
Draw
def Draw(self):def OnCent(event):Obj = event.GetEventObject()self.Cent = Obj.GetValue()self.Laue = ''wx.CallAfter(self.Draw)def OnLaue(event):Obj = event.GetEventObject()self.Laue = Obj.GetValue()wx.CallAfter(self.Draw)def OnClass(event):Obj = event.GetEventObject()self.Class = Obj.GetValue()self.Laue = ''wx.CallAfter(...
7
80
1
942
0
140
243
140
null
[]
None
null
0
0
0
null
0
null
The function (Draw) defined within the public class called public.The function start at line 140 and ends at 243. It contains 80 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
GetSelection
def GetSelection(self):return self.Trans,self.Cent,self.Laue,self.Smart
1
2
1
21
0
245
246
245
null
[]
None
null
0
0
0
null
0
null
The function (GetSelection) defined within the public class called public.The function start at line 245 and ends at 246. 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
OnOk
def OnOk(self,event):parent = self.GetParent()if parent is not None: parent.Raise()self.EndModal(wx.ID_OK)
2
4
2
33
0
248
251
248
null
[]
None
null
0
0
0
null
0
null
The function (OnOk) defined within the public class called public.The function start at line 248 and ends at 251. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [248.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.EndModal(wx.ID_CANCEL)
2
4
2
33
0
253
256
253
null
[]
None
null
0
0
0
null
0
null
The function (OnCancel) defined within the public class called public.The function start at line 253 and ends at 256. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [253.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GUIpatches
def GUIpatches():'Misc fixes that only needs to be done when running a GUI'try:# patch for LANG environment var problem on occasional OSX machinesimport localelocale.getdefaultlocale()except ValueError:print('Fixing location (see https://github.com/matplotlib/matplotlib/issues/5420.)')os.environ['LC_ALL'] = 'en_US.UTF-...
2
10
0
41
0
258
270
258
null
[]
None
null
0
0
0
null
0
null
The function (GUIpatches) defined within the public class called public.The function start at line 258 and ends at 270. 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
convVersion
def convVersion(version):'''Convert a version string ("x", "x.y", "x.y.z") into a series of ints.:returns: [i0, i1, i2] where None is used if a value is not specified and 0 is used if a field cannot be parsed.'''vIntList = [None,None,None]for i,v in enumerate(version.split('.')):if i >= 3: breakif len(v) == 0: breakv =...
5
11
1
87
2
272
287
272
null
['v', 'vIntList']
None
null
0
0
0
null
0
null
The function (convVersion) defined within the public class called public.The function start at line 272 and ends at 287. It contains 11 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
compareVersions
def compareVersions(version1,version2):'''Compare two version strings ("x", "x.y", "x.y.z")Note that '3.' matches '3.1', and '3.0' matches '3.0.1'but '3.0.0' does not match '3.0.1':returns: 0 if the versions match, -1 if version1 < version2, or 1 if version1 > version2'''for v1,v2 in zip(convVersion(version1),convVersi...
6
7
2
54
0
289
302
289
null
[]
None
null
0
0
0
null
0
null
The function (compareVersions) defined within the public class called public.The function start at line 289 and ends at 302. It contains 7 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [289.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowVersions
def ShowVersions():'''Show the versions of all GUI-required Python packages, etc.'''import numpy as npimport scipy as spimport wximport matplotlib as mplimport OpenGL as oglpkgList = [('Python',None), ('wx',wx), ('matplotlib', mpl), ('numpy',np), ('scipy',sp), ('OpenGL',ogl)]if GSASIIpath.GetConfigValue('debug'):try:im...
44
159
0
854
14
377
549
377
null
['path2repo', 'prefix', 'installLoc', 'pkgver', 'pkgList', 'warn', 'version', 'prog', 'binarydir', 'dlg', 'match', 'result', 'Image', 'msg']
None
null
0
0
0
null
0
null
The function (ShowVersions) defined within the public class called public.The function start at line 377 and ends at 549. It contains 159 lines of code and it has a cyclomatic complexity of 44. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
TestOldVersions
def TestOldVersions():'''Test the versions of required Python packages, etc.Returns a non-empty text string if there are problems.'''import numpy as npimport scipy as spimport wximport matplotlib as mplimport OpenGL as oglwarnmsg = ''errmsg = ''for s,m in [('Python',None), ('wx',wx), ('matplotlib', mpl), ('numpy',np),(...
13
33
0
241
5
551
586
551
null
['prefix', 'pkgver', 'warnmsg', 'match', 'errmsg']
None
null
0
0
0
null
0
null
The function (TestOldVersions) defined within the public class called public.The function start at line 551 and ends at 586. It contains 33 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
GSASIImain
def GSASIImain(application):'''Start up the GSAS-II GUI'''ShowVersions()GUIpatches()if versionDict['errors']:msg = ('\n\nGSAS-II will attempt to start, but this problem needs '+'to be fixed for proper operation. Usually, the simplest solution '+'will be to reinstall GSAS-II.'+'\nSee https://GSASII.github.io')dlg = wx.M...
10
38
1
260
2
589
632
589
null
['msg', 'dlg']
None
null
0
0
0
null
0
null
The function (GSASIImain) defined within the public class called public.The function start at line 589 and ends at 632. It contains 38 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_FileMenuItems.OnwxInspect
def OnwxInspect(event):import wx.lib.inspection as wxeyewxeye.InspectionTool().Show()
1
3
1
22
0
671
673
671
null
[]
None
null
0
0
0
null
0
null
The function (_Add_FileMenuItems.OnwxInspect) defined within the public class called public.The function start at line 671 and ends at 673. 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
_Add_FileMenuItems
def _Add_FileMenuItems(self, parent):'''Add items to File menu'''item = parent.Append(wx.ID_ANY,'&Open project...\tCtrl+O','Open a GSAS-II project (.gpx) file')self.Bind(wx.EVT_MENU, self.OnFileOpen, id=item.GetId())# if sys.platform == "darwin":item = parent.Append(wx.ID_ANY,'&Open in new window...','Open a GSAS-II pr...
4
39
2
465
0
641
687
641
null
[]
None
null
0
0
0
null
0
null
The function (_Add_FileMenuItems) defined within the public class called public.The function start at line 641 and ends at 687. It contains 39 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [641.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_DataMenuItems
def _Add_DataMenuItems(self,parent):'''Add items to Data menu'''#(7/2025) next duplicated in Import menu; patch: remove this somedayitem = parent.Append(wx.ID_ANY,'Read Powder Pattern Peaks...','')self.Bind(wx.EVT_MENU, self.OnReadPowderPeaks, id=item.GetId())item = parent.Append(wx.ID_ANY,'Sum or Average powder data',...
4
38
2
478
0
689
729
689
null
[]
None
null
0
0
0
null
0
null
The function (_Add_DataMenuItems) defined within the public class called public.The function start at line 689 and ends at 729. It contains 38 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [689.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_CalculateMenuItems
def _Add_CalculateMenuItems(self,parent):'''Add items to the Calculate menu'''item = parent.Append(wx.ID_ANY,'Setup PDFs','Create PDF tree entries for selected powder patterns')self.MakePDF.append(item)self.Bind(wx.EVT_MENU, self.OnMakePDFs, id=item.GetId())item = parent.Append(wx.ID_ANY,'&View LS parms\tCTRL+L','View ...
2
30
2
409
0
731
766
731
null
[]
None
null
0
0
0
null
0
null
The function (_Add_CalculateMenuItems) defined within the public class called public.The function start at line 731 and ends at 766. It contains 30 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [731.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_Imports
def _init_Imports(self):'''import all the G2phase*.py & G2sfact*.py & G2pwd*.py files thatare found in the path'''self.ImportPhaseReaderlist = G2fil.LoadImportRoutines('phase','Phase')self.ImportSfactReaderlist = G2fil.LoadImportRoutines('sfact','Struct_Factor')self.ImportPowderReaderlist = G2fil.LoadImportRoutines('pw...
2
13
1
113
0
773
789
773
null
[]
None
null
0
0
0
null
0
null
The function (_init_Imports) defined within the public class called public.The function start at line 773 and ends at 789. It contains 13 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
testSeqRefineMode
def testSeqRefineMode(self):'''Returns the list of histograms included in a sequential refinement oran empty list if a standard (non-sequential) refinement.Also sets Menu item status depending on mode'''cId = GetGPXtreeItemId(self,self.root, 'Controls')if cId:controls = self.GPXtree.GetItemPyData(cId)seqSetting = contr...
9
23
1
143
0
791
818
791
null
[]
None
null
0
0
0
null
0
null
The function (testSeqRefineMode) defined within the public class called public.The function start at line 791 and ends at 818. It contains 23 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
PreviewFile
def PreviewFile(self,filename):'utility to confirm we have the right file'fp = open(filename,'r')rdmsg = u'File '+ filename +u' begins:\n\n'try:rdmsg += fp.read(80)rdmsg += '\n\nDo you want to read this file?'except UnicodeDecodeError:rdmsg = Nonefp.close()if rdmsg is None or not all([ord(c) < 128 and ord(c) != 0 for c...
8
21
2
149
0
820
842
820
null
[]
None
null
0
0
0
null
0
null
The function (PreviewFile) defined within the public class called public.The function start at line 820 and ends at 842. It contains 21 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [820.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportGeneric
def OnImportGeneric(self,reader,readerlist,label,multiple=False,usedRanIdList=[],Preview=True,load2Tree=False):'''Used for all imports, including Phases, datasets, images...Called from :meth:`GSASII.OnImportPhase`, :meth:`GSASII.OnImportImage`,:meth:`GSASII.OnImportSfact`, :meth:`GSASII.OnImportPowder`,:meth:`GSASII.On...
58
186
8
1,226
0
844
1,099
844
null
[]
None
null
0
0
0
null
0
null
The function (OnImportGeneric) defined within the public class called public.The function start at line 844 and ends at 1099. It contains 186 lines of code and it has a cyclomatic complexity of 58. It takes 8 parameters, represented as [844.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_Phase
def _Add_ImportMenu_Phase(self,parent):'''configure the Import Phase menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'Phase','Import phase data')for reader in self.ImportPhaseReaderlist:item = submenu.Append(wx.ID_ANY,readFromFile(reader),reader.longFormatName...
2
9
2
119
0
1,101
1,111
1,101
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_Phase) defined within the public class called public.The function start at line 1101 and ends at 1111. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1101.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportPhase
def OnImportPhase(self,event):'''Called in response to an Import/Phase/... menu itemto read phase information.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all appropriate formats will be tried....
44
142
2
1,179
0
1,113
1,286
1,113
null
[]
None
null
0
0
0
null
0
null
The function (OnImportPhase) defined within the public class called public.The function start at line 1113 and ends at 1286. It contains 142 lines of code and it has a cyclomatic complexity of 44. It takes 2 parameters, represented as [1113.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_Image
def _Add_ImportMenu_Image(self,parent):'''configure the Import Image menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu, 'Image','Import image file')for reader in self.ImportImageReaderlist:item = submenu.Append(wx.ID_ANY,readFromFile(reader),reader.longFormatNam...
2
9
2
119
0
1,288
1,298
1,288
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_Image) defined within the public class called public.The function start at line 1288 and ends at 1298. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1288.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportImage
def OnImportImage(self,event):'''Called in response to an Import/Image/... menu itemto read an image from a file. Like all the other imports,dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all app...
2
7
2
73
0
1,300
1,316
1,300
null
[]
None
null
0
0
0
null
0
null
The function (OnImportImage) defined within the public class called public.The function start at line 1300 and ends at 1316. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1300.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_Sfact
def _Add_ImportMenu_Sfact(self,parent):'''configure the Import Structure Factor menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'Structure Factor','Import Structure Factor data')for reader in self.ImportSfactReaderlist:item = submenu.Append(wx.ID_ANY,readFromF...
2
9
2
119
0
1,318
1,328
1,318
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_Sfact) defined within the public class called public.The function start at line 1318 and ends at 1328. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1318.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportSfact
def OnImportSfact(self,event):'''Called in response to an Import/Structure Factor/... menu itemto read single crystal datasets.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all appropriate forma...
21
85
2
783
0
1,330
1,429
1,330
null
[]
None
null
0
0
0
null
0
null
The function (OnImportSfact) defined within the public class called public.The function start at line 1330 and ends at 1429. It contains 85 lines of code and it has a cyclomatic complexity of 21. It takes 2 parameters, represented as [1330.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_powder.OnAutoImport
def OnAutoImport(event):G2G.AutoLoadFiles(self,FileTyp='pwd')
1
2
1
15
0
1,434
1,435
1,434
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_powder.OnAutoImport) defined within the public class called public.The function start at line 1434 and ends at 1435. 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
_Add_ImportMenu_powder
def _Add_ImportMenu_powder(self,parent):'''configure the Powder Data menus accord to the readers found in _init_Imports'''def OnAutoImport(event):G2G.AutoLoadFiles(self,FileTyp='pwd')submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'Powder Data','Import Powder data')for reader in self.ImportPowderReaderlist:item ...
2
17
2
226
0
1,431
1,452
1,431
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_powder) defined within the public class called public.The function start at line 1431 and ends at 1452. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1431.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OpenPowderInstprm
def OpenPowderInstprm(self,instfile):'''Read a GSAS-II (new) instrument parameter file:param str instfile: name of instrument parameter file'''File = open(instfile,'r')lines = File.readlines()File.close()return lines
1
5
2
30
0
1,454
1,463
1,454
null
[]
None
null
0
0
0
null
0
null
The function (OpenPowderInstprm) defined within the public class called public.The function start at line 1454 and ends at 1463. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1454.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadPowderInstprm
def ReadPowderInstprm(self, instLines, bank, rd):'''Read contents of a GSAS-II (new) .instprm instrument parameter filesimilar to G2pwdGUI.OnLoad. Uses :func:`GSASIIfiles.ReadInstprm`to actually read the file.If instprm file has multiple banks (where each has header #Bank n: ...,and bank is supplied as None here, this ...
8
16
4
144
0
1,465
1,499
1,465
null
[]
None
null
0
0
0
null
0
null
The function (ReadPowderInstprm) defined within the public class called public.The function start at line 1465 and ends at 1499. It contains 16 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [1465.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadPowderIparm
def ReadPowderIparm(self,instfile,bank,databanks,rd):'''Read a GSAS (old) instrument parameter file:param str instfile: name of instrument parameter file:param int bank: the bank number read in the raw data file:param int databanks: the number of banks in the raw data file.If the number of banks in the data and instrum...
16
42
5
321
0
1,501
1,557
1,501
null
[]
None
null
0
0
0
null
0
null
The function (ReadPowderIparm) defined within the public class called public.The function start at line 1501 and ends at 1557. It contains 42 lines of code and it has a cyclomatic complexity of 16. It takes 5 parameters, represented as [1501.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetPowderIparm.GetDefaultParms
def GetDefaultParms(self,rd):'''Solicits from user a default set of parameters & returns Inst parm dictparam: self: refers to the GSASII main classparam: rd: importer data structurereturns: dict: Instrument parameter dictionary'''sind = lambda x: math.sin(x*math.pi/180.)tand = lambda x: math.tan(x*math.pi/180.)while Tr...
7
29
2
326
0
1,576
1,624
1,576
null
[]
None
null
0
0
0
null
0
null
The function (GetPowderIparm.GetDefaultParms) defined within the public class called public.The function start at line 1576 and ends at 1624. It contains 29 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [1576.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetPowderIparm
def GetPowderIparm(self,rd, prevIparm, lastIparmfile, lastdatafile):'''Open and read an instrument parameter file for a data fileReturns the list of parameters used in the data tree:param obj rd: the raw data (histogram) data object.:param str prevIparm: not used:param str lastIparmfile: Name of last instrument paramet...
30
112
5
793
0
1,559
1,752
1,559
null
[]
None
null
0
0
0
null
0
null
The function (GetPowderIparm) defined within the public class called public.The function start at line 1559 and ends at 1752. It contains 112 lines of code and it has a cyclomatic complexity of 30. It takes 5 parameters, represented as [1559.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
EnableRefineCommand
def EnableRefineCommand(self):'''Check that phases are connected to histograms - if so thenData/Remove Histogram is enabled'''if callable(self.dataWindow.DataGeneral): # will fail w/o Phase menusself.dataWindow.DataGeneral()haveData = Falsesub = GetGPXtreeItemId(self,self.root,'Phases')if sub:item, cookie = self.GPXtre...
8
20
1
152
0
1,754
1,776
1,754
null
[]
None
null
0
0
0
null
0
null
The function (EnableRefineCommand) defined within the public class called public.The function start at line 1754 and ends at 1776. It contains 20 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
OnImportPowder
def OnImportPowder(self,event):'''Called in response to an Import/Powder Data/... menu itemto read a powder diffraction data set.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all appropriate for...
47
221
2
2,084
0
1,778
2,027
1,778
null
[]
None
null
0
0
0
null
0
null
The function (OnImportPowder) defined within the public class called public.The function start at line 1778 and ends at 2027. It contains 221 lines of code and it has a cyclomatic complexity of 47. It takes 2 parameters, represented as [1778.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDummyPowder
def OnDummyPowder(self,event):'''Called in response to Import/Powder Data/Simulate menu itemto create a Dummy powder diffraction data set.Reads an instrument parameter file and then gets input from the user'''# make a list of phase namesphaseRIdList,defPhases = self.GetPhaseInfofromTree()phaseNameList = list(defPhases....
31
206
2
1,812
0
2,029
2,255
2,029
null
[]
None
null
0
0
0
null
0
null
The function (OnDummyPowder) defined within the public class called public.The function start at line 2029 and ends at 2255. It contains 206 lines of code and it has a cyclomatic complexity of 31. It takes 2 parameters, represented as [2029.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AddSimulatedPowder
def AddSimulatedPowder(self,ttArr,intArr,HistName,Lam1,Lam2):'''Create a PWDR entry for a computed powder pattern'''# get a list of existing histogramsPWDRlist = []if self.GPXtree.GetCount():item, cookie = self.GPXtree.GetFirstChild(self.root)while item:name = self.GPXtree.GetItemText(item)if name.startswith('PWDR ') a...
6
87
6
842
0
2,257
2,353
2,257
null
[]
None
null
0
0
0
null
0
null
The function (AddSimulatedPowder) defined within the public class called public.The function start at line 2257 and ends at 2353. It contains 87 lines of code and it has a cyclomatic complexity of 6. It takes 6 parameters, represented as [2257.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnPreferences
def OnPreferences(self,event):'Edit the GSAS-II configuration variables'dlg = G2G.SelectConfigSetting(self)restart = Falsetry:dlg.ShowModal() == wx.ID_OKrestart = dlg.restartreload = dlg.reloadfinally:dlg.Destroy()# trigger a restart if the var description asks for thatif restart:ans = G2G.askQuestion(self,"A restart o...
9
40
2
219
0
2,355
2,396
2,355
null
[]
None
null
0
0
0
null
0
null
The function (OnPreferences) defined within the public class called public.The function start at line 2355 and ends at 2396. It contains 40 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [2355.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_smallangle
def _Add_ImportMenu_smallangle(self,parent):'''configure the Small Angle Data menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'Small Angle Data','Import small angle data')for reader in self.ImportSmallAngleReaderlist:item = submenu.Append(wx.ID_ANY,readFromFil...
2
7
2
85
0
2,398
2,406
2,398
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_smallangle) defined within the public class called public.The function start at line 2398 and ends at 2406. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2398.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportSmallAngle.GetSASDIparm
def GetSASDIparm(reader):''' Setup instrument parameters for small ang scattering data'''parm = reader.instdictIparm = {'Type':[parm['type'],parm['type'],0],'Lam':[parm['wave'],parm['wave'],0],'Azimuth':[0.,0.,0]}return Iparm,{}
1
5
1
63
0
2,422
2,428
2,422
null
[]
None
null
0
0
0
null
0
null
The function (OnImportSmallAngle.GetSASDIparm) defined within the public class called public.The function start at line 2422 and ends at 2428. 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
OnImportSmallAngle
def OnImportSmallAngle(self,event):'''Called in response to an Import/Small Angle Data/... menu itemto read a small angle diffraction data set.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all a...
8
57
2
493
0
2,412
2,489
2,412
null
[]
None
null
0
0
0
null
0
null
The function (OnImportSmallAngle) defined within the public class called public.The function start at line 2412 and ends at 2489. It contains 57 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [2412.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_reflectometry
def _Add_ImportMenu_reflectometry(self,parent):'''configure the reflectometry Data menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'Reflectometry Data','Import reflectometry data')for reader in self.ImportReflectometryReaderlist:item = submenu.Append(wx.ID_ANY...
2
7
2
85
0
2,491
2,499
2,491
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_reflectometry) defined within the public class called public.The function start at line 2491 and ends at 2499. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2491.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportReflectometry.GetREFDIparm
def GetREFDIparm(reader):''' Setup reflectometry data instrument parameters'''parm = reader.instdictIparm = {'Type':[parm['type'],parm['type'],0],'Lam':[parm['wave'],parm['wave'],0],'Azimuth':[0.,0.,0]}return Iparm,{}
1
5
1
63
0
2,515
2,521
2,515
null
[]
None
null
0
0
0
null
0
null
The function (OnImportReflectometry.GetREFDIparm) defined within the public class called public.The function start at line 2515 and ends at 2521. 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
OnImportReflectometry
def OnImportReflectometry(self,event):'''Called in response to an Import/Reflectometry Data/... menu itemto read a reflectometry data set.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all approp...
8
59
2
509
0
2,505
2,584
2,505
null
[]
None
null
0
0
0
null
0
null
The function (OnImportReflectometry) defined within the public class called public.The function start at line 2505 and ends at 2584. It contains 59 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [2505.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ImportMenu_PDF.OnAutoImport
def OnAutoImport(event):G2G.AutoLoadFiles(self,FileTyp='gr')
1
2
1
15
0
2,597
2,598
2,597
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_PDF.OnAutoImport) defined within the public class called public.The function start at line 2597 and ends at 2598. 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
_Add_ImportMenu_PDF
def _Add_ImportMenu_PDF(self,parent):'''configure the PDF Data menus accord to the readers found in _init_Imports'''submenu = wx.Menu()item = parent.AppendSubMenu(submenu,'PDF G(R) Data','Import PDF G(R) data')for reader in self.ImportPDFReaderlist:item = submenu.Append(wx.ID_ANY,readFromFile(reader),reader.longFormatN...
2
11
2
124
0
2,586
2,599
2,586
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ImportMenu_PDF) defined within the public class called public.The function start at line 2586 and ends at 2599. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2586.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnImportPDF
def OnImportPDF(self,event):'''Called in response to an Import/PDF G(R) Data/... menu itemto read a PDF G(R) data set.dict self.ImportMenuId is used to look up the specificreader item associated with the menu item, which will beNone for the last menu item, which is the "guess" optionwhere all appropriate formats will b...
8
44
2
503
0
2,605
2,660
2,605
null
[]
None
null
0
0
0
null
0
null
The function (OnImportPDF) defined within the public class called public.The function start at line 2605 and ends at 2660. It contains 44 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [2605.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AddToNotebook
def AddToNotebook(self,text,typ=None, TimeStamp=True):'''Add entry to Notebook tree item'''Id =GetGPXtreeItemId(self,self.root,'Notebook')data = self.GPXtree.GetItemPyData(Id)if TimeStamp:data.append(f'[TS] Notebook entry @ {time.ctime()}')if typ:data.append(f'[{typ}] {text}')else:data.append(f'{text}')
3
9
4
67
0
2,662
2,672
2,662
null
[]
None
null
0
0
0
null
0
null
The function (AddToNotebook) defined within the public class called public.The function start at line 2662 and ends at 2672. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [2662.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_Exports.seqMenuItemEventHandler
def seqMenuItemEventHandler(event,obj=obj,typ=lbl):'This handler has the needed exporter/type embedded'# lookup sequential tableId = GetGPXtreeItemId(self,self.root,'Sequential results')if not Id:print('Error in Seq seqMenuItemEventHandler for ',typ,'without Seq Res table')returndata = self.GPXtree.GetItemPyData(Id)G2I...
2
8
3
61
0
2,756
2,764
2,756
null
[]
None
null
0
0
0
null
0
null
The function (_init_Exports.seqMenuItemEventHandler) defined within the public class called public.The function start at line 2756 and ends at 2764. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [2756.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_Exports
def _init_Exports(self,menu):'''Find exporter routines and add them into menus'''# set up the top-level menusprojectmenu = wx.Menu()item = menu.AppendSubMenu(projectmenu,'Entire project as','Export entire project')self.ExportNonSeq.append([menu,item.Id])phasemenu = wx.Menu()item = menu.AppendSubMenu(phasemenu,'Phase as...
18
74
2
646
0
2,674
2,776
2,674
null
[]
None
null
0
0
0
null
0
null
The function (_init_Exports) defined within the public class called public.The function start at line 2674 and ends at 2776. It contains 74 lines of code and it has a cyclomatic complexity of 18. It takes 2 parameters, represented as [2674.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_Add_ExportMenuItems
def _Add_ExportMenuItems(self,parent):# item = parent.Append(# help='Select PWDR item to enable',id=wx.ID_ANY,# kind=wx.ITEM_NORMAL,# text='Export Powder Patterns...')# self.ExportPattern.append(item)# item.Enable(False)# self.Bind(wx.EVT_MENU, self.OnExportPatterns, id=item.GetId())item = parent.Append(wx.ID_ANY,'Expo...
1
15
2
187
0
2,792
2,817
2,792
null
[]
None
null
0
0
0
null
0
null
The function (_Add_ExportMenuItems) defined within the public class called public.The function start at line 2792 and ends at 2817. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2792.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FillMainMenu
def FillMainMenu(self,menubar,addhelp=True):'''Define contents of the main GSAS-II menu for the (main) data tree window.For the mac, this is also called for the data item windows as well so thatthe main menu items are data menu as well.'''File = wx.Menu(title='')menubar.Append(menu=File, title='&File')self._Add_FileMen...
3
38
3
360
0
2,819
2,895
2,819
null
[]
None
null
0
0
0
null
0
null
The function (FillMainMenu) defined within the public class called public.The function start at line 2819 and ends at 2895. It contains 38 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [2819.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_ctrls.Enable
def Enable(*args, **kwargs): passself.CancelSetLimitsMode = dummymenu()
1
2
2
17
0
2,998
2,999
2,998
null
[]
None
null
0
0
0
null
0
null
The function (_init_ctrls.Enable) defined within the public class called public.The function start at line 2998 and ends at 2999. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2998.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
init_vars
def init_vars(self):''' initialize default values for GSAS-II "global" variables (saved in main Frame, G2frame)'''self.oldFocus = Noneself.undofile = ''self.TreeItemDelete = Falseself.Weight = Falseself.IfPlot = Falseself.DDShowAll = Falseself.atmSel = ''self.PatternId = 0self.PickId = 0self.PickIdText = Noneself.PeakT...
1
67
1
362
0
3,002
3,070
3,002
null
[]
None
null
0
0
0
null
0
null
The function (init_vars) defined within the public class called public.The function start at line 3002 and ends at 3070. It contains 67 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):self.ExportLookup = {}self.exporterlist = []self._init_ctrls(parent)self.Image = wx.Image(GSASIIpath.getIconFile('gsas2.ico'),wx.BITMAP_TYPE_ICO)if "wxMSW" in wx.PlatformInfo:img = self.Image.Scale(16, 16).ConvertToBitmap()elif "wxGTK" in wx.PlatformInfo:img = self.Image.Scale(22, 22).Convert...
13
54
2
416
0
3,073
3,128
3,073
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 3073 and ends at 3128. It contains 54 lines of code and it has a cyclomatic complexity of 13. It takes 2 parameters, represented as [3073.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTreeItemsList
def GetTreeItemsList(self,item):''' returns a list of all GSAS-II tree items'''return self.GPXtree._getTreeItemsList(item)
1
2
2
17
0
3,130
3,133
3,130
null
[]
None
null
0
0
0
null
0
null
The function (GetTreeItemsList) defined within the public class called public.The function start at line 3130 and ends at 3133. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3130.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetDataSize
def SetDataSize(self):'''this routine is a placeholder until all G2frame.SetDataSize calls are replacedby G2frame.dataWindow.SetDataSize'''# TOTO: diagnostic patchprint ('G2frame.SetDataSize called rather than dataWindow.SetDataSize')G2obj.HowDidIgetHere(True)self.dataWindow.SetDataSize()
1
4
1
23
0
3,145
3,152
3,145
null
[]
None
null
0
0
0
null
0
null
The function (SetDataSize) defined within the public class called public.The function start at line 3145 and ends at 3152. 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
OnDataTreeSelChanged
def OnDataTreeSelChanged(self, event):'''Called when a data tree item is selected. May be called on item deletion as well.'''if self.TreeItemDelete:self.TreeItemDelete = Falseelse:if self.ExpandingAll:if GSASIIpath.GetConfigValue('debug'): print('Skipping Tree selection due to ExpandAll')returnpltNum = self.G2plotNB.nb...
5
12
2
85
0
3,154
3,167
3,154
null
[]
None
null
0
0
0
null
0
null
The function (OnDataTreeSelChanged) defined within the public class called public.The function start at line 3154 and ends at 3167. It contains 12 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [3154.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeItemCollapsed
def OnGPXtreeItemCollapsed(self, event):'Called when a tree item is collapsed - all children will be collapsed'self.GPXtree.CollapseAllChildren(event.GetItem())
1
3
2
20
0
3,171
3,173
3,171
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeItemCollapsed) defined within the public class called public.The function start at line 3171 and ends at 3173. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3171.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeItemExpanded
def OnGPXtreeItemExpanded(self, event):'Called when a tree item is expanded'event.Skip()
1
3
2
13
0
3,175
3,177
3,175
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeItemExpanded) defined within the public class called public.The function start at line 3175 and ends at 3177. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3175.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeItemDelete
def OnGPXtreeItemDelete(self, event):'Called when a tree item is deleted, inhibit the next tree item selection action'self.TreeItemDelete = True
1
3
2
13
0
3,179
3,181
3,179
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeItemDelete) defined within the public class called public.The function start at line 3179 and ends at 3181. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3179.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeItemActivated
def OnGPXtreeItemActivated(self, event):'Called when a tree item is activated'event.Skip()
1
3
2
13
0
3,183
3,185
3,183
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeItemActivated) defined within the public class called public.The function start at line 3183 and ends at 3185. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3183.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeBeginRDrag
def OnGPXtreeBeginRDrag(self,event):event.Allow()self.BeginDragId = event.GetItem()self.ParentId = self.GPXtree.GetItemParent(self.BeginDragId)DragText = self.GPXtree.GetItemText(self.BeginDragId)self.DragData = [[DragText,self.GPXtree.GetItemPyData(self.BeginDragId)],]item, cookie = self.GPXtree.GetFirstChild(self.Beg...
2
11
2
130
0
3,187
3,197
3,187
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeBeginRDrag) defined within the public class called public.The function start at line 3187 and ends at 3197. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [3187.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeEndDrag
def OnGPXtreeEndDrag(self,event):event.Allow()self.EndDragId = event.GetItem()try:NewParent = self.GPXtree.GetItemParent(self.EndDragId)except:self.EndDragId = self.GPXtree.GetLastChild(self.root)NewParent = self.rootif self.ParentId != NewParent:self.ErrorDialog('Drag not allowed','Wrong parent for item dragged')else:...
4
19
2
170
0
3,199
3,217
3,199
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeEndDrag) defined within the public class called public.The function start at line 3199 and ends at 3217. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [3199.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnGPXtreeKeyDown
def OnGPXtreeKeyDown(self,event): #doesn't exactly work right with Shift key down'Allows stepping through the tree with the up/down arrow keys'self.oldFocus = wx.Window.FindFocus()keyevt = event.GetKeyEvent()key = event.GetKeyCode()item = self.GPXtree.GetSelection()if type(item) is int: return # is this the toplevel in...
15
44
2
380
0
3,219
3,262
3,219
null
[]
None
null
0
0
0
null
0
null
The function (OnGPXtreeKeyDown) defined within the public class called public.The function start at line 3219 and ends at 3262. It contains 44 lines of code and it has a cyclomatic complexity of 15. It takes 2 parameters, represented as [3219.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnColMetaTest
def OnColMetaTest(self,event):'Test the .par/.*lbls pair for contents'G2imG.testColumnMetadata(self)
1
3
2
14
0
3,264
3,266
3,264
null
[]
None
null
0
0
0
null
0
null
The function (OnColMetaTest) defined within the public class called public.The function start at line 3264 and ends at 3266. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3264.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnPowderFPA
def OnPowderFPA(self,event):'Perform FPA simulation/peak fitting'# if GSASIIpath.GetConfigValue('debug'):# print('Debug: reloading G2fpa')# import imp# imp.reload(G2fpa)G2fpa.GetFPAInput(self)
1
3
2
14
0
3,268
3,274
3,268
null
[]
None
null
0
0
0
null
0
null
The function (OnPowderFPA) defined within the public class called public.The function start at line 3268 and ends at 3274. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3268.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnReadPowderPeaks
def OnReadPowderPeaks(self,event):'Bound to menu Data/Read Powder Peaks'self.CheckNotebook()pth = G2G.GetImportPath(self)if not pth: pth = '.'dlg = wx.FileDialog(self, 'Choose file with peak list', pth, '','peak files (*.txt)|*.txt|All files (*.*)|*.*',wx.FD_MULTIPLE)try:if dlg.ShowModal() == wx.ID_OK:for file_ajk in d...
5
29
2
334
0
3,276
3,304
3,276
null
[]
None
null
0
0
0
null
0
null
The function (OnReadPowderPeaks) defined within the public class called public.The function start at line 3276 and ends at 3304. It contains 29 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [3276.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CheckNotebook
def CheckNotebook(self):'''Make sure the data tree has the minimally expected controls.'''new = Falseif not GetGPXtreeItemId(self,self.root,'Notebook'):new = Truesub = self.GPXtree.AppendItem(parent=self.root,text='Notebook')self.GPXtree.SetItemPyData(sub,[''])if not GetGPXtreeItemId(self,self.root,'Controls'):new = Tr...
8
30
1
369
0
3,306
3,337
3,306
null
[]
None
null
0
0
0
null
0
null
The function (CheckNotebook) defined within the public class called public.The function start at line 3306 and ends at 3337. It contains 30 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
__init__
def __init__(self,parent,title,text,dataType,data,dataList,Limits=None):wx.Dialog.__init__(self,parent,-1,title,size=(400,250),pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)self.plotFrame = wx.Frame(self,-1,'Sum Plots',size=wx.Size(700,600), \style=wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX)self.G2pl...
1
18
8
201
0
3,349
3,366
3,349
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 3349 and ends at 3366. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [3349.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Draw
def Draw(self):if self.panel:self.panel.DestroyChildren()#safe: wx.Panelself.panel.Destroy()size = (480,350)self.panel = wxscroll.ScrolledPanel(self, wx.ID_ANY,size=size,style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)mainSizer = wx.BoxSizer(wx.VERTICAL)mainSizer.Add(wx.StaticText(self.panel,label=self.text),0)mainSizer.Add(...
7
65
1
851
0
3,368
3,433
3,368
null
[]
None
null
0
0
0
null
0
null
The function (Draw) defined within the public class called public.The function start at line 3368 and ends at 3433. It contains 65 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
OnAve
def OnAve(self,event):self.average = self.Avg.GetValue()
1
2
2
18
0
3,435
3,436
3,435
null
[]
None
null
0
0
0
null
0
null
The function (OnAve) defined within the public class called public.The function start at line 3435 and ends at 3436. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [3435.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnFilter
def OnFilter(self,event):'''Read text from filter control and select entries that match.'''if self.timer.IsRunning():self.timer.Stop()self.filterVal = txt = self.filterBox.GetValue()if txt:txt = txt.lower()ChoiceList = []ChoiceVals = []for i,item in enumerate(self.selectData):if item.lower().find(txt) != -1:ChoiceList....
5
17
2
136
0
3,438
3,457
3,438
null
[]
None
null
0
0
0
null
0
null
The function (OnFilter) defined within the public class called public.The function start at line 3438 and ends at 3457. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [3438.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetData
def GetData(self):if self.dataType == 'PWDR':return self.selectData+[self.data[-1],],self.resultelse:return self.selectData+[self.data[-1],],self.selectVals
2
5
1
52
0
3,459
3,463
3,459
null
[]
None
null
0
0
0
null
0
null
The function (GetData) defined within the public class called public.The function start at line 3459 and ends at 3463. 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
onChar
def onChar(self,event):'Respond to keyboard events in the Filter box'self.filterVal = self.filterBox.GetValue()if self.timer.IsRunning():self.timer.Stop()self.timer.Start(1000,oneShot=True)if event: event.Skip()
3
7
2
55
0
3,465
3,471
3,465
null
[]
None
null
0
0
0
null
0
null
The function (onChar) defined within the public class called public.The function start at line 3465 and ends at 3471. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [3465.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnAllScale
def OnAllScale(self,event):dlg = G2G.SingleFloatDialog(self,'New scale','Enter new value for all scale factors',1.)dlg.CenterOnParent()if dlg.ShowModal() == wx.ID_OK:val = dlg.GetValue()dlg.Destroy()else:dlg.Destroy()returnfor Id,item in enumerate(self.selectData):self.selectVals[Id] = valwx.CallAfter(self.Draw)
3
13
2
86
0
3,473
3,485
3,473
null
[]
None
null
0
0
0
null
0
null
The function (OnAllScale) defined within the public class called public.The function start at line 3473 and ends at 3485. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [3473.0] and does not return any value..