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
G2shapes.pr_shift_atom
def pr_shift_atom(aList_pr_model_test2,x1,y1,z1,\aList_beads_x,aList_beads_y,aList_beads_z,hist_grid,ii):num_hist = len(aList_r)max_dr = (float(num_hist)-1.0)*hist_grid#num_beads = len(aList_beads_x)#aList_pr_model_test2 = num_hist*[0.0,]##i = 0#while i < num_hist:#aList_pr_model_test2[i] = 0.0#i = i + 1XYZ = np.array(...
3
19
9
178
0
1,081
1,133
1,081
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.pr_shift_atom) defined within the public class called public.The function start at line 1081 and ends at 1133. It contains 19 lines of code and it has a cyclomatic complexity of 3. It takes 9 parameters, represented as [1081.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.recenter_pdb
def recenter_pdb(aList_beads_x,aList_beads_y,aList_beads_z):nbeads = len(aList_beads_x)xsum = 0.0ysum = 0.0zsum = 0.0i = 0while i < nbeads:xsum = xsum + float(aList_beads_x[i])ysum = ysum + float(aList_beads_y[i])zsum = zsum + float(aList_beads_z[i])i = i + 1xmean = xsum/float(nbeads)ymean = ysum/float(nbeads)zmean = z...
3
21
3
157
0
1,137
1,162
1,137
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.recenter_pdb) defined within the public class called public.The function start at line 1137 and ends at 1162. It contains 21 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1137.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes
def G2shapes(Profile,ProfDict,Limits,data,dlg=None):########## FUNCTIONS ######################### NEW 1.1 Calculate intensity from P(r) dropping all scaling factorsdef ft_to_intensity(aList_q,aList_i_calc,aList_r,aList_pr_model,nbeads):num_q = len(aList_q)num_r = len(aList_r)count_q = 0while count_q < num_q:q = float(...
48
510
5
3,412
319
35
2,041
35
null
['num_q', 'scale_xy', 'x2', 'xsum', 'dr12', 'bead_sep3_e', 'pdbfile_in', 'fraction_psv_use', 'delta_h', 'bias_z', 'delta_hist', 'aList_beads_z_new', 'aList_pr', 'r', 'ipt', 'x_bead', 'zsum', 'q', 'sd', 'abs_e_width', 'aList_box_z_all', 'num_aa', 'half_side', 'dx', 'y_bead', 'num_cycles', 'drs_grid', 'j', 'force', 'z', ...
None
null
0
0
0
null
0
null
The function (G2shapes) defined within the public class called public.The function start at line 35 and ends at 2041. It contains 510 lines of code and it has a cyclomatic complexity of 48. It takes 5 parameters, represented as [35.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetFormFactorCoeff
def GetFormFactorCoeff(El):"""Read X-ray form factor coefficients from `atomdata.py` file:param str El: element 1-2 character symbol, case irrevelant:return: `FormFactors`: list of form factor dictionariesEach X-ray form factor dictionary is:* `Symbol`: 4 character element symbol with valence (e.g. 'NI+2')* `Z`: atomic...
5
7
1
81
3
30
51
30
null
['FormFactors', 'Els', 'valences']
None
null
0
0
0
null
0
null
The function (GetFormFactorCoeff) defined within the public class called public.The function start at line 30 and ends at 51. 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
GetEFormFactorCoeff
def GetEFormFactorCoeff(El):"""Read electron form factor coefficients from `atomdata.py` file:param str El: element 1-2 character symbol, case irrevelant:return: `FormFactors`: list of form factor dictionariesEach electrn form factor dictionary is:* `Symbol`: 4 character element symbol (no valence)* `Z`: atomic number*...
5
7
1
81
3
53
73
53
null
['FormFactors', 'Els', 'valences']
None
null
0
0
0
null
0
null
The function (GetEFormFactorCoeff) defined within the public class called public.The function start at line 53 and ends at 73. 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
GetFFtable
def GetFFtable(atomTypes):''' returns a dictionary of form factor data for atom types found in atomTypes:param list atomTypes: list of atom types:return: FFtable, dictionary of form factor data; key is atom type'''FFtable = {}for El in atomTypes:FFs = GetFormFactorCoeff(getElSym(El))for item in FFs:if item['Symbol'] ==...
4
8
1
49
2
75
88
75
null
['FFs', 'FFtable']
None
null
0
0
0
null
0
null
The function (GetFFtable) defined within the public class called public.The function start at line 75 and ends at 88. It contains 8 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
GetEFFtable
def GetEFFtable(atomTypes):''' returns a dictionary of electron form factor data for atom types found in atomTypes:param list atomTypes: list of atom types:return: FFtable, dictionary of form factor data; key is atom type'''FFtable = {}for El in atomTypes:FFs = GetEFormFactorCoeff(getElSym(El))for item in FFs:if item['...
4
8
1
49
2
90
103
90
null
['FFs', 'FFtable']
None
null
0
0
0
null
0
null
The function (GetEFFtable) defined within the public class called public.The function start at line 90 and ends at 103. It contains 8 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
GetORBtable
def GetORBtable(atomTypes):''' returns a dictionary of orbital form factor data for atom types found in atomTypes:param list atomTypes: list of atom types:return: ORBtable, dictionary of orbital form factor data; key is atom type'''ORBtable = {}for El in atomTypes:ORBtable[El] = copy.deepcopy(atmdata.OrbFF[El])return O...
2
5
1
33
1
105
115
105
null
['ORBtable']
None
null
0
0
0
null
0
null
The function (GetORBtable) defined within the public class called public.The function start at line 105 and ends at 115. 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
GetMFtable
def GetMFtable(atomTypes,Landeg):''' returns a dictionary of magnetic form factor data for atom types found in atomTypes:param list atomTypes: list of atom types:param list Landeg: Lande g factors for atomTypes:return: FFtable, dictionary of form factor data; key is atom type'''MFtable = {}for El,gfac in zip(atomTypes,...
4
9
2
64
2
117
132
117
null
['MFtable', 'MFs']
None
null
0
0
0
null
0
null
The function (GetMFtable) defined within the public class called public.The function start at line 117 and ends at 132. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [117.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetBLtable
def GetBLtable(General):''' returns a dictionary of neutron scattering length data for atom types & isotopes found in General:param dict General: dictionary of phase info.; includes AtomTypes & Isotopes:return: BLtable, dictionary of scattering length data; key is atom type'''atomTypes = General['AtomTypes']BLtable = {...
3
11
1
90
4
134
149
134
null
['BLtable', 'isotope', 'ElS', 'atomTypes']
None
null
0
0
0
null
0
null
The function (GetBLtable) defined within the public class called public.The function start at line 134 and ends at 149. 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
getFFvalues
def getFFvalues(FFtables,SQ,ifList=False):'Needs a doc string'if ifList:FFvals = []for El in FFtables:FFvals.append(ScatFac(FFtables[El],SQ)[0])else:FFvals = {}for El in FFtables:FFvals[El] = ScatFac(FFtables[El],SQ)[0]return FFvals
4
11
3
71
1
151
161
151
null
['FFvals']
None
null
0
0
0
null
0
null
The function (getFFvalues) defined within the public class called public.The function start at line 151 and ends at 161. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [151.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
getBLvalues
def getBLvalues(BLtables,ifList=False):'Needs a doc string'if ifList:BLvals = []for El in BLtables:if 'BW-LS' in El:BLvals.append(BLtables[El][1]['BW-LS'][0])else:BLvals.append(BLtables[El][1]['SL'][0])else:BLvals = {}for El in BLtables:if 'BW-LS' in El:BLvals[El] = BLtables[El][1]['BW-LS'][0]else:BLvals[El] = BLtables...
6
17
2
121
1
163
179
163
null
['BLvals']
None
null
0
0
0
null
0
null
The function (getBLvalues) defined within the public class called public.The function start at line 163 and ends at 179. It contains 17 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [163.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
getMFvalues
def getMFvalues(MFtables,SQ,ifList=False):'Needs a doc string'if ifList:MFvals = []for El in MFtables:MFvals.append(MagScatFac(MFtables[El],SQ)[0])else:MFvals = {}for El in MFtables:MFvals[El] = MagScatFac(MFtables[El],SQ)[0]return MFvals
4
11
3
71
1
181
191
181
null
['MFvals']
None
null
0
0
0
null
0
null
The function (getMFvalues) defined within the public class called public.The function start at line 181 and ends at 191. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [181.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetFFC5
def GetFFC5(ElSym):'''Get 5 term form factor and Compton scattering data:param ElSym: str(1-2 character element symbol with proper case);:return El: dictionary with 5 term form factor & compton coefficients'''from . import FormFactors as FFEl = {}FF5 = FF.FFac5term[ElSym]El['fa'] = FF5[:5]El['fc'] = FF5[5]El['fb'] = FF...
1
12
1
93
3
193
209
193
null
['El', 'Cmp5', 'FF5']
None
null
0
0
0
null
0
null
The function (GetFFC5) defined within the public class called public.The function start at line 193 and ends at 209. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetBVS
def GetBVS(Pair,atSeq,Valences):Els = Pair.strip().split('-')iAt = atSeq.index(Els[0])iVal = Valences[iAt][0]if Els[1] in ['O','F','Cl']:iEls = ['O','F','Cl'].index(Els[1])if iVal in atmdata.BVScoeff:return atmdata.BVScoeff[iVal][iEls]else:return 0.0elif Els[1] in ['Br','I','S','Se','Te','N','P','As','H','D']:iEls = ['...
5
18
3
189
4
211
228
211
null
['iVal', 'Els', 'iEls', 'iAt']
None
null
0
0
0
null
0
null
The function (GetBVS) defined within the public class called public.The function start at line 211 and ends at 228. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [211.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CheckElement
def CheckElement(El):'''Check if element El is in the periodic table:param str El: One or two letter element symbol, capitaliztion ignored:returns: True if the element is found'''Elements = []for elem in ET.ElTable:Elements.append(elem[0][0])if El.capitalize() in Elements:return Trueelse:return False
3
8
1
44
1
230
243
230
null
['Elements']
None
null
0
0
0
null
0
null
The function (CheckElement) defined within the public class called public.The function start at line 230 and ends at 243. 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
StripValence
def StripValence(El):'Returns element symbol without valence'if '+' in El:return El.split('+')[0]elif '-' in El:return El.split('-')[0]else:return El
3
8
1
40
0
244
251
244
null
[]
None
null
0
0
0
null
0
null
The function (StripValence) defined within the public class called public.The function start at line 244 and ends at 251. 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
FixValence
def FixValence(El):'Returns the element symbol, even when a valence is present'if '+' in El[-1]: #converts An+/- to A+/-nnum = El[-2]El = El.split(num)[0]+'+'+numif '+0' in El:El = El.split('+0')[0]if '-' in El[-1]:num = El[-2]El = El.split(num)[0]+'-'+numif '-0' in El:El = El.split('-0')[0]return El
5
13
1
102
2
253
265
253
null
['num', 'El']
None
null
0
0
0
null
0
null
The function (FixValence) defined within the public class called public.The function start at line 253 and ends at 265. It contains 13 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
SetAtomColor
def SetAtomColor(El,RGB):'Overrides the default color in the atoms table; not saved'Elem = ET.ElTableElements = [elem[0][0] for elem in Elem]if 'Q' in El: El = 'Q'#patch - remove Qa, etc.ElS = getElSym(El)ET.ElTable[Elements.index(ElS)] = ET.ElTable[Elements.index(ElS)][0:6] + (tuple(RGB),)
3
8
2
78
4
267
274
267
null
['El', 'Elements', 'ElS', 'Elem']
None
null
0
0
0
null
0
null
The function (SetAtomColor) defined within the public class called public.The function start at line 267 and ends at 274. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [267.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetAtomInfo
def GetAtomInfo(El,ifMag=False):'reads element information from atmdata.py'Elem = ET.ElTableif ifMag:Elem = ET.MagElTableElements = [elem[0][0] for elem in Elem]AtomInfo = {}if 'Q' in El: El = 'Q'#patch - remove Qa, etc.ElS = getElSym(El)if El not in atmdata.XrayFF and El not in atmdata.MagFF:if ElS not in atmdata.Xray...
13
33
2
304
7
276
308
276
null
['isotopes', 'Elements', 'El', 'ElS', 'AtomInfo', 'data', 'Elem']
None
null
0
0
0
null
0
null
The function (GetAtomInfo) defined within the public class called public.The function start at line 276 and ends at 308. It contains 33 lines of code and it has a cyclomatic complexity of 13. It takes 2 parameters, represented as [276.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetElInfo
def GetElInfo(El,inst):ElemSym = El.strip().capitalize()if 'X' in inst['Type'][0]:keV = 12.397639/G2mth.getWave(inst)FpMu = FPcalc(GetXsectionCoeff(ElemSym), keV)ElData = GetFormFactorCoeff(ElemSym)[0]ElData['FormulaNo'] = 0.0ElData.update(GetAtomInfo(ElemSym))ElData.update(dict(zip(['fp','fpp','mu'],FpMu)))ElData.upda...
2
16
2
156
4
310
325
310
null
['ElData', 'FpMu', 'keV', 'ElemSym']
None
null
0
0
0
null
0
null
The function (GetElInfo) defined within the public class called public.The function start at line 310 and ends at 325. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [310.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetXsectionCoeff
def GetXsectionCoeff(El):"""Read atom orbital scattering cross sections for fprime calculations via Cromer-Lieberman algorithm:param El: 2 character element symbol:return: Orbs: list of orbitals each a dictionary with detailed orbital information used by FPcalceach dictionary is:* 'OrbName': Orbital name read from file...
11
64
1
480
21
327
409
327
null
['Orb', 'IfBe', 'Energy', 'OrbName', 'filename', 'XSect', 'D', 'Nval', 'xsec', 'AU', 'BB', 'val', 'S', 'LEner', 'LXSect', 'XSecIP', 'BindEn', 'ElS', 'C1', 'Orbs', 'X']
None
null
0
0
0
null
0
null
The function (GetXsectionCoeff) defined within the public class called public.The function start at line 327 and ends at 409. It contains 64 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
GetMagFormFacCoeff
def GetMagFormFacCoeff(El):"""Read magnetic form factor data from atmdata.py:param El: 2 character element symbol:return: MagFormFactors: list of all magnetic form factors dictionaries for element El.each dictionary contains:* 'Symbol':Symbol* 'Z':Z* 'mfa': 4 MA coefficients* 'nfa': 4 NA coefficients* 'mfb': 4 MB coeff...
8
17
1
223
5
411
444
411
null
['mags', 'magData', 'MagFormFactors', 'Els', 'data']
None
null
0
0
0
null
0
null
The function (GetMagFormFacCoeff) defined within the public class called public.The function start at line 411 and ends at 444. It contains 17 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
ScatFac
def ScatFac(El, SQ):"""compute value of form factor:param El: element dictionary defined in GetFormFactorCoeff:param SQ: (sin-theta/lambda)**2:return: real part of form factor"""fa = np.array(El['fa'])fb = np.array(El['fb'])t = -fb[:,np.newaxis]*SQreturn np.sum(fa[:,np.newaxis]*np.exp(t)[:],axis=0)+El.get('fc',0.0)
1
5
2
82
3
446
456
446
null
['t', 'fa', 'fb']
None
null
0
0
0
null
0
null
The function (ScatFac) defined within the public class called public.The function start at line 446 and ends at 456. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [446.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ScatFacDer
def ScatFacDer(El, SQ):"""compute derivative of form factor wrt SQ:param El: element dictionary defined in GetFormFactorCoeff:param SQ: (sin-theta/lambda)**2:return: real part of form factor"""fa = np.array(El['fa'])fb = np.array(El['fb'])t = -fb[:,np.newaxis]*SQreturn -np.sum(fa[:,np.newaxis]*fb[:,np.newaxis]*np.exp(t...
1
5
2
81
3
458
468
458
null
['t', 'fa', 'fb']
None
null
0
0
0
null
0
null
The function (ScatFacDer) defined within the public class called public.The function start at line 458 and ends at 468. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [458.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MagScatFac
def MagScatFac(El, SQ):"""compute value of form factor:param El: element dictionary defined in GetFormFactorCoeff:param SQ: (sin-theta/lambda)**2:param gfac: Lande g factor (normally = 2.0):return: real part of form factor"""mfa = np.array(El['mfa'])mfb = np.array(El['mfb'])nfa = np.array(El['nfa'])nfb = np.array(El['n...
1
13
2
215
11
470
489
470
null
['nt', 'NMF', 'NMF0', 'nfa', 'nfb', 'mfb', 'mfa', 'MMF0', 'MF0', 'MMF', 'mt']
None
null
0
0
0
null
0
null
The function (MagScatFac) defined within the public class called public.The function start at line 470 and ends at 489. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [470.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ClosedFormFF
def ClosedFormFF(Z,SQ,k,N):"""Closed form expressions for FT Slater fxns. IT B Table 1.2.7.4(not used at present - doesn't make sense yet):param Z: element zeta factor:param SQ: (sin-theta/lambda)**2:param k: int principal Bessel fxn order as in <jk>:param N: int powerreturn: form factor"""Z2 = Z**2K2 = 16.0*SQ*np.pi**...
45
85
4
1,043
4
491
585
491
null
['Z2', 'K2pZ2', 'K2', 'K']
None
null
0
0
0
null
0
null
The function (ClosedFormFF) defined within the public class called public.The function start at line 491 and ends at 585. It contains 85 lines of code and it has a cyclomatic complexity of 45. It takes 4 parameters, represented as [491.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
BlenResCW
def BlenResCW(Els,BLtables,wave):''' Computes resonant scattering lengths - single wavelength version (CW)returns bo+b' and b"''''FP = np.zeros(len(Els))FPP = np.zeros(len(Els))for i,El in enumerate(Els):BL = BLtables[El][1]if 'BW-LS' in BL:Re,Im,E0,gam,A,E1,B,E2 = BL['BW-LS'][1:]Emev = 81.80703/wave**2T0 = Emev-E0T1 =...
3
19
3
210
10
587
608
587
null
['T0', 'BL', 'Emev', 'T1', 'D1', 'FPP', 'D2', 'D0', 'FP', 'T2']
None
null
0
0
0
null
0
null
The function (BlenResCW) defined within the public class called public.The function start at line 587 and ends at 608. It contains 19 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [587.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
BlenResTOF
def BlenResTOF(Els,BLtables,wave):''' Computes resonant scattering lengths - multiple wavelength version (TOF)returns bo+b' and b"''''FP = np.zeros((len(Els),len(wave)))FPP = np.zeros((len(Els),len(wave)))BL = [BLtables[el][1] for el in Els]for i,El in enumerate(Els):if 'BW-LS' in BL[i]:Re,Im,E0,gam,A,E1,B,E2 = BL[i]['...
4
19
3
252
10
610
631
610
null
['T0', 'BL', 'Emev', 'T1', 'D1', 'FPP', 'D2', 'D0', 'FP', 'T2']
None
null
0
0
0
null
0
null
The function (BlenResTOF) defined within the public class called public.The function start at line 610 and ends at 631. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [610.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComptonFac
def ComptonFac(El,SQ):"""compute Compton scattering factor:param El: element dictionary:param SQ: (sin-theta/lambda)**2:return: compton scattering factor"""ca = np.array(El['cmpa'])cb = np.array(El['cmpb'])t = -cb[:,np.newaxis]*SQreturn El['cmpz']-np.sum(ca[:,np.newaxis]*np.exp(t),axis=0)
1
5
2
73
3
633
643
633
null
['t', 'ca', 'cb']
None
null
0
0
0
null
0
null
The function (ComptonFac) defined within the public class called public.The function start at line 633 and ends at 643. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [633.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FPcalc.Aitken
def Aitken(Orb, LKev):Nval = Orb['Nval']j = Nval-1LEner = Orb['LEner']for i in range(Nval):if LEner[i] <= LKev: j = iif j > Nval-3: j= Nval-3T = [0,0,0,0,0,0]LXSect = Orb['LXSect']for i in range(3): T[i] = LXSect[i+j] T[i+3] = LEner[i+j]-LKevT[1] = (T[0]*T[4]-T[1]*T[3])/(LEner[j+1]-LEner[j])T[2] = (T[0]*T[5]-T[2]*T[3])...
5
17
2
240
0
652
668
652
null
[]
None
null
0
0
0
null
0
null
The function (FPcalc.Aitken) defined within the public class called public.The function start at line 652 and ends at 668. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [652.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FPcalc.DGauss
def DGauss(Orb,CX,RX,ISig):ALG = (0.11846344252810,0.23931433524968,0.284444444444,0.23931433524968,0.11846344252810)XLG = (0.04691007703067,0.23076534494716,0.5,0.76923465505284,0.95308992296933)D = 0.0B2 = Orb['BB']**2R2 = RX**2XSecIP = Orb['XSecIP']for i in range(5):X = XLG[i]X2 = X**2XS = XSecIP[i]if ISig == 0:S = ...
5
25
4
259
0
670
695
670
null
[]
None
null
0
0
0
null
0
null
The function (FPcalc.DGauss) defined within the public class called public.The function start at line 670 and ends at 695. It contains 25 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [670.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FPcalc
def FPcalc(Orbs, KEv):"""Compute real & imaginary resonant X-ray scattering factors:param Orbs: list of orbital dictionaries as defined in GetXsectionCoeff:param KEv: x-ray energy in keV:return: C: (f',f",mu): real, imaginary parts of resonant scattering & atomic absorption coeff."""def Aitken(Orb, LKev):Nval = Orb['Nv...
8
35
2
295
31
645
729
645
null
['B2', 'ALG', 'LKev', 'j', 'RX', 'R2', 'ElEterm', 'FPP', 'CX', 'XLG', 'C', 'D', 'Nval', 'Corr', 'AU', 'X2', 'BB', 'XS', 'FPPI', 'A', 'S', 'FPI', 'LEner', 'LXSect', 'XSecIP', 'BindEn', 'C1', 'T', 'Mu', 'FP', 'X']
None
null
0
0
0
null
0
null
The function (FPcalc) defined within the public class called public.The function start at line 645 and ends at 729. It contains 35 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [645.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetupGeneral
def SetupGeneral(data, dirname):'''Initialize the General sections of the Phase tree contents. Shouldbe done after changes to the Atoms array.Called by routine SetupGeneral (in :func:`GSASIIphsGUI.UpdatePhaseData`),:func:`GSASIIphsGUI.makeIsoNewPhase`, :func:`GSASIImiscGUI.saveNewPhase`,and in :func:`GSASIIscriptable.S...
63
189
2
2,071
17
734
938
734
null
['ElTypes', 'nSh', 'atomData', 'RBModels', 'badList', 'isotope', 'elem', 'waveType', 'landeg', 'Info', 'generalData', 'F000X', 'F000E', 'EFFtables', 'wType', 'F000N', 'msg']
None
null
0
0
0
null
0
null
The function (SetupGeneral) defined within the public class called public.The function start at line 734 and ends at 938. It contains 189 lines of code and it has a cyclomatic complexity of 63. It takes 2 parameters, represented as [734.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint._init_ctrls
def _init_ctrls(self,prnt,ifMag=False,ifOrbs=False):wx.Dialog.__init__(self, id=-1, name='PickElement',parent=prnt, pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE, title='Pick Element')from . import ElementTable as ETself.butWid = 90if 'nt' in os.name:self.butWid = 50self.SetClientSize(wx.Size(50+18*self.butWid, ...
8
30
4
262
0
20
49
20
null
[]
None
null
0
0
0
null
0
null
The function (wxPoint._init_ctrls) defined within the public class called public.The function start at line 20 and ends at 49. It contains 30 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [20.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint.__init__
def __init__(self, parent,oneOnly=False,ifNone=False,ifMag=False,ifOrbs=False,multiple=False):self.oneOnly = oneOnlyself.ifNone = ifNoneself.multiple = multipleself._init_ctrls(parent,ifMag=ifMag,ifOrbs=ifOrbs)self.elementList = []
1
6
7
62
0
51
56
51
null
[]
None
null
0
0
0
null
0
null
The function (wxPoint.__init__) defined within the public class called public.The function start at line 51 and ends at 56. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [51.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint.ElButton
def ElButton(self, name, pos, tip, color):'Creates an element button widget'self.color = colorif not self.ifNone and name[0] == 'None':returnif self.oneOnly:El = wscs.ColourSelect(label=name[0], parent=self,colour=color,pos=pos, size=wx.Size(self.butWid,23), style=wx.RAISED_BORDER)El.Bind(wx.EVT_BUTTON, self.OnElButton...
9
30
5
287
0
58
92
58
null
[]
None
null
0
0
0
null
0
null
The function (wxPoint.ElButton) defined within the public class called public.The function start at line 58 and ends at 92. It contains 30 lines of code and it has a cyclomatic complexity of 9. It takes 5 parameters, represented as [58.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint.OnElButton
def OnElButton(self, event):if self.oneOnly:El = event.GetEventObject().GetLabel()else:El = event.GetEventObject().GetValue()self.Elem = Elif self.multiple:if El in self.elementList:self.elementList.remove(El)event.GetEventObject().SetBackgroundColour(self.color) # Shows on Macelse:self.elementList.append(El)event.GetE...
5
17
2
138
0
94
110
94
null
[]
None
null
0
0
0
null
0
null
The function (wxPoint.OnElButton) defined within the public class called public.The function start at line 94 and ends at 110. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [94.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint.OnClose
def OnClose(self,event):self.EndModal(wx.ID_OK)
1
2
2
15
0
112
113
112
null
[]
None
null
0
0
0
null
0
null
The function (wxPoint.OnClose) defined within the public class called public.The function start at line 112 and ends at 113. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [112.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
wxPoint
def wxPoint(x,y): return wx.Point(int(x),int(y))class PickElement(wx.Dialog):'''Makes periodic table widget for picking element. Modes:oneOnly if True element symbols are provided, otherwise select valenceifNone if True show None buttonifMag if True present magnetic scatters onlyifOrbs if True present orbital form acto...
1
8
2
44
8
10
113
10
null
['startname', 'i', 'Elems', 'b', 'color', 'El', 'butWid', 'Elem']
None
null
0
0
0
null
0
null
The function (wxPoint) defined within the public class called public.The function start at line 10 and ends at 113. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [10.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_ctrls
def _init_ctrls(self, prnt,list):wx.Dialog.__init__(self, id=-1, name='PickElements',parent=prnt, pos=wx.DefaultPosition, size=wx.Size(580, 360),style=wx.DEFAULT_DIALOG_STYLE, title='Pick Elements')panel = wx.Panel(self)REcolor = wx.Colour(128, 128, 255)Metcolor = wx.Colour(192, 192, 192)Noblecolor = wx.Colour(255, 128...
3
137
3
2,099
0
118
259
118
null
[]
None
null
0
0
0
null
0
null
The function (_init_ctrls) defined within the public class called public.The function start at line 118 and ends at 259. It contains 137 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [118.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnOk
def OnOk(self,event):if self.Elem:self.EndModal(wx.ID_OK)else:self.EndModal(wx.ID_CANCEL)
2
5
2
30
0
261
265
261
null
[]
None
null
0
0
0
null
0
null
The function (OnOk) defined within the public class called public.The function start at line 261 and ends at 265. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [261.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnCancel
def OnCancel(self,event):self.EndModal(wx.ID_CANCEL)
1
2
2
15
0
267
268
267
null
[]
None
null
0
0
0
null
0
null
The function (OnCancel) defined within the public class called public.The function start at line 267 and ends at 268. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [267.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent,list):self._init_ctrls(parent,list)
1
2
3
17
0
270
271
270
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 270 and ends at 271. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [270.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ElButton
def ElButton(self, parent, name, pos, tip, color):Black = wx.Colour(0,0,0)if name in self.Elem:color = BlackEl = wscs.ColourSelect(label=name, parent=parent,colour=color,pos=pos, size=wx.Size(32, 32), style=wx.RAISED_BORDER)El.SetBackgroundColour(color)El.SetLabel(name)if 'phoenix' in wx.version():El.SetToolTip(tip)els...
3
13
6
123
0
273
285
273
null
[]
None
null
0
0
0
null
0
null
The function (ElButton) defined within the public class called public.The function start at line 273 and ends at 285. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [273.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnElButton
def OnElButton(self, event):Black = wx.Colour(0,0,0)btn = event.GetEventObject()El = btn.GetLabel()if btn.GetColour() != Black:for Elem in self.ElTable:if El in Elem:ElColor = Elem[4]if El in self.Elem:btn.SetColour(ElColor)self.Elem.remove(El)else:btn.SetColour(wx.Colour(255,0,0))self.Elem.append(El)
5
14
2
106
0
287
300
287
null
[]
None
null
0
0
0
null
0
null
The function (OnElButton) defined within the public class called public.The function start at line 287 and ends at 300. It contains 14 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [287.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_ctrls
def _init_ctrls(self, parent,choice):l = len(choice)-1wx.Dialog.__init__(self, id=-1, name='Delete', parent=parent,pos=wx.DefaultPosition, size=wx.Size(max(128,64+l*24), 87),style=wx.DEFAULT_DIALOG_STYLE, title='Delete Element')self.Show(True)self.SetAutoLayout(True)self.SetHelpText('Select element to delete')self.SetW...
2
14
3
136
0
304
318
304
null
[]
None
null
0
0
0
null
0
null
The function (_init_ctrls) defined within the public class called public.The function start at line 304 and ends at 318. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [304.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self, parent,choice):DeleteElement.El = ' 'self._init_ctrls(parent,choice)
1
3
3
22
0
320
322
320
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 320 and ends at 322. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [320.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ElButton
def ElButton(self, name, pos):'Needs a doc string'White = wx.Colour(255, 255, 255)El = wscs.ColourSelect(label=name, parent=self, colour = White,pos=pos, size=wx.Size(24, 23), style=wx.RAISED_BORDER)El.Bind(wx.EVT_BUTTON, self.OnDeleteButton)
1
6
3
73
0
324
329
324
null
[]
None
null
0
0
0
null
0
null
The function (ElButton) defined within the public class called public.The function start at line 324 and ends at 329. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [324.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDeleteButton
def OnDeleteButton(self, event):DeleteElement.El=event.GetEventObject().GetLabel()self.EndModal(wx.ID_OK)
1
3
2
28
0
331
333
331
null
[]
None
null
0
0
0
null
0
null
The function (OnDeleteButton) defined within the public class called public.The function start at line 331 and ends at 333. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [331.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDeleteElement
def GetDeleteElement(self):return DeleteElement.El
1
2
1
9
0
335
336
335
null
[]
None
null
0
0
0
null
0
null
The function (GetDeleteElement) defined within the public class called public.The function start at line 335 and ends at 336. 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
main.ClearStartup
def ClearStartup(self):'''Call this after app startup complete because a Drop event is postedwhen GSAS-II is initially started.'''self.startupMode = False
1
2
1
11
0
52
56
52
null
[]
None
null
0
0
0
null
0
null
The function (main.ClearStartup) defined within the public class called public.The function start at line 52 and ends at 56. 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
main.MacOpenFiles
def MacOpenFiles(self, filenames):if self.startupMode:returnfrom . import GSASIIfilesfor project in filenames:#print("Start GSAS-II with project file "+str(project))#GSASIIpath.MacStartGSASII(__file__,project)GSASIIfiles.openInNewTerm(project)
3
6
2
28
0
57
64
57
null
[]
None
null
0
0
0
null
0
null
The function (main.MacOpenFiles) defined within the public class called public.The function start at line 57 and ends at 64. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [57.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
main
def main():'''This routine is called to start the GSAS-II GUI'''import scipy.optimize # loading here addresses problem with build for wx on Piimport wx# the next line removes the need for pythonw. Thanks to Matt Newville!# appears unneeded from wx 4.2.1 onif sys.platform.lower() == 'darwin':wx.PyApp.IsDisplayAvailable ...
4
24
0
145
0
26
72
26
null
[]
None
null
0
0
0
null
0
null
The function (main) defined within the public class called public.The function start at line 26 and ends at 72. It contains 24 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
__init__.OnStart
def OnStart(event):'''Called when the start button is pressed. Changes button label to Pause. When Pause is pressed the label changes to Resume.When either Start or Resume is pressed, the processing loopis started. When Pause is pressed, the loop is stopped. '''self.Pause = False# change button labelif self.btnstart.Ge...
7
20
1
146
0
48
78
48
null
[]
None
null
0
0
0
null
0
null
The function (__init__.OnStart) defined within the public class called public.The function start at line 48 and ends at 78. It contains 20 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
__init__.OnReset
def OnReset(event):'''Called when Reset button is pressed. This stops theprocessing loop and resets the list of integrated files soall images can be reintegrated. '''self.btnstart.SetLabel('Restart')self.Status.SetStatusText('Press Restart to reload and re-integrate images matching filter')if self.timer.IsRunning(): se...
2
8
1
60
0
80
91
80
null
[]
None
null
0
0
0
null
0
null
The function (__init__.OnReset) defined within the public class called public.The function start at line 80 and ends at 91. 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
__init__.OnQuit
def OnQuit(event):'''Stop the processing loop and close the Frame'''if self.timer.IsRunning(): self.timer.Stop() # make sure we stop firstwx.CallAfter(self.Destroy)
2
3
1
30
0
93
97
93
null
[]
None
null
0
0
0
null
0
null
The function (__init__.OnQuit) defined within the public class called public.The function start at line 93 and ends at 97. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__.OnBrowse
def OnBrowse(event):'''Responds when the Browse button is pressed to load a file.The routine determines which button was pressed and gets theappropriate file type and loads it into the appropriate placein the dict.'''if btn3 == event.GetEventObject():dlg = wx.DirDialog(self, 'Select directory for output files',self.par...
4
13
1
85
0
99
116
99
null
[]
None
null
0
0
0
null
0
null
The function (__init__.OnBrowse) defined within the public class called public.The function start at line 99 and ends at 116. 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
__init__.showPDFctrls
def showPDFctrls(event):'''Called to show or hide AutoPDF widgets. Note that TextCtrl's must be included in the sizer layout with .Show(True) before .Show(False) will work properly.'''TestInput()if len(self.pdfList) == 0 or self.params['TableMode']:lbl4b.SetValue(False)self.params['ComputePDF'] = Falselbl4b.Enable(Fals...
11
24
1
239
0
118
147
118
null
[]
None
null
0
0
0
null
0
null
The function (__init__.showPDFctrls) defined within the public class called public.The function start at line 118 and ends at 147. It contains 24 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
__init__.GetGPXInputFile
def GetGPXInputFile(event):'Get and read input from input GPX file'pth = self.params['readdir']lbl = 'Select a project input file'filtyp = 'project file (.gpx)|*.gpx'if event is not None:dlg = wx.FileDialog(self,lbl, pth,style=wx.FD_OPEN,wildcard=filtyp)dlg.CenterOnParent()if dlg.ShowModal() == wx.ID_OK:self.gpxin[3] =...
4
16
1
119
0
149
164
149
null
[]
None
null
0
0
0
null
0
null
The function (__init__.GetGPXInputFile) defined within the public class called public.The function start at line 149 and ends at 164. It contains 16 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
__init__.SetGPXInputFile
def SetGPXInputFile():gpx = G2sc.G2Project(self.gpxin[3])self.imgList = gpx.images()self.histList = gpx.histograms()self.pdfList = gpx.pdfs()if not self.imgList:G2G.G2MessageBox(self,'Error: no images in {}.'.format(self.gpxin[3]))returnself.gpxin[1].SetValue(self.gpxin[3])self.imprm[1].Clear()self.imprm[1].AppendItems...
8
21
0
250
0
165
185
165
null
[]
None
null
0
0
0
null
0
null
The function (__init__.SetGPXInputFile) defined within the public class called public.The function start at line 165 and ends at 185. It contains 21 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__.TestInput
def TestInput(*args,**kwargs):'''Determine if the start button should be enabled and ask for the exporter type with ambiguous extensions'''for dfmt,obj in self.fmtlist.items():fmt = dfmt[1:]if not self.params['outsel'][fmt]: continueif fmt in self.multipleFmtChoices: continueif type(obj) is not list: continue # only on...
25
63
2
403
0
187
257
187
null
[]
None
null
0
0
0
null
0
null
The function (__init__.TestInput) defined within the public class called public.The function start at line 187 and ends at 257. It contains 63 lines of code and it has a cyclomatic complexity of 25. It takes 2 parameters, represented as [187.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__.checkPDFselection
def checkPDFselection():'Read PDF entry from input GPX file & show in GUI'pdfEntry = self.pdfSel.GetStringSelection()if not self.pdfList:self.params['ComputePDF'] = Falselbl4b.Enable(False)returnelse:lbl4b.Enable(True)if pdfEntry not in [i.name for i in self.pdfList]:# strange something -- not selectedself.pdfSel.SetSe...
17
49
0
434
0
259
308
259
null
[]
None
null
0
0
0
null
0
null
The function (__init__.checkPDFselection) defined within the public class called public.The function start at line 259 and ends at 308. It contains 49 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
__init__.ShowbyMode
def ShowbyMode():'create table or non-table integration section of GUI'intPrmSizer.Clear(True)if not self.params['TableMode']:sizer = wx.BoxSizer(wx.HORIZONTAL)self.gpxin[0] = wx.StaticText(mnpnl, wx.ID_ANY,'Project (gpx) file:')sizer.Add(self.gpxin[0])self.gpxin[1] = G2G.ValidatedTxtCtrl(mnpnl,self.gpxin,3,OKcontrol=T...
2
43
0
610
0
310
358
310
null
[]
None
null
0
0
0
null
0
null
The function (__init__.ShowbyMode) defined within the public class called public.The function start at line 310 and ends at 358. It contains 43 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__.OnTableButton
def OnTableButton(event):'''Called to edit/create the distance-dependent parameter look-up table.'''pth = self.params['readdir']readFileList = []parms,fileList = [], []if event.GetEventObject() == self.table[0]:dlg = wx.FileDialog(self, 'Build new table by selecting image control files', pth,style=wx.FD_OPEN| wx.FD_MUL...
17
56
1
472
0
360
417
360
null
[]
None
null
0
0
0
null
0
null
The function (__init__.OnTableButton) defined within the public class called public.The function start at line 360 and ends at 417. It contains 56 lines of code and it has a cyclomatic complexity of 17. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__.ontblModeBtn
def ontblModeBtn(event):if tblModeBtn.GetValue():self.params['TableMode'] = Trueelse:self.params['TableMode'] = FalseShowbyMode()
2
6
1
33
0
478
483
478
null
[]
None
null
0
0
0
null
0
null
The function (__init__.ontblModeBtn) defined within the public class called public.The function start at line 478 and ends at 483. 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
__init__._onSpin
def _onSpin(event):if event: event.Skip()self.ncores = spin.GetValue()
2
3
1
22
0
624
626
624
null
[]
None
null
0
0
0
null
0
null
The function (__init__._onSpin) defined within the public class called public.The function start at line 624 and ends at 626. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,G2frame,PollTime=30.0):def OnStart(event):'''Called when the start button is pressed. Changes button label to Pause. When Pause is pressed the label changes to Resume.When either Start or Resume is pressed, the processing loopis started. When Pause is pressed, the loop is stopped. '''self.Pause = Fals...
8
212
3
2,292
0
47
648
47
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 47 and ends at 648. It contains 212 lines of code and it has a cyclomatic complexity of 8. It takes 3 parameters, represented as [47.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetSourceDir
def SetSourceDir(self,event):'''Use a dialog to get a directory for image files'''dlg = wx.DirDialog(self, 'Select directory for image files',self.params['readdir'],wx.DD_DEFAULT_STYLE)dlg.CenterOnParent()try:if dlg.ShowModal() == wx.ID_OK:self.params['readdir'] = dlg.GetPath()self.readDir.SetValue(self.params['readdir...
3
12
2
86
0
650
663
650
null
[]
None
null
0
0
0
null
0
null
The function (SetSourceDir) defined within the public class called public.The function start at line 650 and ends at 663. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [650.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ShowMatchingFiles
def ShowMatchingFiles(self,value,invalid=False,**kwargs):'''Find and image files matching the imagefile directory (self.params['readdir']) and the image file filter(self.params['filter']) and add this information to the GUI list box'''if invalid: returnif self.PreventReEntryShowMatch: returnself.PreventReEntryShowMatch...
10
32
4
239
0
665
700
665
null
[]
None
null
0
0
0
null
0
null
The function (ShowMatchingFiles) defined within the public class called public.The function start at line 665 and ends at 700. It contains 32 lines of code and it has a cyclomatic complexity of 10. It takes 4 parameters, represented as [665.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnPause
def OnPause(self):'''Respond to Pause, changes text on button/Status line, if neededStops timerself.Pause should already be True'''if self.timer.IsRunning(): self.timer.Stop()if self.btnstart.GetLabel() == 'Restart':returnif self.btnstart.GetLabel() != 'Resume':print('\nPausing autointegration\n')self.btnstart.SetLabel...
4
10
1
70
0
702
715
702
null
[]
None
null
0
0
0
null
0
null
The function (OnPause) defined within the public class called public.The function start at line 702 and ends at 715. It contains 10 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
EnableIntButtons
def EnableIntButtons(self,flag):for item in (self.btnstart,self.btnreset): item.Enable(flag)
2
2
2
26
0
717
718
717
null
[]
None
null
0
0
0
null
0
null
The function (EnableIntButtons) defined within the public class called public.The function start at line 717 and ends at 718. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [717.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
StartLoop
def StartLoop(self):'''Prepare to start autointegration timer loop. Save current Image params for use in future integrationsalso label the window so users understand what is being used'''print('\nStarting new autointegration\n')# make sure all output directories existif self.params['SeparateDir']:for dfmt in self.fmtli...
12
21
1
217
0
720
745
720
null
[]
None
null
0
0
0
null
0
null
The function (StartLoop) defined within the public class called public.The function start at line 720 and ends at 745. It contains 21 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
ArgGen
def ArgGen(self,PDFobj,imgprms,mskprms,xydata):'''generator for arguments for integration/PDF calc'''for newImage in self.currImageList:self.Pause |= self.G2frame.PauseIntegrationif self.Pause:self.OnPause()self.PreventTimerReEntry = Falseself.Raise()returnTableMode = self.params['TableMode']ComputePDF = self.params['C...
4
24
5
173
0
747
772
747
null
[]
None
null
0
0
0
null
0
null
The function (ArgGen) defined within the public class called public.The function start at line 747 and ends at 772. It contains 24 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [747.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnTimerLoop
def OnTimerLoop(self,event):'''A method that is called every :meth:`PollTime` seconds that isused to check for new files and process them. Integrates new images.Also optionally sets up and computes PDF. This is called only after the "Start" button is pressed (then its label reads "Pause").'''if GSASIIpath.GetConfigValu...
14
52
2
400
0
773
836
773
null
[]
None
null
0
0
0
null
0
null
The function (OnTimerLoop) defined within the public class called public.The function start at line 773 and ends at 836. It contains 52 lines of code and it has a cyclomatic complexity of 14. It takes 2 parameters, represented as [773.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ProcessImageMP
def ProcessImageMP(onearg):newImage = onearg[0]print('processing ',newImage)t0 = time.time() # debugProcessImage(*onearg)print('ProcessImageMP time',time.time()-t0)
1
6
1
41
2
838
843
838
null
['newImage', 't0']
None
null
0
0
0
null
0
null
The function (ProcessImageMP) defined within the public class called public.The function start at line 838 and ends at 843. 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
ProcessImage
def ProcessImage(newImage,imgprms,mskprms,xydata,PDFdict,InterpVals,calcModes,outputModes):'''Process one image that is read from file newImage and is integrated into one or more diffraction patterns and optionally each diffraction pattern can be transformed into a pair distribution function.:param str newImage: file n...
24
73
8
669
12
848
948
848
null
['setdist', 'fil', 'fmt', 'limits', 'hists', 'fname', 'pdf', 'outgpx', 'inst', 'hint', 'gpxout', 'savedir']
None
null
0
0
0
null
0
null
The function (ProcessImage) defined within the public class called public.The function start at line 848 and ends at 948. It contains 73 lines of code and it has a cyclomatic complexity of 24. It takes 8 parameters, represented as [848.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetupInterpolation
def SetupInterpolation(dlg):'''Creates an object for interpolating image parameters at a given distance value'''parms = dlg.ReadImageParmTable()IMfileList = dlg.IMfileListcols = dlg.list.GetColumnCount()ParmList = dlg.ParmListnonInterpVars = dlg.nonInterpVarsControlsTable = {}MaskTable = {}for f,m in zip(IMfileList,par...
6
18
1
157
8
951
970
951
null
['MaskTable', 'ControlsTable', 'cols', 'parms', 'IMfileList', 'n', 'ParmList', 'nonInterpVars']
None
null
0
0
0
null
0
null
The function (SetupInterpolation) defined within the public class called public.The function start at line 951 and ends at 970. It contains 18 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
LookupFromTable
def LookupFromTable(dist,parmList):'''Interpolate image parameters for a supplied distance value:param float dist: distance to use for interpolation:returns: a list with 2 items:* a dict with interpolated parameter values,* the closest imctrl'''cols, parms, IMfileList, ParmList, nonInterpVars,ControlsTable,MaskTable = ...
11
39
2
387
10
972
1,019
972
null
['closest', 'r', 'ImageControls', 'x', 'f', 'lbl', 'y', 'ImageMasks', 'imctfile', 'D']
None
null
0
0
0
null
0
null
The function (LookupFromTable) defined within the public class called public.The function start at line 972 and ends at 1019. It contains 39 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [972.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self): self.Image = Noneself.PauseIntegration = Falseself.TutorialImportDir = Noneself.GSASprojectfile = ''self.LastExportDir = ''self.LastGPXdir = ''
1
7
1
35
0
1,028
1,034
1,028
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1028 and ends at 1034. It contains 7 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):self.saveVals = Nonewx.grid.GridCellBoolEditor.__init__(self)
1
3
1
20
0
43
45
43
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 43 and ends at 45. 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
Create
def Create(self, parent, id, evtHandler):'''Create the editing control (wx.CheckBox) when cell is opened for edit'''self._tc = wx.CheckBox(parent, -1, "")self._tc.Bind(wx.EVT_CHECKBOX, self.onCheckSet)self.SetControl(self._tc)if evtHandler:self._tc.PushEventHandler(evtHandler)
2
6
4
60
0
48
56
48
null
[]
None
null
0
0
0
null
0
null
The function (Create) defined within the public class called public.The function start at line 48 and ends at 56. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [48.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onCheckSet
def onCheckSet(self, event):'''Callback used when checkbox is toggled.Makes change to table immediately (creating event)'''if self.saveVals:self.ApplyEdit(*self.saveVals)
2
3
2
22
0
58
63
58
null
[]
None
null
0
0
0
null
0
null
The function (onCheckSet) defined within the public class called public.The function start at line 58 and ends at 63. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [58.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetSize
def SetSize(self, rect):'''Set position/size the edit control within the cell's rectangle.'''#self._tc.SetDimensions(rect.x, rect.y, rect.width+2, rect.height+2, # olderself._tc.SetSize(rect.x, rect.y, rect.width+2, rect.height+2, wx.SIZE_ALLOW_MINUS_ONE)
1
3
2
38
0
66
71
66
null
[]
None
null
0
0
0
null
0
null
The function (SetSize) defined within the public class called public.The function start at line 66 and ends at 71. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [66.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
BeginEdit
def BeginEdit(self, row, col, grid):'''Prepares the edit control by loading the initial value from the table (toggles it since you would not click on it if you were not planning to change it), buts saves the original, pre-change value.Makes change to table immediately.Saves the info needed to make updates in self.saveV...
3
13
4
129
0
73
94
73
null
[]
None
null
0
0
0
null
0
null
The function (BeginEdit) defined within the public class called public.The function start at line 73 and ends at 94. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [73.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
EndEdit
def EndEdit(self, row, col, grid, oldVal=None):'''End editing the cell.This is supposed toreturn None if the value has not changed, but I am not sure that actually works. '''val = int(self._tc.GetValue())if val != oldVal: #self.startValue:?return valelse:return None
2
6
5
39
0
96
105
96
null
[]
None
null
0
0
0
null
0
null
The function (EndEdit) defined within the public class called public.The function start at line 96 and ends at 105. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [96.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ApplyEdit
def ApplyEdit(self, row, col, grid):'''Save the value into the table, and create event. Called after EndEdit(), BeginEdit and onCheckSet.'''val = int(self._tc.GetValue())grid.GetTable().SetValue(row, col, val) # update the table
1
3
4
38
0
107
112
107
null
[]
None
null
0
0
0
null
0
null
The function (ApplyEdit) defined within the public class called public.The function start at line 107 and ends at 112. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [107.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Reset
def Reset(self):'''Reset the value in the control back to its starting value.'''self._tc.SetValue(self.startValue)
1
2
1
16
0
114
117
114
null
[]
None
null
0
0
0
null
0
null
The function (Reset) defined within the public class called public.The function start at line 114 and ends at 117. 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
StartingClick
def StartingClick(self):'''This seems to be needed for BeginEdit to work properly'''pass
1
2
1
7
0
119
121
119
null
[]
None
null
0
0
0
null
0
null
The function (StartingClick) defined within the public class called public.The function start at line 119 and ends at 121. 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
Destroy
def Destroy(self):"final cleanup"super(G2BoolEditor, self).Destroy()
1
3
1
16
0
123
125
123
null
[]
None
null
0
0
0
null
0
null
The function (Destroy) defined within the public class called public.The function start at line 123 and ends at 125. 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
Clone
def Clone(self):'required'return G2BoolEditor()
1
3
1
10
0
127
129
127
null
[]
None
null
0
0
0
null
0
null
The function (Clone) defined within the public class called public.The function start at line 127 and ends at 129. 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
__init__
def __init__(self, parent, rb, onChange=None):#wg.Grid.__init__(self, parent, wx.ID_ANY,size=(-1,200))wg.Grid.__init__(self, parent, wx.ID_ANY)self.SetTable(RBDataTable(rb,onChange), True)# Enable Row movinggridmovers.GridRowMover(self)self.Bind(gridmovers.EVT_GRID_ROW_MOVE, self.OnRowMove, self)self.SetColSize(0, 60)s...
2
16
4
190
0
139
156
139
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 139 and ends at 156. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [139.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnRowMove
def OnRowMove(self,evt):'called when a row move needs to take place'frm = evt.GetMoveRow()# Row being movedto = evt.GetBeforeRow() # Before which row to insertself.GetTable().MoveRow(frm,to)
1
5
2
34
0
158
162
158
null
[]
None
null
0
0
0
null
0
null
The function (OnRowMove) defined within the public class called public.The function start at line 158 and ends at 162. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [158.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
completeEdits
def completeEdits(self):'complete any outstanding edits'if self.IsCellEditControlEnabled(): # complete any grid edits in progress#if GSASIIpath.GetConfigValue('debug'): print ('Completing grid edit')self.SaveEditControlValue()self.HideCellEditControl()self.DisableCellEditControl()
2
6
1
28
0
164
170
164
null
[]
None
null
0
0
0
null
0
null
The function (completeEdits) defined within the public class called public.The function start at line 164 and ends at 170. 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
__init__
def __init__(self,rb,onChange):wg.GridTableBase.__init__(self)self.colLabels = ['Label','Select','Type','x','y','z']self.coords = rb['RBcoords']self.labels = rb['RBlbls']self.types = rb['RBtypes']self.index = rb['RBindex']self.select = rb['RBselection']self.onChange = onChange
1
9
3
79
0
175
183
175
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 175 and ends at 183. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [175.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetNumberRows
def GetNumberRows(self):return len(self.labels)
1
2
1
12
0
186
187
186
null
[]
None
null
0
0
0
null
0
null
The function (GetNumberRows) defined within the public class called public.The function start at line 186 and ends at 187. 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
GetNumberCols
def GetNumberCols(self):return len(self.colLabels)
1
2
1
12
0
188
189
188
null
[]
None
null
0
0
0
null
0
null
The function (GetNumberCols) defined within the public class called public.The function start at line 188 and ends at 189. 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
IsEmptyCell
def IsEmptyCell(self, row, col):return False
1
2
3
11
0
190
191
190
null
[]
None
null
0
0
0
null
0
null
The function (IsEmptyCell) defined within the public class called public.The function start at line 190 and ends at 191. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [190.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetValue
def GetValue(self, row, col):row = self.index[row]if col == 0:return self.labels[row]elif col == 1:if self.select[row]:return '1'else:return ''elif col == 2:return self.types[row]else:return '{:.5f}'.format(self.coords[row][col-3])
5
13
3
79
0
192
204
192
null
[]
None
null
0
0
0
null
0
null
The function (GetValue) defined within the public class called public.The function start at line 192 and ends at 204. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [192.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetValue
def SetValue(self, row, col, value):row = self.index[row]try:if col == 0:self.labels[row] = valueelif col == 1:self.select[row] = bool(value)elif col == 2:self.types[row] = valueelse:self.coords[row][col-3] = float(value)except:passif self.onChange:self.onChange()
6
15
4
94
0
205
219
205
null
[]
None
null
0
0
0
null
0
null
The function (SetValue) defined within the public class called public.The function start at line 205 and ends at 219. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [205.0] and does not return any value..