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
UpdateDData.UpdateDData.twinSizer.OnTwinInv
def OnTwinInv(event):Obj = event.GetEventObject()it = Indx[Obj.GetId()]UseList[G2frame.hist]['Twins'][it][0] = Obj.GetValue()
1
4
1
43
0
742
745
742
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.twinSizer.OnTwinInv) defined within the public class called public.The function start at line 742 and ends at 745. 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
UpdateDData.UpdateDData.twinSizer.OnTwinDel
def OnTwinDel(event):Obj = event.GetEventObject()it = Indx[Obj.GetId()]nNonM = UseList[G2frame.hist]['Twins'][0][1][2]for i in range(nNonM):del UseList[G2frame.hist]['Twins'][1+i+it]del UseList[G2frame.hist]['Twins'][it]sumTw = 0.for it,twin in enumerate(UseList[G2frame.hist]['Twins']):if it:sumTw += twin[1]UseList[G2f...
5
15
1
187
0
747
761
747
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.twinSizer.OnTwinDel) defined within the public class called public.The function start at line 747 and ends at 761. It contains 15 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
UpdateDData.twinSizer
def twinSizer():def OnAddTwin(event):twinMat = np.array([[-1,0,0],[0,-1,0],[0,0,-1]])#inversion by defaulttwinVal = 0.0UseList[G2frame.hist]['Twins'].append([twinMat,twinVal])nNonM = UseList[G2frame.hist]['Twins'][0][1][2]for i in range(nNonM):UseList[G2frame.hist]['Twins'].append([False,0.0])addtwin.SetValue(False)wx....
12
69
0
710
0
705
826
705
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.twinSizer) defined within the public class called public.The function start at line 705 and ends at 826. It contains 69 lines of code and it has a cyclomatic complexity of 12. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateDData.OnSelect
def OnSelect(event):G2frame.hist = G2frame.dataWindow.HistsInPhase[DData.select.GetSelection()]oldFocus = wx.Window.FindFocus()G2plt.PlotSizeStrainPO(G2frame,data,G2frame.hist)wx.CallLater(100,RepaintHistogramInfo)if oldFocus: wx.CallAfter(oldFocus.SetFocus)
2
6
1
63
0
828
833
828
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.OnSelect) defined within the public class called public.The function start at line 828 and ends at 833. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateDData.RepaintHistogramInfo
def RepaintHistogramInfo(Scroll=0):if 'phoenix' in wx.version():G2frame.bottomSizer.Clear(True)# deal with case where this is called after another tree item has been selectedtry:DData.Shownexcept RuntimeError:if GSASIIpath.GetConfigValue('debug'):print('DBG: DData window deleted. Ignoring RepaintHistogramInfo, forcing ...
6
26
1
168
0
835
864
835
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.RepaintHistogramInfo) defined within the public class called public.The function start at line 835 and ends at 864. It contains 26 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
UpdateDData.UpdateDData.ShowHistogramInfo.OnUseData
def OnUseData(event):Obj = event.GetEventObject()UseList[G2frame.hist]['Use'] = Obj.GetValue()wx.CallLater(100,RepaintHistogramInfo,DData.GetScrollPos(wx.VERTICAL))
1
4
1
44
0
870
873
870
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.ShowHistogramInfo.OnUseData) defined within the public class called public.The function start at line 870 and ends at 873. 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
UpdateDData.UpdateDData.ShowHistogramInfo.OnLeBail
def OnLeBail(event):'''Toggle the LeBail flag (Phase['Histograms'][hist]['LeBail'] andwhen turned on, set the Controls['newLeBail'] flag to indicate thatthe a new Le Bail extraction will be performed at the nextrefinement'''UseList[G2frame.hist]['LeBail'] = not UseList[G2frame.hist]['LeBail']if UseList[G2frame.hist]['L...
2
7
1
68
0
875
886
875
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.ShowHistogramInfo.OnLeBail) defined within the public class called public.The function start at line 875 and ends at 886. It contains 7 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
UpdateDData.UpdateDData.ShowHistogramInfo.OnResetSize
def OnResetSize(event):Obj = event.GetEventObject()item,name = Indx[Obj.GetId()]if name == 'isotropic':UseList[item]['Size'][1][0] = 1.0elif name == 'uniaxial':UseList[item]['Size'][1][0] = 1.0UseList[item]['Size'][1][1] = 1.0elif name == 'ellipsoidal':for i in range(3):UseList[item]['Size'][4][i] = 1.0UseList[item]['S...
5
14
1
161
0
888
901
888
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.ShowHistogramInfo.OnResetSize) defined within the public class called public.The function start at line 888 and ends at 901. It contains 14 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
UpdateDData.UpdateDData.ShowHistogramInfo.OnSizeAxis
def OnSizeAxis(event):event.Skip()Obj = event.GetEventObject()Saxis = Obj.GetValue().split()try:hkl = [int(Saxis[i]) for i in range(3)]except (ValueError,IndexError):hkl = UseList[G2frame.hist]['Size'][3]if not np.any(np.array(hkl)):hkl = UseList[G2frame.hist]['Size'][3]UseList[G2frame.hist]['Size'][3] = hklh,k,l = hkl...
4
13
1
132
0
903
915
903
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.ShowHistogramInfo.OnSizeAxis) defined within the public class called public.The function start at line 903 and ends at 915. It contains 13 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
UpdateDData.UpdateDData.ShowHistogramInfo.OnFixVals
def OnFixVals(event):Obj = event.GetEventObject()UseList[G2frame.hist]['Fix FXU'] = Obj.GetValue()
1
3
1
27
0
917
919
917
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.UpdateDData.ShowHistogramInfo.OnFixVals) defined within the public class called public.The function start at line 917 and ends at 919. 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
UpdateDData.ShowHistogramInfo
def ShowHistogramInfo():'''This creates a sizer with all the information pulled out from the Phase/data dict'''def OnUseData(event):Obj = event.GetEventObject()UseList[G2frame.hist]['Use'] = Obj.GetValue()wx.CallLater(100,RepaintHistogramInfo,DData.GetScrollPos(wx.VERTICAL))def OnLeBail(event):'''Toggle the LeBail flag...
43
172
0
2,190
0
866
1,098
866
null
[]
None
null
0
0
0
null
0
null
The function (UpdateDData.ShowHistogramInfo) defined within the public class called public.The function start at line 866 and ends at 1098. It contains 172 lines of code and it has a cyclomatic complexity of 43. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateDData
def UpdateDData(G2frame,DData,data,hist='',Scroll=0):'''Display the Diffraction Data associated with a phase(items where there is a value for each histogram and phase)Used in the Phase/Data tab or the Hist/Phase tree entry:param wx.frame G2frame: the main GSAS-II frame object:param wx.ScrolledWindow DData: notebook pag...
25
112
5
822
162
34
1,178
34
null
['useGUI', 'isoSizer', 'resetSizer', 'bottomSizer', 'lengths', 'POtype', 'sizeRef', 'reflSets', 'msg', 'Ids', 'TwVal', 'Axes', 'hkl', 'muiso', 'newPOCoef', 'hstrainRef', 'allzero', 'Inst', 'projSizer', 'fixedVars', 'topsizer', 'SGData', 'twinval', 'shToler', 'parms', 'dispSizer', 'hstrainVal', 'uniSizer', 'Choices', 'v...
None
null
0
0
0
null
0
null
The function (UpdateDData) defined within the public class called public.The function start at line 34 and ends at 1178. It contains 112 lines of code and it has a cyclomatic complexity of 25. It takes 5 parameters, represented as [34.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeHistPhaseWin.OnSelectPage
def OnSelectPage(event):'Called when an item is selected from the Select page menu'tabname = TabSelectionIdDict.get(event.GetId()) # lookup phaseif not tabname:print ('Warning: menu item not in dict! id= %d'%event.GetId())return# find the tab matching the phasefor i,page in enumerate(phaseList):if tabname == phaseList[...
4
13
1
76
0
1,188
1,201
1,188
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnSelectPage) defined within the public class called public.The function start at line 1188 and ends at 1201. It contains 13 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
MakeHistPhaseWin.OnPageChanged
def OnPageChanged(event):'respond to a notebook tab'page = event.GetSelection()wx.CallAfter(FillDDataWindow,page)
1
4
1
21
0
1,203
1,206
1,203
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnPageChanged) defined within the public class called public.The function start at line 1203 and ends at 1206. 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
MakeHistPhaseWin.getDDataWindow
def getDDataWindow():'Get the current scrollwindow for selected phase'return DData[HAPBook.GetSelection()]
1
3
0
14
0
1,208
1,210
1,208
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.getDDataWindow) defined within the public class called public.The function start at line 1208 and ends at 1210. 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
MakeHistPhaseWin.getDDataPhaseinfo
def getDDataPhaseinfo():'Get the data tree entry for the currently selected phase'page = HAPBook.GetSelection()return G2frame.GPXtree.GetItemPyData(phaseIds[page])
1
4
0
24
0
1,212
1,215
1,212
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.getDDataPhaseinfo) defined within the public class called public.The function start at line 1212 and ends at 1215. 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
MakeHistPhaseWin.FillDDataWindow
def FillDDataWindow(page):'display the DData info'G2frame.HistPhaseLastSel = phaseList[page]data = G2frame.GPXtree.GetItemPyData(phaseIds[page])G2plt.PlotSizeStrainPO(G2frame,data,hist='')UpdateDData(G2frame,DData[page],data)
1
6
1
50
0
1,217
1,222
1,217
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.FillDDataWindow) defined within the public class called public.The function start at line 1217 and ends at 1222. 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
MakeHistPhaseWin.OnHklfAdd
def OnHklfAdd(event):'''Called to link a Single Xtal (HKLF) dataset to a selected phase.Most commonly, the histogram and phase are linked when the latteritem is read in (routines OnImportPhase or OnImportSfact infunc:`GSASIIdataGUI.GSASIImain`, but one can defer this or changethe linking later using this routine.Note t...
2
5
1
41
0
1,226
1,239
1,226
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnHklfAdd) defined within the public class called public.The function start at line 1226 and ends at 1239. 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
MakeHistPhaseWin.OnDataUse
def OnDataUse(event):data = getDDataPhaseinfo()#hist = G2frame.histif data['Histograms']:dlg = G2G.G2MultiChoiceDialog(G2frame, 'Use histograms','Use which histograms?',G2frame.dataWindow.HistsInPhase)try:if dlg.ShowModal() == wx.ID_OK:sel = dlg.GetSelections()for Id,item in enumerate(G2frame.dataWindow.HistsInPhase):i...
6
16
1
120
0
1,241
1,257
1,241
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnDataUse) defined within the public class called public.The function start at line 1241 and ends at 1257. It contains 16 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
MakeHistPhaseWin.OnDataCopy
def OnDataCopy(event):data = getDDataPhaseinfo()hist = G2frame.histkeyList = G2frame.dataWindow.HistsInPhase[:]if hist in keyList: keyList.remove(hist)if not keyList:G2G.G2MessageBox(G2frame,'No histograms to copy to')returnsourceDict = copy.deepcopy(data['Histograms'][hist])if 'HKLF' in sourceDict['Histogram']:copyNam...
9
26
1
216
0
1,259
1,284
1,259
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnDataCopy) defined within the public class called public.The function start at line 1259 and ends at 1284. It contains 26 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
MakeHistPhaseWin.OnDataCopyFlags
def OnDataCopyFlags(event):data = getDDataPhaseinfo()hist = G2frame.histsourceDict = copy.deepcopy(data['Histograms'][hist])copyDict = {}if 'HKLF' in sourceDict['Histogram']:copyNames = ['Extinction','Babinet','Flack','Twins']else:#PWDRcopyNames = ['Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet','Layer D...
35
82
1
961
0
1,286
1,367
1,286
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnDataCopyFlags) defined within the public class called public.The function start at line 1286 and ends at 1367. It contains 82 lines of code and it has a cyclomatic complexity of 35. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeHistPhaseWin.OnSelDataCopy
def OnSelDataCopy(event):data = getDDataPhaseinfo()hist = G2frame.histsourceDict = data['Histograms'][hist]keyList = G2frame.dataWindow.HistsInPhase[:]if hist in keyList: keyList.remove(hist)if not keyList:G2G.G2MessageBox(G2frame,'No histograms to copy to')returnif 'HKLF' in sourceDict['Histogram']:copyNames = ['Extin...
13
35
1
270
0
1,369
1,403
1,369
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnSelDataCopy) defined within the public class called public.The function start at line 1369 and ends at 1403. It contains 35 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
MakeHistPhaseWin.OnPwdrAdd
def OnPwdrAdd(event):data = getDDataPhaseinfo()generalData = data['General']SGData = generalData['SGData']newList = []NShkl = len(G2spc.MustrainNames(SGData))NDij = len(G2spc.HStrainNames(SGData))keyList = data['Histograms'].keys()TextList = []if G2frame.GPXtree.GetCount():item, cookie = G2frame.GPXtree.GetFirstChild(G...
11
43
1
522
0
1,405
1,447
1,405
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnPwdrAdd) defined within the public class called public.The function start at line 1405 and ends at 1447. It contains 43 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeHistPhaseWin.OnDataDelete
def OnDataDelete(event):data = getDDataPhaseinfo()if G2frame.dataWindow.HistsInPhase:DelList = []extraOpts= {'label_0':'Remove from all phases','value_0':False}h,pd = G2frame.GetUsedHistogramsAndPhasesfromTree()if len(pd) > 1:opts = extraOptselse:opts = {}dlg = G2G.G2MultiChoiceDialog(G2frame,'Select histogram(s) to re...
11
27
1
189
0
1,449
1,475
1,449
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnDataDelete) defined within the public class called public.The function start at line 1449 and ends at 1475. It contains 27 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeHistPhaseWin.OnDataApplyStrain
def OnDataApplyStrain(event):data = getDDataPhaseinfo()SGData = data['General']['SGData']DijVals = data['Histograms'][G2frame.hist]['HStrain'][0][:]# apply the Dij values to the reciprocal cellnewA = []Dijdict = dict(zip(G2spc.HStrainNames(SGData),DijVals))for Aij,lbl in zip(G2lat.cell2A(data['General']['Cell'][1:7]),[...
4
15
1
202
0
1,477
1,502
1,477
null
[]
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin.OnDataApplyStrain) defined within the public class called public.The function start at line 1477 and ends at 1502. It contains 15 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
MakeHistPhaseWin
def MakeHistPhaseWin(G2frame):'''Display Phase/Data (HAP) info from a Hist/Phase tree item. Used whenthe HAP info is shown as if a top-level entry in the data tree (see theSeparateHistPhaseTreeItem config option). This code is not used whenthe HAP info is shown in its original location, the Data tab in thePhase info.''...
8
66
1
514
43
1,180
1,560
1,180
null
['opts', 'DData', 'phaseList', 'item', 'refList', 'items', 'selectedItems', 'SHterms', 'Dijdict', 'page', 'phaseIds', 'NShkl', 'HAPtab', 'extraOpts', 'dlg', 'menu', 'SHflags', 'SGData', 'mid', 'TextList', 'sourceDict', 'DelList', 'HAPBook', 'sub', 'NDij', 'name', 'TabSelectionIdDict', 'result', 'copyDict', 'newList', '...
None
null
0
0
0
null
0
null
The function (MakeHistPhaseWin) defined within the public class called public.The function start at line 1180 and ends at 1560. It contains 66 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
IndexParmDict
def IndexParmDict(parmDict,wildcard):'''Separate the parameters in parmDict into list of keys by parametertype.:param dict parmDict: a dict with GSAS-II parameters:param bool wildcard: True if wildcard versions of parameters shouldbe generated and added to the lists:returns: a dict of lists where key 1 is a list of pha...
10
21
2
187
3
22
51
22
null
['hrex', 'parmLists', 'prex']
None
null
0
0
0
null
0
null
The function (IndexParmDict) defined within the public class called public.The function start at line 22 and ends at 51. It contains 21 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [22.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadDefaultExpressions
def LoadDefaultExpressions():'''Read a configuration file with default expressions from all files namedDefaultExpressions.txt found in the path. Duplicates are removed andexpressions are sorted alphabetically'''global defaultExpressionsif defaultExpressions is not None: return # run this routine only oncedefaultExpress...
2
4
0
31
1
55
62
55
null
['defaultExpressions']
None
null
0
0
0
null
0
null
The function (LoadDefaultExpressions) defined within the public class called public.The function start at line 55 and ends at 62. 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
__init__
def __init__(self, parent, parmDict, exprObj=None, header='Enter restraint expression here', wintitle='Expression Editor', fit=True,VarLabel=None,depVarDict=None, ExtraButton=None,usedVars=[], wildCard=True):self.fit = fitself.depVarDict = depVarDict'dict for dependent variables'self.parmDict = {}'''A copy of the G2 pa...
17
128
12
1,252
0
114
270
114
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 114 and ends at 270. It contains 128 lines of code and it has a cyclomatic complexity of 17. It takes 12 parameters, represented as [114.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnExtra
def OnExtra(self,event):exprObj = G2obj.ExpressionObj()exprObj.LoadExpression(self.expr,self.exprVarLst,self.varSelect,self.varName,self.varValue,self.varRefflag,)if self.depVarDict:exprObj.SetDepVar(self.dependentVar)self.ExtraCallBack(exprObj)# put results back into displayed dialogresDict = dict(exprObj.GetVariedVar...
4
20
2
140
0
277
297
277
null
[]
None
null
0
0
0
null
0
null
The function (OnExtra) defined within the public class called public.The function start at line 277 and ends at 297. It contains 20 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [277.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Show
def Show(self,mode=True):'''Call to use the dialog after it is created.:returns: None (On Cancel) or a new :class:`~GSASIIobj.ExpressionObj`'''self.Layout()#self.mainsizer.Fit(self)self.SendSizeEvent() # force repaintif self.ShowModal() == wx.ID_OK:# store the edit results in the object and return itexprObj = G2obj.Exp...
3
18
2
86
0
299
322
299
null
[]
None
null
0
0
0
null
0
null
The function (Show) defined within the public class called public.The function start at line 299 and ends at 322. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [299.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
setEvalResult
def setEvalResult(self,msg):'Show a string in the expression result area'self.result.SetLabel(msg)
1
3
2
16
0
324
326
324
null
[]
None
null
0
0
0
null
0
null
The function (setEvalResult) defined within the public class called public.The function start at line 324 and ends at 326. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [324.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
RestartTimer
def RestartTimer(self):'''Cancels any running timer and starts a new one.The timer causes a check of syntax after 2 seconds unless there is further input.Disables the OK button until a validity check is complete.'''if self.timer.IsRunning():self.timer.Stop()self.timer.Start(2000,oneShot=True)
2
4
1
34
0
328
335
328
null
[]
None
null
0
0
0
null
0
null
The function (RestartTimer) defined within the public class called public.The function start at line 328 and ends at 335. 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
OnChar
def OnChar(self,event):'''Called as each character is entered. Cancels any running timerand starts a new one. The timer causes a check of syntax after 2 secondswithout input.Disables the OK button until a validity check is complete.'''self.RestartTimer()self.OKbtn.Disable()if self.ExtraBtn: self.ExtraBtn.Disable()event...
2
6
2
38
0
337
347
337
null
[]
None
null
0
0
0
null
0
null
The function (OnChar) defined within the public class called public.The function start at line 337 and ends at 347. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [337.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CheckVars
def CheckVars(self):'''Check that appropriate variables are defined for eachsymbol used in :data:`self.expr`:returns: a text error message or None if all needed input is present'''invalid = 0for v in self.exprVarLst:if self.varSelect.get(v) is None:invalid += 1if invalid==1:return '(a variable is not assigned)'elif inv...
19
43
1
225
0
349
397
349
null
[]
None
null
0
0
0
null
0
null
The function (CheckVars) defined within the public class called public.The function start at line 349 and ends at 397. It contains 43 lines of code and it has a cyclomatic complexity of 19. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDepChoice
def OnDepChoice(self,event):'''Respond to a selection of a variable type for a label inan expression'''if event: event.Skip()sel = self.depChoices[event.GetEventObject().GetSelection()]var = self.SelectG2var(sel,'Dependent variable',self.depParmLists[sel])if var is None:self.dependentVar = Noneself.OnValidate(None)even...
3
13
2
102
0
399
414
399
null
[]
None
null
0
0
0
null
0
null
The function (OnDepChoice) defined within the public class called public.The function start at line 399 and ends at 414. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [399.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDepVar
def GetDepVar(self):'''Returns the name of the dependent variable, when depVarDict is used.'''return self.dependentVar
1
2
1
10
0
416
419
416
null
[]
None
null
0
0
0
null
0
null
The function (GetDepVar) defined within the public class called public.The function start at line 416 and ends at 419. 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
OnChoice
def OnChoice(self,event):'''Respond to a selection of a variable type for a label inan expression'''if event: event.Skip()v = event.GetEventObject().labelsel = self.AllowedChoices[event.GetEventObject().GetSelection()]if sel == 0:sv = G2obj.MakeUniqueLabel(v,self.usedVars)self.varSelect[v] = selself.varName[v] = svself...
4
17
2
146
0
421
440
421
null
[]
None
null
0
0
0
null
0
null
The function (OnChoice) defined within the public class called public.The function start at line 421 and ends at 440. It contains 17 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [421.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SelectG2var.wildHist
def wildHist(var):'''Replace a histogram number with a wild card'''slst = var.split(':')if len(slst) > 2 and slst[1]:slst[1] = '*'return ':'.join(slst)return var
3
6
1
42
0
450
457
450
null
[]
None
null
0
0
0
null
0
null
The function (SelectG2var.wildHist) defined within the public class called public.The function start at line 450 and ends at 457. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SelectG2var
def SelectG2var(self,sel,var,parmList):'''Offer a selection of a GSAS-II variable.:param int sel: Determines the type of variable to be selected.where 1 is used for Phase variables, and 2 for Histogram/Phase vars,3 for Histogram vars and 4 for Global vars.:returns: a variable name or None (if Cancel is pressed)'''def w...
7
27
4
192
0
442
483
442
null
[]
None
null
0
0
0
null
0
null
The function (SelectG2var) defined within the public class called public.The function start at line 442 and ends at 483. It contains 27 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [442.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
showError
def showError(self,msg1,msg2='',msg3=''):'''Show an error message of 1 to 3 sections. The secondsection is shown in an equally-spaced font.:param str msg1: msg1 is shown in a the standard font:param str msg2: msg2 is shown in a equally-spaced (wx.MODERN) font:param str msg3: msg3 is shown in a the standard font'''self....
2
25
4
298
0
485
516
485
null
[]
None
null
0
0
0
null
0
null
The function (showError) defined within the public class called public.The function start at line 485 and ends at 516. It contains 25 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [485.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnValidate
def OnValidate(self,event):'''Respond to a press of the Validate button or when a variableis associated with a label (in :meth:`OnChoice`)'''if event: event.Skip()self.setEvalResult('(expression cannot be evaluated)')self.timer.Stop()self.expr = self.exCtrl.GetValue().strip()if not self.expr:wx.CallAfter(self.showError...
4
16
2
119
0
518
536
518
null
[]
None
null
0
0
0
null
0
null
The function (OnValidate) defined within the public class called public.The function start at line 518 and ends at 536. It contains 16 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [518.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Repaint
def Repaint(self,exprObj):'Redisplay the variables and continue the validation'# create widgets to associate vars with labels and/or show messagesself.varSizer.Clear(True)self.errbox = wxscroll.ScrolledPanel(self,style=wx.HSCROLL)self.errbox.SetMinSize((100,130))self.varSizer.Add(self.errbox,0,wx.ALL|wx.EXPAND,1)self.v...
27
127
2
1,158
0
538
678
538
null
[]
None
null
0
0
0
null
0
null
The function (Repaint) defined within the public class called public.The function start at line 538 and ends at 678. It contains 127 lines of code and it has a cyclomatic complexity of 27. It takes 2 parameters, represented as [538.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent, Phases, parmDict, exprObj=None, header='Select a bond for table', wintitle='Select bond', VarLabel=None,depVarDict=None, ExtraButton=None,usedVars=[]):wx.Dialog.__init__(self,parent,wx.ID_ANY,wintitle,pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)self.panel = wx.Panel(self) #just a dum...
2
19
11
152
0
690
708
690
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 690 and ends at 708. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 11 parameters, represented as [690.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSetRadii
def OnSetRadii(self,event):if 'DisAglCtls' in self.Phases[self.pName]['General']:DisAglCtls = copy.deepcopy(self.Phases[self.pName]['General']['DisAglCtls'])else:DisAglCtls = {}dlg = G2G.DisAglDialog(self.parent,DisAglCtls,self.Phases[self.pName]['General'],Reset=False)if dlg.ShowModal() == wx.ID_OK:self.Phases[self.pN...
3
10
2
121
0
710
719
710
null
[]
None
null
0
0
0
null
0
null
The function (OnSetRadii) defined within the public class called public.The function start at line 710 and ends at 719. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [710.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Draw.OnPhase
def OnPhase(event):Obj = event.GetEventObject()self.pName = Obj.GetValue()self.Oatom = ''if 'DisAglCtls' not in self.Phases[self.pName]['General']:self.OnSetRadii(None)else:wx.CallAfter(self.Draw)
2
8
1
58
0
723
730
723
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnPhase) defined within the public class called public.The function start at line 723 and ends at 730. It contains 8 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
Draw.OnOrigAtom
def OnOrigAtom(event):Obj = event.GetEventObject()self.Oatom = Obj.GetValue()wx.CallAfter(self.Draw)
1
4
1
29
0
732
735
732
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnOrigAtom) defined within the public class called public.The function start at line 732 and ends at 735. 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.OnTargAtom
def OnTargAtom(event):Obj = event.GetEventObject()self.Tatom = Obj.GetValue()wx.CallAfter(self.Draw)
1
4
1
29
0
737
740
737
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnTargAtom) defined within the public class called public.The function start at line 737 and ends at 740. 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
def Draw(self):'paints the distance dialog window'def OnPhase(event):Obj = event.GetEventObject()self.pName = Obj.GetValue()self.Oatom = ''if 'DisAglCtls' not in self.Phases[self.pName]['General']:self.OnSetRadii(None)else:wx.CallAfter(self.Draw)def OnOrigAtom(event):Obj = event.GetEventObject()self.Oatom = Obj.GetValu...
8
64
1
675
0
721
802
721
null
[]
None
null
0
0
0
null
0
null
The function (Draw) defined within the public class called public.The function start at line 721 and ends at 802. It contains 64 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
GetSelection
def GetSelection(self):return self.pName,self.Oatom,self.Tatom
1
2
1
17
0
804
805
804
null
[]
None
null
0
0
0
null
0
null
The function (GetSelection) defined within the public class called public.The function start at line 804 and ends at 805. 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()parent.Raise()self.EndModal(wx.ID_OK)
1
4
2
27
0
807
810
807
null
[]
None
null
0
0
0
null
0
null
The function (OnOk) defined within the public class called public.The function start at line 807 and ends at 810. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [807.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnCancel
def OnCancel(self,event):parent = self.GetParent()parent.Raise()self.EndModal(wx.ID_CANCEL)
1
4
2
27
0
812
815
812
null
[]
None
null
0
0
0
null
0
null
The function (OnCancel) defined within the public class called public.The function start at line 812 and ends at 815. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [812.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent, Phases, parmDict, exprObj=None, header='Select a bond for table', wintitle='Select bond', VarLabel=None,depVarDict=None, ExtraButton=None,usedVars=[]):wx.Dialog.__init__(self,parent,wx.ID_ANY,wintitle,pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)self.panel = wx.Panel(self) #just a dum...
2
19
11
152
0
827
845
690
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 827 and ends at 845. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 11 parameters, represented as [690.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSetRadii
def OnSetRadii(self,event):if 'DisAglCtls' in self.Phases[self.pName]['General']:DisAglCtls = copy.deepcopy(self.Phases[self.pName]['General']['DisAglCtls'])else:DisAglCtls = {}dlg = G2G.DisAglDialog(self.parent,DisAglCtls,self.Phases[self.pName]['General'],Reset=False)if dlg.ShowModal() == wx.ID_OK:self.Phases[self.pN...
3
10
2
121
0
847
856
710
null
[]
None
null
0
0
0
null
0
null
The function (OnSetRadii) defined within the public class called public.The function start at line 847 and ends at 856. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [710.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Draw.OnPhase
def OnPhase(event):Obj = event.GetEventObject()self.pName = Obj.GetValue()self.Oatom = ''if 'DisAglCtls' not in self.Phases[self.pName]['General']:self.OnSetRadii(None)else:wx.CallAfter(self.Draw)
2
8
1
58
0
860
867
723
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnPhase) defined within the public class called public.The function start at line 860 and ends at 867. It contains 8 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
Draw.OnOrigAtom
def OnOrigAtom(event):Obj = event.GetEventObject()self.Oatom = Obj.GetValue()wx.CallAfter(self.Draw)
1
4
1
29
0
869
872
732
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnOrigAtom) defined within the public class called public.The function start at line 869 and ends at 872. 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.OnTargAtoms
def OnTargAtoms(event):Obj = event.GetEventObject()self.Tatoms = Obj.GetValue()wx.CallAfter(self.Draw)
1
4
1
29
0
874
877
874
null
[]
None
null
0
0
0
null
0
null
The function (Draw.OnTargAtoms) defined within the public class called public.The function start at line 874 and ends at 877. 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
def Draw(self):'paints the angle dialog window'def OnPhase(event):Obj = event.GetEventObject()self.pName = Obj.GetValue()self.Oatom = ''if 'DisAglCtls' not in self.Phases[self.pName]['General']:self.OnSetRadii(None)else:wx.CallAfter(self.Draw)def OnOrigAtom(event):Obj = event.GetEventObject()self.Oatom = Obj.GetValue()...
10
75
1
804
0
858
950
858
null
[]
None
null
0
0
0
null
0
null
The function (Draw) defined within the public class called public.The function start at line 858 and ends at 950. It contains 75 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
GetSelection
def GetSelection(self):return self.pName,self.Oatom,self.Tatom
1
2
1
17
0
952
953
804
null
[]
None
null
0
0
0
null
0
null
The function (GetSelection) defined within the public class called public.The function start at line 952 and ends at 953. 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()parent.Raise()self.EndModal(wx.ID_OK)
1
4
2
27
0
955
958
807
null
[]
None
null
0
0
0
null
0
null
The function (OnOk) defined within the public class called public.The function start at line 955 and ends at 958. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [807.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnCancel
def OnCancel(self,event):parent = self.GetParent()parent.Raise()self.EndModal(wx.ID_CANCEL)
1
4
2
27
0
960
963
812
null
[]
None
null
0
0
0
null
0
null
The function (OnCancel) defined within the public class called public.The function start at line 960 and ends at 963. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [812.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
showEQ
def showEQ(calcobj):printprint (calcobj.eObj.expression)for v in sorted(calcobj.eObj.freeVars.keys()+calcobj.eObj.assgnVars.keys()):print ("",v,'=',calcobj.exprDict[v])print (calcobj.EvalExpression())
2
6
1
63
0
997
1,002
997
null
[]
None
null
0
0
0
null
0
null
The function (showEQ) defined within the public class called public.The function start at line 997 and ends at 1002. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
sfloat
def sfloat(S):'Convert a string to float. An empty field or a unconvertable value is treated as zero'if S.strip():try:return float(S)except ValueError:passreturn 0.0
3
8
1
28
0
42
49
42
null
[]
None
null
0
0
0
null
0
null
The function (sfloat) defined within the public class called public.The function start at line 42 and ends at 49. It contains 8 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
G2SetPrintLevel
def G2SetPrintLevel(level):'''Set the level of output from calls to :func:`G2Print`, which shouldbe used in place of print() within GSASII. Settings for the mode are'all', 'warn', 'error' or 'none':param str level: a string used to set the print level, which may be'all', 'warn', 'error' or 'none'.Note that capitalizati...
3
9
1
40
1
62
79
62
null
['G2printLevel']
None
null
0
0
0
null
0
null
The function (G2SetPrintLevel) defined within the public class called public.The function start at line 62 and ends at 79. It contains 9 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
find
def find(name, path):'''find 1st occurance of file in path'''for root, dirs, files in os.walk(path):if name in files:return os.path.join(root, name)
3
4
2
38
0
81
86
81
null
[]
None
null
0
0
0
null
0
null
The function (find) defined within the public class called public.The function start at line 81 and ends at 86. It contains 4 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [81.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2Print
def G2Print(*args,**kwargs):'''Print with filtering based level of output (see :func:`G2SetPrintLevel`).Use G2Print() as replacement for print().:param str mode: if specified, this should contain the mode for printing('error', 'warn' or anything else). If not specified, the first argumentof the print command (args[0]) ...
9
15
2
113
2
88
111
88
null
['level', 'testStr']
None
null
0
0
0
null
0
null
The function (G2Print) defined within the public class called public.The function start at line 88 and ends at 111. It contains 15 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [88.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
get_python_versions
def get_python_versions(packagelist):versions = [['Python', sys.version.split()[0]]]for pack in packagelist:try:versions.append([pack.__name__, pack.__version__])except:passversions.append(['Platform', sys.platform + ' ' + platform.architecture()[0] + ' ' + platform.machine()])return versions
3
11
1
80
1
113
123
113
null
['versions']
None
null
0
0
0
null
0
null
The function (get_python_versions) defined within the public class called public.The function start at line 113 and ends at 123. 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
ImportErrorMsg
def ImportErrorMsg(errormsg=None,pkg={}):'''Store error message(s) from loading importers (usually missingpackages. Or, report back all messages, if called with no argument.:param str errormsg: a string containing the error message. If notsupplied, the function returns the error message(s).:param dict pkg: a dict where...
3
5
2
33
0
127
143
127
null
[]
None
null
0
0
0
null
0
null
The function (ImportErrorMsg) defined within the public class called public.The function start at line 127 and ends at 143. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [127.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
NeededPackage
def NeededPackage(pkgDict):'''Store packages that are needed to add functionality to GSAS-II:param dict pkgDict: a dict where the key is the describes the routineor the unavailable functionality that requires addition of a Pythonpackage and the value is a list containing the packages that need to be installed. If a spe...
1
2
1
12
0
145
164
145
null
[]
None
null
0
0
0
null
0
null
The function (NeededPackage) defined within the public class called public.The function start at line 145 and ends at 164. 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
makeInstDict
def makeInstDict(names,data,codes):inst = dict(zip(names,zip(data,data,codes)))for item in inst:inst[item] = list(inst[item])return inst
2
5
3
46
1
166
170
166
null
['inst']
None
null
0
0
0
null
0
null
The function (makeInstDict) defined within the public class called public.The function start at line 166 and ends at 170. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [166.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makePdabcDict
def makePdabcDict(pdabcString):'''if a pdabc entry is found in an instprm file, it will exist as a single stringeach row is delineated by a newline and must contains 5 comma separated valuesspecifying d,TOF,alp,bet,sig.This function will parse that string into a dictionary and then return it withina container dictionar...
6
33
1
191
9
172
219
172
null
['d', 'bet', 'nPdabc', 'entry', 'sig', 'lines', 'pdabcDict', 'TOF', 'alp']
None
null
0
0
0
null
0
null
The function (makePdabcDict) defined within the public class called public.The function start at line 172 and ends at 219. It contains 33 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
SetPowderInstParms
def SetPowderInstParms(Iparm, rd):'''extracts values from instrument parameters in rd.instdictor in array Iparm.Create and return the contents of the instrument parameter tree entry.'''Irads = {0:' ',1:'CrKa',2:'FeKa',3:'CuKa',4:'MoKa',5:'AgKa',6:'TiKa',7:'CoKa'}DataType = Iparm['INS HTYPE '].strip()[:3]# take 1st 3 ch...
35
166
2
2,287
33
221
393
221
null
['wave1', 'pfType', 'Ityp', 'names', 'Ipab', 'DataType', 'Iesd', 'Iparm1', 'Irads', 'Icovar', 'v', 'Tminmax', 's', 'irad', 'Bank', 'Itypes', 'NT', 'data', 'Icoeff', 'key', 'Npab', 'tth', 'wl', 'fltPath1', 'azm', 'instname', 'Inst1', 'fltPath0', 'k', 'Inst2', 'codes', 'wave2', 'v1']
None
null
0
0
0
null
0
null
The function (SetPowderInstParms) defined within the public class called public.The function start at line 221 and ends at 393. It contains 166 lines of code and it has a cyclomatic complexity of 35. It takes 2 parameters, represented as [221.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadInstprm
def ReadInstprm(instLines, bank, Sample={}):'''Read contents of a GSAS-II (new) .instprm instrument parameter file:param list instLines: contents of GSAS-II parameter file as alist of str; N.B. lines can be concatenated with ';':param int bank: bank number to use when instprm file has valuesfor multiple banks (noted by...
30
104
3
757
13
395
529
395
null
['iparm1', 'banklist', 'delim', 'newVals', 'Found', 'bank', 'NewSample', 'SS', 'il', 'newItems', 'idx', 'val', 'S']
None
null
0
0
0
null
0
null
The function (ReadInstprm) defined within the public class called public.The function start at line 395 and ends at 529. It contains 104 lines of code and it has a cyclomatic complexity of 30. It takes 3 parameters, represented as [395.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
WriteInstprm
def WriteInstprm(fp, InstPrm, InstPrm1, Sample={}, bank=None):'''Write the contents of a GSAS-II (new) .instprm instrument parameter fileToDo: use this inside G2frame.OnSave and G2frame.OnSaveAll:param file fp: Pointer to open file to be written.:param dict InstPrm: Instrument parameters:param dict InstPrm1: "extended"...
10
28
5
199
8
531
580
531
null
['d', 'bet', 'tof', 'i', 'sig', 'indent', 'resString', 'alp']
None
null
0
0
0
null
0
null
The function (WriteInstprm) defined within the public class called public.The function start at line 531 and ends at 580. It contains 28 lines of code and it has a cyclomatic complexity of 10. It takes 5 parameters, represented as [531.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadImportRoutines
def LoadImportRoutines(prefix, errprefix=None, traceback=False):'''Loads import routines from the GSASII.imports area and from a user-supplied area, ~/.GSASII/imports.:param str prefix: string used in the file name to differentiate the importer type (e.g. `G2img_xyz.py` is an importer for images. Will be one of 'img' (...
18
43
3
343
8
582
642
582
null
['member', 'readerlist', 'fnam', 'mod', 'modspec', 'reader', 'nam', 'module']
None
null
0
0
0
null
0
null
The function (LoadImportRoutines) defined within the public class called public.The function start at line 582 and ends at 642. It contains 43 lines of code and it has a cyclomatic complexity of 18. It takes 3 parameters, represented as [582.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadExportRoutines
def LoadExportRoutines(parent, usetraceback=False):'''Loads all export routines from the GSASII.exports area and from a user-supplied area, ~/.GSASII/exports.:param parent: a reference to the main GSAS-II window when called from the GUI or None when called from GSASIIscriptable:param usetraceback: if True (used for deb...
24
70
2
445
8
644
729
644
null
['exporterlist', 'member', 'fnam', 'mod', 'modspec', 'exporter', 'nam', 'module']
None
null
0
0
0
null
0
null
The function (LoadExportRoutines) defined within the public class called public.The function start at line 644 and ends at 729. It contains 70 lines of code and it has a cyclomatic complexity of 24. It takes 2 parameters, represented as [644.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
readColMetadata
def readColMetadata(imagefile):'''Reads image metadata from a column-oriented metadata table(1-ID style .par file). Called by :func:`GetColumnMetadata`The .par file has any number of columns separated by spaces.The directory for the file must be specified inConfig variable :data:`config_example.Column_Metadata_director...
14
51
1
359
8
731
912
731
null
['parfiles', 'fp', 'parRoot', 'lblFil', 'items', 'name', 'nameList', 'metadata']
None
null
0
0
0
null
0
null
The function (readColMetadata) defined within the public class called public.The function start at line 731 and ends at 912. It contains 51 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
readColMetadataLabels
def readColMetadataLabels(lblFil):'''Read the .*lbls file and setup for metadata assignments'''lbldict = {}keyExp = {}keyCols = {}labels = {}errors = []fp = open(lblFil,'r') # read column labelsfor iline,line in enumerate(fp): # read label definitionsline = line.strip()if not line or line[0] == '#': continue # comments...
13
39
1
296
10
914
955
914
null
['line', 'keyExp', 'fp', 'errors', 'key', 'keyCols', 'items', 'lbldict', 'f', 'labels']
None
null
0
0
0
null
0
null
The function (readColMetadataLabels) defined within the public class called public.The function start at line 914 and ends at 955. It contains 39 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
evalColMetadataDicts
def evalColMetadataDicts(items,labels,lbldict,keyCols,keyExp,ShowError=False):'''Evaluate the metadata for a line in the .par file'''metadata = {lbldict[j]:items[j] for j in lbldict}named = {}for key in keyExp:try:res = keyExp[key](*[items[j] for j in keyCols[key]])except:if ShowError:res = "*** error ***"else:continue...
7
16
6
117
3
957
974
957
null
['res', 'named', 'metadata']
None
null
0
0
0
null
0
null
The function (evalColMetadataDicts) defined within the public class called public.The function start at line 957 and ends at 974. It contains 16 lines of code and it has a cyclomatic complexity of 7. It takes 6 parameters, represented as [957.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetColumnMetadata
def GetColumnMetadata(reader):'''Add metadata to an image from a column-type metadata fileusing :func:`readColMetadata`:param reader: a reader object from reading an image'''if not GSASIIpath.GetConfigValue('Column_Metadata_directory'): returnparParms = readColMetadata(reader.readfilename)if not parParms: return # chec...
10
26
1
236
2
976
1,007
976
null
['specialKeys', 'parParms']
None
null
0
0
0
null
0
null
The function (GetColumnMetadata) defined within the public class called public.The function start at line 976 and ends at 1007. It contains 26 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
LoadControls
def LoadControls(Slines,data):'Read values from a .imctrl (Image Controls) file'cntlList = ['color','wavelength','distance','tilt','invert_x','invert_y','type','Oblique','fullIntegrate','outChannels','outAzimuths','LRazimuth','IOtth','azmthOff','DetDepth','calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList...
9
26
2
234
3
1,009
1,034
1,009
null
['save', 'cntlList', 'vals']
None
null
0
0
0
null
0
null
The function (LoadControls) defined within the public class called public.The function start at line 1009 and ends at 1034. It contains 26 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [1009.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
WriteControls
def WriteControls(filename,data):'Write current values to a .imctrl (Image Controls) file'File = open(filename,'w')keys = ['type','color','wavelength','calibrant','distance','center','Oblique','tilt','rotation','azmthOff','fullIntegrate','LRazimuth','setdist','IOtth','outChannels','outAzimuths','invert_x','invert_y','D...
3
14
2
118
2
1,036
1,049
1,036
null
['keys', 'File']
None
null
0
0
0
null
0
null
The function (WriteControls) defined within the public class called public.The function start at line 1036 and ends at 1049. It contains 14 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1036.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetImageData
def GetImageData(G2frame,imagefile,imageOnly=False,ImageTag=None,FormatName=''):'''Read a single image with an image importer. This is called to reread an imageafter it has already been imported with :meth:`GSASIIdataGUI.GSASII.OnImportGeneric`(or :func:`GSASIImiscGUI.ReadImages` in Auto Integration) so it is not neces...
19
56
5
331
5
1,051
1,125
1,051
null
['errorReport', 'primaryReaders', 'secondaryReaders', 'flag', 'ParentFrame']
None
null
0
0
0
null
0
null
The function (GetImageData) defined within the public class called public.The function start at line 1051 and ends at 1125. It contains 56 lines of code and it has a cyclomatic complexity of 19. It takes 5 parameters, represented as [1051.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
RereadImageData
def RereadImageData(ImageReaderlist,imagefile,ImageTag=None,FormatName=''):'''Read a single image with an image importer. This is called toreread an image after it has already been imported, so it is notnecessary to reload metadata.Based on :func:`GetImageData` which this can replacewhere imageOnly=True:param list Imag...
14
38
4
227
4
1,127
1,181
1,127
null
['secondaryReaders', 'flag', 'primaryReaders', 'errorReport']
None
null
0
0
0
null
0
null
The function (RereadImageData) defined within the public class called public.The function start at line 1127 and ends at 1181. It contains 38 lines of code and it has a cyclomatic complexity of 14. It takes 4 parameters, represented as [1127.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
readMasks
def readMasks(filename,masks,ignoreThreshold):'''Read a GSAS-II masks file'''File = open(filename,'r')save = {}oldThreshold = masks['Thresholds'][0]S = File.readline()while S:if S[0] == '#':S = File.readline()continue[key,val] = S.strip().split(':',1)if key in ['Points','Rings','Arcs','Polygons','Frames','Thresholds','...
10
24
3
228
4
1,183
1,208
1,183
null
['save', 'oldThreshold', 'S', 'File']
None
null
0
0
0
null
0
null
The function (readMasks) defined within the public class called public.The function start at line 1183 and ends at 1208. It contains 24 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [1183.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
PDFWrite
def PDFWrite(PDFentry,fileroot,PDFsaves,PDFControls,Inst={},Limits=[]):'''Write PDF-related data (G(r), S(Q),...) into files, asselected.:param str PDFentry: name of the PDF entry in the tree. This isused for comments in the file specifying where it came from;it can be arbitrary:param str fileroot: name of file(s) to b...
21
138
6
1,359
30
1,210
1,380
1,210
null
['fqfxn', 'fqfile', 'sqfxn', 'nq', 'grfile', 'wave', 'iqnew', 'grdata', 'fileroot', 'grnew', 'iqdata', 'fqdata', 'nr', 'num', 'sqfile', 'rnew', 'highQ', 'iqfxn', 'qdata', 'iqfile', 'grfilename', 'sqnew', 'sqdata', 'formula', 'fqnew', 'grfxn', 'fqfilename', 'qnew', 'iqfilename', 'sqfilename']
None
null
0
0
0
null
0
null
The function (PDFWrite) defined within the public class called public.The function start at line 1210 and ends at 1380. It contains 138 lines of code and it has a cyclomatic complexity of 21. It takes 6 parameters, represented as [1210.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FormulaEval
def FormulaEval(string):'''Evaluates a algebraic formula into a float, if possible. Worksproperly on fractions e.g. 2/3 only with python 3.0+ division.Expressions such as 2/3, 3*pi, sin(45)/2, 2*sqrt(2), 2**10 can allbe evaluated.:param str string: Character string containing a Python expressionto be evaluated.:returns...
4
7
1
40
1
1,403
1,422
1,403
null
['val']
None
null
0
0
0
null
0
null
The function (FormulaEval) defined within the public class called public.The function start at line 1403 and ends at 1422. It contains 7 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
FormatPadValue
def FormatPadValue(val,maxdigits=None):'''Format a float to fit in ``maxdigits[0]`` spaces with maxdigits[1] after decimal.:param float val: number to be formatted.:param list maxdigits: the number of digits & places after decimal to be used for display of thenumber (defaults to [10,2]).:returns: a string with exactly ...
3
11
2
73
3
1,424
1,444
1,424
null
['s', 'digits', 'fmt']
None
null
0
0
0
null
0
null
The function (FormatPadValue) defined within the public class called public.The function start at line 1424 and ends at 1444. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1424.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FormatValue
def FormatValue(val,maxdigits=None):'''Format a float to fit in at most ``maxdigits[0]`` spaces with maxdigits[1] after decimal.Note that this code has been hacked from FormatSigFigs and may have unused sections.:param float val: number to be formatted.:param list maxdigits: the number of digits, places after decimal a...
19
43
2
472
4
1,447
1,502
1,447
null
['decimals', 'digits', 'fmt', 'string']
None
null
0
0
0
null
0
null
The function (FormatValue) defined within the public class called public.The function start at line 1447 and ends at 1502. It contains 43 lines of code and it has a cyclomatic complexity of 19. It takes 2 parameters, represented as [1447.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FormatSigFigs
def FormatSigFigs(val, maxdigits=10, sigfigs=5, treatAsZero=1e-20):'''Format a float to use ``maxdigits`` or fewer digits with ``sigfigs``significant digits showing (if room allows).:param float val: number to be formatted.:param int maxdigits: the number of digits to be used for display of the number (defaults to 10)....
17
35
4
389
2
1,504
1,555
1,504
null
['decimals', 'fmt']
None
null
0
0
0
null
0
null
The function (FormatSigFigs) defined within the public class called public.The function start at line 1504 and ends at 1555. It contains 35 lines of code and it has a cyclomatic complexity of 17. It takes 4 parameters, represented as [1504.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
openInNewTerm
def openInNewTerm(project=None,g2script=None,pythonapp=sys.executable):'''Open a new and independent GSAS-II session in separate terminalor console window and as a separate process that will continueeven if the calling process exits.Intended to work on all platforms.This could be used to run other scripts inside python...
18
66
3
385
6
1,559
1,669
1,559
null
['fil', 'script', 'cmds', 'fp', 'found', 'g2script']
None
null
0
0
0
null
0
null
The function (openInNewTerm) defined within the public class called public.The function start at line 1559 and ends at 1669. It contains 66 lines of code and it has a cyclomatic complexity of 18. It takes 3 parameters, represented as [1559.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CleanupFromZip
def CleanupFromZip(label,cleanupList):'''Delete files extracted from a zip archive, typically created with:func:`GSASIIctrl.ExtractFileFromZip` during the data import process.Note that image files should not be deleted as they will be reusedevery time the image is displayed, but everything else will be savedin the data...
5
14
2
67
0
1,671
1,695
1,671
null
[]
None
null
0
0
0
null
0
null
The function (CleanupFromZip) defined within the public class called public.The function start at line 1671 and ends at 1695. It contains 14 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [1671.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
striphist
def striphist(var,insChar=''):'strip a histogram number from a var name'sv = var.split(':')if len(sv) <= 1: return varif sv[1]:sv[1] = insCharreturn ':'.join(sv)
3
7
2
47
1
1,697
1,703
1,697
null
['sv']
None
null
0
0
0
null
0
null
The function (striphist) defined within the public class called public.The function start at line 1697 and ends at 1703. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1697.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
trim
def trim(val):'''Simplify a string containing leading and trailing spacesas well as newlines, tabs, repeated spaces etc. into a shorter andmore simple string, by replacing all ranges of whitespacecharacters with a single space.:param str val: the string to be simplified:returns: the (usually) shortened version of the s...
1
2
1
21
0
1,705
1,715
1,705
null
[]
None
null
0
0
0
null
0
null
The function (trim) defined within the public class called public.The function start at line 1705 and ends at 1715. 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,G2frame,formatName,extension,longFormatName=None,):self.G2frame = G2frameself.formatName = formatName # short string naming file typeself.extension = extensionif longFormatName: # longer string naming file typeself.longFormatName = longFormatNameelse:self.longFormatName = formatNameself.OverallParms =...
2
26
5
146
0
1,735
1,765
1,735
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1735 and ends at 1765. It contains 26 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [1735.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
InitExport
def InitExport(self,event):'''Determines the type of menu that called the Exporter andmisc initialization.'''self.filename = None # name of file to be written (single export)self.dirname = '' # name of file to be written (multiple export)if event:self.currentExportType = self.G2frame.ExportLookup.get(event.Id)
2
5
2
37
0
1,768
1,775
1,768
null
[]
None
null
0
0
0
null
0
null
The function (InitExport) defined within the public class called public.The function start at line 1768 and ends at 1775. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1768.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakePWDRfilename
def MakePWDRfilename(self,hist):'''Make a filename root (no extension) from a PWDR histogram name:param str hist: the histogram name in data tree (starts with "PWDR ")'''file0 = ''file1 = hist[5:]# replace repeated blankswhile file1 != file0:file0 = file1file1 = file0.replace('',' ').strip()file0 = file1.replace('Azm= ...
3
11
2
90
0
1,777
1,793
1,777
null
[]
None
null
0
0
0
null
0
null
The function (MakePWDRfilename) defined within the public class called public.The function start at line 1777 and ends at 1793. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1777.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExportSelect
def ExportSelect(self,AskFile='ask'):'''Selects histograms or phases when needed. Sets a default file name whenrequested into self.filename; always sets a default directory in self.dirname.:param bool AskFile: Determines how this routine processes getting alocation to store the current export(s).* if AskFile is 'ask' (...
68
170
2
1,373
0
1,795
1,999
1,795
null
[]
None
null
0
0
0
null
0
null
The function (ExportSelect) defined within the public class called public.The function start at line 1795 and ends at 1999. It contains 170 lines of code and it has a cyclomatic complexity of 68. It takes 2 parameters, represented as [1795.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
loadParmDict
def loadParmDict(self,computeSU=False):'''Load the GSAS-II refinable parameters from the tree into a dict (self.parmDict). Updaterefined values to those from the last cycle and set the uncertainties for therefined parameters in another dict (self.sigDict).Expands the parm & sig dicts to include values derived from cons...
18
77
2
797
0
2,001
2,096
2,001
null
[]
None
null
0
0
0
null
0
null
The function (loadParmDict) defined within the public class called public.The function start at line 2001 and ends at 2096. It contains 77 lines of code and it has a cyclomatic complexity of 18. It takes 2 parameters, represented as [2001.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
loadTree
def loadTree(self):'''Load the contents of the data tree into a set of dicts(self.OverallParms, self.Phases and self.Histogram as well as self.powderDict& self.xtalDict)* The childrenless data tree items are overall parameters/controls for theentire project and are placed in self.OverallParms* Phase items are placed in...
36
101
1
886
0
2,098
2,217
2,098
null
[]
None
null
0
0
0
null
0
null
The function (loadTree) defined within the public class called public.The function start at line 2098 and ends at 2217. It contains 101 lines of code and it has a cyclomatic complexity of 36. The function does not take any parameters and does not return any value..