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
GetPowderPeaks
def GetPowderPeaks(fileName):'Read powder peaks from a file'sind = lambda x: math.sin(x*math.pi/180.)asind = lambda x: 180.*math.asin(x)/math.piwave = 1.54052File = open(fileName,'r')Comments = []peaks = []S = File.readline()while S:if S[:1] == '#':Comments.append(S[:-1])else:item = S.split()if len(item) == 1:peaks.app...
13
48
1
470
13
62
109
62
null
['sth', 'limits', 'Comments', 'File', 'peaks', 'asind', 'item', 'dsp', 'tth', 'Peaks', 'sind', 'wave', 'S']
None
null
0
0
0
null
0
null
The function (GetPowderPeaks) defined within the public class called public.The function start at line 62 and ends at 109. It contains 48 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
GetCheckImageFile
def GetCheckImageFile(G2frame,treeId):'''Try to locate an image file if the project and image have been movedtogether. If the image file cannot be found, request the location fromthe user.:param wx.Frame G2frame: main GSAS-II Frame and data object:param wx.Id treeId: Id for the main tree item for the image:returns: Npi...
14
55
2
523
11
111
184
111
null
['prevnam', 'fil', 'prevext', 'gpxPath', 'Controls', 'pth', 'prevpth', 'wildcard', 'dlg', 'imgPath', 'imagefile']
None
null
0
0
0
null
0
null
The function (GetCheckImageFile) defined within the public class called public.The function start at line 111 and ends at 184. It contains 55 lines of code and it has a cyclomatic complexity of 14. It takes 2 parameters, represented as [111.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
EditImageParms.onClose
def onClose(event):dlg.EndModal(wx.ID_OK)
1
2
1
13
0
189
190
189
null
[]
None
null
0
0
0
null
0
null
The function (EditImageParms.onClose) defined within the public class called public.The function start at line 189 and ends at 190. 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
EditImageParms
def EditImageParms(parent,Data,Comments,Image,filename):dlg = wx.Dialog(parent, wx.ID_ANY, 'Edit image parameters',style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)def onClose(event):dlg.EndModal(wx.ID_OK)mainsizer = wx.BoxSizer(wx.VERTICAL)h,w = Image.size[:2]mainsizer.Add(wx.StaticText(dlg,wx.ID_ANY,'File '+str(filen...
1
54
5
718
6
186
246
186
null
['OKbtn', 'wdgt', 'mainsizer', 'vsizer', 'dlg', 'btnsizer']
None
null
0
0
0
null
0
null
The function (EditImageParms) defined within the public class called public.The function start at line 186 and ends at 246. It contains 54 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [186.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadImage2Tree
def LoadImage2Tree(imagefile,G2frame,Comments,Data,Npix,Image):'''Load an image into the tree. Saves the location of the image, as well as theImageTag (where there is more than one image in the file), if defined.'''ImgNames = G2gd.GetGPXtreeDataNames(G2frame,['IMG ',])TreeLbl = 'IMG '+os.path.basename(imagefile)ImageTa...
11
87
6
787
9
248
337
248
null
['TreeLbl', 'Imax', 'ImageTag', 'imageInfo', 'ImageSection', 'Masks', 'ImgNames', 'Id', 'TreeName']
None
null
0
0
0
null
0
null
The function (LoadImage2Tree) defined within the public class called public.The function start at line 248 and ends at 337. It contains 87 lines of code and it has a cyclomatic complexity of 11. It takes 6 parameters, represented as [248.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadImages
def ReadImages(G2frame,imagefile):'''Read one or more images from a file and put them into the Treeusing image importers. Called only in :meth:`AutoIntFrame.OnTimerLoop`.ToDo: Images are most commonly read in :meth:`GSASIIdataGUI.GSASII.OnImportGeneric`which is called from :meth:`GSASIIdataGUI.GSASII.OnImportImage`it w...
16
58
2
365
9
339
411
339
null
['CreatedIMGitems', 'block', 'errorReport', 'primaryReaders', 'repeat', 'secondaryReaders', 'flag', 'ParentFrame', 'rdbuffer']
None
null
0
0
0
null
0
null
The function (ReadImages) defined within the public class called public.The function start at line 339 and ends at 411. It contains 58 lines of code and it has a cyclomatic complexity of 16. It takes 2 parameters, represented as [339.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SaveMultipleImg
def SaveMultipleImg(G2frame):if not G2frame.GPXtree.GetCount():print ('no images!')returnchoices = G2gd.GetGPXtreeDataNames(G2frame,['IMG ',])if len(choices) == 1:names = choiceselse:dlg = G2G.G2MultiChoiceDialog(G2frame,'Stress/Strain fitting','Select images to fit:',choices)dlg.SetSelections([])names = []if dlg.ShowM...
11
40
1
379
9
414
453
414
null
['imroot', 'File', 'names', 'mask', 'Data', 'keys', 'dlg', 'Id', 'choices']
None
null
0
0
0
null
0
null
The function (SaveMultipleImg) defined within the public class called public.The function start at line 414 and ends at 453. It contains 40 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
PutG2Image
def PutG2Image(filename,Comments,Data,Npix,image):'Write an image as a python pickle - might be better as an .edf file?'File = open(filename,'wb')pickle.dump([Comments,Data,Npix,image],File,2)File.close()return
1
6
5
46
1
455
460
455
null
['File']
None
null
0
0
0
null
0
null
The function (PutG2Image) defined within the public class called public.The function start at line 455 and ends at 460. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [455.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
objectScan
def objectScan(data,tag,indexStack=[]):'''Recursively scan an object looking for unexpected data types.This is used in debug mode to scan .gpx files for objects we did notintend to be there.'''if type(data) is list or type(data) is tuple:for i in range(len(data)):val = objectScan(data[i],tag,indexStack+[i])if val:data[...
14
31
3
206
3
468
505
468
null
['s', 'val', 'unexpectedObject']
None
null
0
0
0
null
0
null
The function (objectScan) defined within the public class called public.The function start at line 468 and ends at 505. It contains 31 lines of code and it has a cyclomatic complexity of 14. It takes 3 parameters, represented as [468.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
pickleLoad
def pickleLoad(fp):return pickle.load(fp,encoding='latin-1')
1
2
1
16
0
507
508
507
null
[]
None
null
0
0
0
null
0
null
The function (pickleLoad) defined within the public class called public.The function start at line 507 and ends at 508. 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
ProjFileOpen
def ProjFileOpen(G2frame,showProvenance=True):'Read a GSAS-II project file and load into the G2 data tree'if not os.path.exists(G2frame.GSASprojectfile):print ('\n*** Error attempt to open project file that does not exist:\n '+ str(G2frame.GSASprojectfile))returnLastSavedUsing = Nonefilep = open(G2frame.GSASprojectfile...
69
170
2
1,616
26
510
688
510
null
['datum', 'xferItems', 'hdata', 'msg', 'fp', 'filep', 'tmpHistIndex', 'LastSavedUsing', 'GPXphase', 'dlg', 'sizeList', 'oldPDF', 'Phases', 'hItems', 'posPrev', 'sub', 'Data', 'updateFromSeq', 'result', 'loc', 'hist', 'GPXhist', 'unexpectedObject', 'Id', 'data', 'deleteSeq']
None
null
0
0
0
null
0
null
The function (ProjFileOpen) defined within the public class called public.The function start at line 510 and ends at 688. It contains 170 lines of code and it has a cyclomatic complexity of 69. It takes 2 parameters, represented as [510.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ProjFileSave
def ProjFileSave(G2frame):'Save a GSAS-II project file'if not G2frame.GPXtree.IsEmpty():try:file = open(G2frame.GSASprojectfile,'wb')except PermissionError:G2G.G2MessageBox(G2frame,'Read only file','Project cannot be saved; change permission & try again')returnprint ('save to file: '+G2frame.GSASprojectfile)# stick the...
11
49
1
381
8
690
740
690
null
['commit', 'Controls', 'file', 'pth', 'name', 'gv', 'g2repo', 'data']
None
null
0
0
0
null
0
null
The function (ProjFileSave) defined within the public class called public.The function start at line 690 and ends at 740. It contains 49 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
SaveIntegration
def SaveIntegration(G2frame,PickId,data,Overwrite=False):'Save image integration results as powder pattern(s)'waves = {'Cu':[1.54051,1.54433],'Ti':[2.74841,2.75207],'Cr':[2.28962,2.29351],'Fe':[1.93597,1.93991],'Co':[1.78892,1.79278],'Mo':[0.70926,0.713543],'Ag':[0.559363,0.563775]}azms = G2frame.Integrate[1]X = G2fram...
31
115
4
1,676
26
742
858
742
null
['azms', 'Comments', 'Controls', 'Ymax', 'item', 'names', 'N', 'Azms', 'nOcc', 'inst', 'codes', 'Ymin', 'Aname', 'valuesdict', 'parms', 'Id', 'Xminmax', 'name', 'Sample', 'dazm', 'Y', 'waves', 'polariz', 'W', 'Name', 'X']
None
null
0
0
0
null
0
null
The function (SaveIntegration) defined within the public class called public.The function start at line 742 and ends at 858. It contains 115 lines of code and it has a cyclomatic complexity of 31. It takes 4 parameters, represented as [742.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
XYsave
def XYsave(G2frame,XY,labelX='X',labelY='Y',names=[]):'Save XY table data'pth = G2G.GetExportPath(G2frame)dlg = wx.FileDialog(G2frame, 'Enter csv filename for XY table', pth, '','XY table file (*.csv)|*.csv',wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)try:if dlg.ShowModal() == wx.ID_OK:filename = dlg.GetPath()filename = os.path....
7
27
5
198
5
860
886
860
null
['header', 'File', 'pth', 'filename', 'dlg']
None
null
0
0
0
null
0
null
The function (XYsave) defined within the public class called public.The function start at line 860 and ends at 886. It contains 27 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [860.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
PeakListSave
def PeakListSave(G2frame,file,peaks):'Save powder peaks to a data file'print ('save peak list to file: '+G2frame.peaklistfile)if not peaks:dlg = wx.MessageDialog(G2frame, 'No peaks!', 'Nothing to save!', wx.OK)try:dlg.ShowModal()finally:dlg.Destroy()returnfor peak in peaks:file.write("%10.4f %12.2f %10.3f %10.3f \n" % ...
4
14
3
91
1
888
901
888
null
['dlg']
None
null
0
0
0
null
0
null
The function (PeakListSave) 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 4. It takes 3 parameters, represented as [888.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
IndexPeakListSave
def IndexPeakListSave(G2frame,peaks):'Save powder peaks from the indexing list'file = open(G2frame.peaklistfile,'wa')print ('save index peak list to file: '+G2frame.peaklistfile)wx.BeginBusyCursor()try:if not peaks:dlg = wx.MessageDialog(G2frame, 'No peaks!', 'Nothing to save!', wx.OK)try:dlg.ShowModal()finally:dlg.Des...
5
19
2
102
2
903
921
903
null
['dlg', 'file']
None
null
0
0
0
null
0
null
The function (IndexPeakListSave) defined within the public class called public.The function start at line 903 and ends at 921. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [903.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExportPowderList
def ExportPowderList(G2frame):'''Returns a list of extensions supported by :func:`ExportPowder`along with their descriptions (note that a extension may be repeatedbut descriptions are unique).This is used in :meth:`GSASIIimgGUI.AutoIntFrame` only.:param wx.Frame G2frame: the GSAS-II main data tree window'''extList = []...
4
12
1
57
2
924
942
924
null
['extList', 'extLabel']
None
null
0
0
0
null
0
null
The function (ExportPowderList) defined within the public class called public.The function start at line 924 and ends at 942. It contains 12 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
ExportPowder
def ExportPowder(G2frame,TreeName,fileroot,extension,hint=''):'''Writes a single powder histogram using the Export routines.This is used in :meth:`GSASIIimgGUI.AutoIntFrame` only.:param wx.Frame G2frame: the GSAS-II main data tree window:param str TreeName: the name of the histogram (PWDR ...) in the data tree:param st...
9
22
5
148
1
944
975
944
null
['filename']
None
null
0
0
0
null
0
null
The function (ExportPowder) defined within the public class called public.The function start at line 944 and ends at 975. It contains 22 lines of code and it has a cyclomatic complexity of 9. It takes 5 parameters, represented as [944.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExportSequentialFullCIF
def ExportSequentialFullCIF(G2frame,seqData,Controls):'''Handles access to CIF exporter a bit differently for sequential fits, as this isnot accessed via the usual export menus'''from . import exportsfrom GSASII.exports import G2export_CIF##################### debug code to reload exporter before each use #####import i...
1
5
3
42
1
977
989
977
null
['obj']
None
null
0
0
0
null
0
null
The function (ExportSequentialFullCIF) defined within the public class called public.The function start at line 977 and ends at 989. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [977.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExportSequential
def ExportSequential(G2frame,data,obj,exporttype):'''Used to export from every phase/dataset in a sequential refinement usinga .Writer method for either projects or phases. Prompts to select histogramsand for phase exports, which phase(s).:param wx.Frame G2frame: the GSAS-II main data tree window:param dict data: the s...
19
66
4
496
5
991
1,067
991
null
['histlist', 'mode', 'filename', 'phaselist', 'dlg']
None
null
0
0
0
null
0
null
The function (ExportSequential) defined within the public class called public.The function start at line 991 and ends at 1067. It contains 66 lines of code and it has a cyclomatic complexity of 19. It takes 4 parameters, represented as [991.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadDIFFaX
def ReadDIFFaX(DIFFaXfile):print ('read '+DIFFaXfile)Layer = {'Laue':'-1','Cell':[False,1.,1.,1.,90.,90.,90,1.],'Width':[[10.,10.],[False,False]],'Layers':[],'Stacking':[],'Transitions':[],'Toler':0.01,'AtInfo':{}}df = open(DIFFaXfile,'r')lines = df.readlines()df.close()struct = FalseStruct = []stack = FalseStack = []t...
38
119
1
1,029
27
1,069
1,191
1,069
null
['width', 'nLayers', 'N', 'cell', 'Layer', 'atomName', 'atom', 'transArray', 'Struct', 'Symm', 'Trans', 'trans', 'stack', 'vals', 'name', 'laueRec', 'df', 'lines', 'atomType', 'diff', 'sameas', 'struct', 'iF', 'newVals', 'iB', 'atomRec', 'Stack']
None
null
0
0
0
null
0
null
The function (ReadDIFFaX) defined within the public class called public.The function start at line 1069 and ends at 1191. It contains 119 lines of code and it has a cyclomatic complexity of 38. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
saveNewPhase.fmtCell
def fmtCell(cell):s = ''for i in cell[0:3]: s += f"{i:.3f}, "for i in cell[3:5]: s += f"{i:.2f}, "s += f"{cell[5]:.2f}"return s
3
6
1
42
0
1,197
1,202
1,197
null
[]
None
null
0
0
0
null
0
null
The function (saveNewPhase.fmtCell) defined within the public class called public.The function start at line 1197 and ends at 1202. 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
saveNewPhase
def saveNewPhase(G2frame,phData,newData,phlbl,msgs,orgFilName):'''create a .gpx file from a structure from the BilbaoSite pseudosym sitesaved in newData'''def fmtCell(cell):s = ''for i in cell[0:3]: s += f"{i:.3f}, "for i in cell[3:5]: s += f"{i:.2f}, "s += f"{cell[5]:.2f}"return sif newData is None:print(phlbl,'empty ...
13
67
6
589
10
1,193
1,272
1,193
null
['sgname', 'num', 'sgsym', 'sgnum', 'newPhase', 'Atoms', 'generalData', 's', 'SGData', 'atom']
None
null
0
0
0
null
0
null
The function (saveNewPhase) defined within the public class called public.The function start at line 1193 and ends at 1272. It contains 67 lines of code and it has a cyclomatic complexity of 13. It takes 6 parameters, represented as [1193.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
mkParmDictfromTree
def mkParmDictfromTree(G2frame,sigDict=None):'''Load the GSAS-II refinable parameters from the tree into dict parmDictUpdating refined values to those from the last cycle. Optionallycompute the s.u. values for the parameters and place them in sigDict.The actions in the routine are used in a number of places aroundthe G...
9
59
2
528
7
1,274
1,360
1,274
null
['consDict', 'covDict', 'rbIds', 'constList', 'parmDict', 'varyList', 'rigidbodyDict']
None
null
0
0
0
null
0
null
The function (mkParmDictfromTree) defined within the public class called public.The function start at line 1274 and ends at 1360. It contains 59 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [1274.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LogCellChanges
def LogCellChanges(G2frame):'''Log varied cell parameters into the data tree notebook'''Controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))if Controls['max cyc'] == 0: return # no fit so no changecovData = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame....
8
21
1
205
8
1,362
1,383
1,362
null
['covData', 'pId', 'parmDict', 'Controls', 'txt', 'hId', 'SGData', 'phasedict']
None
null
0
0
0
null
0
null
The function (LogCellChanges) defined within the public class called public.The function start at line 1362 and ends at 1383. 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
ResetMP
def ResetMP():'''Call after changing Config var 'Multiprocessing_cores' to force a resettingof the useMP from the parameter.'''global ncoresncores = None
1
3
0
10
1
34
39
34
null
['ncores']
None
null
0
0
0
null
0
null
The function (ResetMP) defined within the public class called public.The function start at line 34 and ends at 39. 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
InitMP
def InitMP(allowMP=True):'''Called to initialize use of Multiprocessing'''global useMP,ncoresif ncores is not None: return useMP,ncoresuseMP = Falseif not allowMP:G2fil.G2Print('Multiprocessing disabled')ncores = 0return useMP,ncoresncores = GSASIIpath.GetConfigValue('Multiprocessing_cores',0)if ncores < 0: ncores = mp...
6
15
1
91
2
41
57
41
null
['useMP', 'ncores']
None
null
0
0
0
null
0
null
The function (InitMP) defined within the public class called public.The function start at line 41 and ends at 57. It contains 15 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
InitFobsSqGlobals
def InitFobsSqGlobals(x1,ratio1,shl1,xB1,xF1,im1,lamRatio1,kRatio1,xMask1,Ka21):'''Initialize for the computation of Fobs Squared for powder histograms.Puts lots of junk into the global namespace in this module.'''global x,ratio,shl,xB,xF,im,lamRatio,kRatio,xMask,Ka2,cwx = ma.getdata(x1)cw = np.diff(x)cw = np.append(cw...
1
14
10
103
11
62
78
62
null
['lamRatio', 'im', 'xB', 'Ka2', 'cw', 'x', 'shl', 'xF', 'xMask', 'kRatio', 'ratio']
None
null
0
0
0
null
0
null
The function (InitFobsSqGlobals) defined within the public class called public.The function start at line 62 and ends at 78. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 10 parameters, represented as [62.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputeFobsSqCWbatch
def ComputeFobsSqCWbatch(profList):sInt = 0resList = []for refl,iref in profList:icod = ComputeFobsSqCW(refl,iref)if type(icod) is tuple:resList.append((icod[0],iref))sInt += icod[1]elif icod == -1:resList.append((None,iref))elif icod == -2:breakreturn sInt,resList
5
13
1
81
3
80
92
80
null
['sInt', 'icod', 'resList']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCWbatch) defined within the public class called public.The function start at line 80 and ends at 92. 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
ComputeFobsSqTOFbatch
def ComputeFobsSqTOFbatch(profList):sInt = 0resList = []for refl,iref in profList:icod = ComputeFobsSqTOF(refl,iref)if type(icod) is tuple:resList.append((icod[0],iref))sInt += icod[1]elif icod == -1:resList.append((None,iref))elif icod == -2:breakreturn sInt,resList
5
13
1
81
3
94
106
94
null
['sInt', 'icod', 'resList']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqTOFbatch) defined within the public class called public.The function start at line 94 and ends at 106. 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
ComputeFobsSqCWBbatch
def ComputeFobsSqCWBbatch(profList):sInt = 0resList = []for refl,iref in profList:icod = ComputeFobsSqCWB(refl,iref)if type(icod) is tuple:resList.append((icod[0],iref))sInt += icod[1]elif icod == -1:resList.append((None,iref))elif icod == -2:breakreturn sInt,resList
5
13
1
81
3
108
120
108
null
['sInt', 'icod', 'resList']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCWBbatch) defined within the public class called public.The function start at line 108 and ends at 120. 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
ComputeFobsSqCWAbatch
def ComputeFobsSqCWAbatch(profList):sInt = 0resList = []for refl,iref in profList:icod = ComputeFobsSqCWA(refl,iref)if type(icod) is tuple:resList.append((icod[0],iref))sInt += icod[1]elif icod == -1:resList.append((None,iref))elif icod == -2:breakreturn sInt,resList
5
13
1
81
3
122
134
122
null
['sInt', 'icod', 'resList']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCWAbatch) defined within the public class called public.The function start at line 122 and ends at 134. 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
ComputeFobsSqEDbatch
def ComputeFobsSqEDbatch(profList):sInt = 0resList = []for refl,iref in profList:icod = ComputeFobsSqED(refl,iref)if type(icod) is tuple:resList.append((icod[0],iref))sInt += icod[1]elif icod == -1:resList.append((None,iref))elif icod == -2:breakreturn sInt,resList
5
13
1
81
3
136
148
136
null
['sInt', 'icod', 'resList']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqEDbatch) defined within the public class called public.The function start at line 136 and ends at 148. 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
ComputeFobsSqCW
def ComputeFobsSqCW(refl,iref):yp = np.zeros(len(x)) # not maskedsInt = 0refl8im = 0Wd,fmin,fmax = G2pwd.getWidthsCW(refl[5+im],refl[6+im],refl[7+im],shl)iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))iFin2 = iFinif not iBeg+iFin: #peak below low limit - skip p...
7
29
2
463
8
150
178
150
null
['iBeg2', 'sInt', 'iBeg', 'iFin', 'refl8im', 'yp', 'pos2', 'iFin2']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCW) defined within the public class called public.The function start at line 150 and ends at 178. It contains 29 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [150.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputeFobsSqCWB
def ComputeFobsSqCWB(refl,iref):yp = np.zeros(len(x)) # not maskedrefl8im = 0Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im])iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))if not iBeg+iFin: #peak below low limit - skip...
5
17
2
303
4
180
196
180
null
['refl8im', 'yp', 'iBeg', 'iFin']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCWB) defined within the public class called public.The function start at line 180 and ends at 196. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [180.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputeFobsSqCWA
def ComputeFobsSqCWA(refl,iref):yp = np.zeros(len(x)) # not maskedrefl8im = 0Wd,fmin,fmax = G2pwd.getWidthsCWA(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im],shl)iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))if not iBeg+iFin: #peak below low limit - ...
5
17
2
300
4
198
214
198
null
['refl8im', 'yp', 'iBeg', 'iFin']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqCWA) defined within the public class called public.The function start at line 198 and ends at 214. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [198.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputeFobsSqTOF
def ComputeFobsSqTOF(refl,iref):yp = np.zeros(len(x)) # not maskedrefl8im = 0Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im])iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))if not iBeg+iFin: #peak below low limit - skip...
5
17
2
296
4
216
232
216
null
['refl8im', 'yp', 'iBeg', 'iFin']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqTOF) defined within the public class called public.The function start at line 216 and ends at 232. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [216.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputeFobsSqED
def ComputeFobsSqED(refl,iref):yp = np.zeros(len(x)) # not maskedrefl8im = 0Wd,fmin,fmax = G2pwd.getWidthsED(refl[5+im],refl[6+im],refl[7+im])iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))if not iBeg+iFin: #peak below low limit - skip peakreturn 0if ma.all(xMa...
5
17
2
257
4
234
250
234
null
['refl8im', 'yp', 'iBeg', 'iFin']
None
null
0
0
0
null
0
null
The function (ComputeFobsSqED) defined within the public class called public.The function start at line 234 and ends at 250. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [234.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
InitPwdrProfGlobals
def InitPwdrProfGlobals(im1,x1):'''Initialize for the computation of Fobs Squared for powder histograms.Puts lots of junk into the global namespace in this module.'''global im,x,cw,ycim = im1x = ma.getdata(x1)cw = np.diff(x)cw = np.append(cw,cw[-1])# create local copies of ycalc arrayyc = np.zeros_like(x)
1
7
2
57
4
254
264
254
null
['x', 'im', 'cw', 'yc']
None
null
0
0
0
null
0
null
The function (InitPwdrProfGlobals) defined within the public class called public.The function start at line 254 and ends at 264. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [254.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ComputePwdrProfCW
def ComputePwdrProfCW(profList):'Compute the peaks profile for a set of CW peaks and add into the yc array'for pos,refl,iBeg,iFin,kRatio,shl in profList:fp = G2pwd.getFCJVoigt3(pos,refl[6+im],refl[7+im],shl,x[iBeg:iFin])[0]yc[iBeg:iFin] += refl[11+im]*refl[9+im]*kRatio*fp#/cw[iBeg:iFin]return yc
2
6
1
81
1
266
271
266
null
['fp']
None
null
0
0
0
null
0
null
The function (ComputePwdrProfCW) defined within the public class called public.The function start at line 266 and ends at 271. 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
ComputePwdrProfTOF
def ComputePwdrProfTOF(profList):'Compute the peaks profile for a set of TOF peaks and add into the yc array'for pos,refl,iBeg,iFin in profList:fp = G2pwd.getEpsVoigt(pos,refl[12+im],refl[13+im],refl[6+im],refl[7+im],x[iBeg:iFin])[0]yc[iBeg:iFin] += refl[11+im]*refl[9+im]*fp#*cw[iBeg:iFin]
2
5
1
85
1
273
277
273
null
['fp']
None
null
0
0
0
null
0
null
The function (ComputePwdrProfTOF) defined within the public class called public.The function start at line 273 and ends at 277. 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
ComputePwdrProfCWB
def ComputePwdrProfCWB(profList):'Compute the peaks profile for a set of TOF peaks and add into the yc array'for pos,refl,iBeg,iFin in profList:fp = G2pwd.getEpsVoigt(pos,refl[12+im],refl[13+im],refl[6+im]/1.e4,refl[7+im]/100.,x[iBeg:iFin])[0]/100.yc[iBeg:iFin] += refl[11+im]*refl[9+im]*fpreturn yc
2
6
1
97
1
279
284
279
null
['fp']
None
null
0
0
0
null
0
null
The function (ComputePwdrProfCWB) defined within the public class called public.The function start at line 279 and ends at 284. 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
ComputePwdrProfCWA
def ComputePwdrProfCWA(profList):'Compute the peaks profile for a set of TOF peaks and add into the yc array'for pos,refl,iBeg,iFin,kRatio,shl in profList:fp = G2pwd.getExpFCJVoigt3(pos,refl[12+im],refl[13+im],refl[6+im],refl[7+im],shl,x[iBeg:iFin])[0]yc[iBeg:iFin] += refl[11+im]*refl[9+im]*kRatio*fpreturn yc
2
6
1
95
1
286
291
286
null
['fp']
None
null
0
0
0
null
0
null
The function (ComputePwdrProfCWA) defined within the public class called public.The function start at line 286 and ends at 291. 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
ComputePwdrProfED
def ComputePwdrProfED(profList):'Compute the peaks profile for a set of TOF peaks and add into the yc array'for pos,refl,iBeg,iFin in profList:fp = G2pwd.getPsVoigt(pos,refl[6+im]*1.e4,0.001,x[iBeg:iFin])[0]yc[iBeg:iFin] += refl[9+im]*fpreturn yc
2
6
1
67
1
293
298
293
null
['fp']
None
null
0
0
0
null
0
null
The function (ComputePwdrProfED) defined within the public class called public.The function start at line 293 and ends at 298. 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
StripUnicode
def StripUnicode(string,subs='.'):'''Strip non-ASCII characters from strings:param str string: string to strip Unicode characters from:param str subs: character(s) to place into string in place of eachUnicode character. Defaults to '.':returns: a new string with only ASCII characters'''s = ''for c in string:if ord(c) <...
3
8
2
36
1
41
56
41
null
['s']
None
null
0
0
0
null
0
null
The function (StripUnicode) defined within the public class called public.The function start at line 41 and ends at 56. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [41.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeUniqueLabel
def MakeUniqueLabel(lbl,labellist):'''Make sure that every a label is unique against a list by addingdigits at the end until it is not found in list.:param str lbl: the input label:param list labellist: the labels that have already been encountered:returns: lbl if not found in labellist or lbl with ``_1-9`` (or``_10-99...
6
23
2
131
4
59
89
59
null
['prefix', 'suffix', 'lbl', 'i']
None
null
0
0
0
null
0
null
The function (MakeUniqueLabel) defined within the public class called public.The function start at line 59 and ends at 89. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [59.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetPhaseNames
def GetPhaseNames(fl):''' Returns a list of phase names found under 'Phases' in GSASII gpx fileNB: there is another one of these in GSASIIstrIO.py that uses the gpx filename:param file fl: opened .gpx file:return: list of phase names'''PhaseNames = []while True:try:data = pickle.load(fl)except EOFError:breakdatum = dat...
5
13
1
67
3
149
167
149
null
['data', 'PhaseNames', 'datum']
None
null
0
0
0
null
0
null
The function (GetPhaseNames) defined within the public class called public.The function start at line 149 and ends at 167. 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
SetNewPhase
def SetNewPhase(Name='New Phase',SGData=None,cell=None,Super=None):'''Create a new phase dict with default values for various parameters:param str Name: Name for new Phase:param dict SGData: space group data from :func:`GSASIIspc:SpcGroup`;defaults to data for P 1:param list cell: unit cell parameter list; defaults to[...
5
39
4
332
3
169
219
169
null
['cell', 'phaseData', 'SGData']
None
null
0
0
0
null
0
null
The function (SetNewPhase) defined within the public class called public.The function start at line 169 and ends at 219. It contains 39 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [169.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReadCIF
def ReadCIF(URLorFile):'''Open a CIF, which may be specified as a file name or as a URL using PyCifRW(from James Hester).The open routine gets confused with DOS names that begin with a letter and colon"C:\\dir\" so this routine will try to open the passed name as a file and if thatfails, try it as a URL.Used for CIF im...
4
15
1
64
2
221
253
221
null
['fp', 'cf']
None
null
0
0
0
null
0
null
The function (ReadCIF) defined within the public class called public.The function start at line 221 and ends at 253. 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
TestIndexAll
def TestIndexAll():'''Test if :func:`IndexAllIds` has been called to index all phases andhistograms (this is needed before :func:`G2VarObj` can be used.:returns: Returns True if indexing is needed.'''if PhaseIdLookup or AtomIdLookup or HistIdLookup:return Falsereturn True
4
4
0
16
0
255
263
255
null
[]
None
null
0
0
0
null
0
null
The function (TestIndexAll) defined within the public class called public.The function start at line 255 and ends at 263. It contains 4 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
IndexAllIds
def IndexAllIds(Histograms,Phases):'''Scan through the used phases & histograms and create an indexto the random numbers of phases, histograms and atoms. While doing this,confirm that assigned random numbers are unique -- just in case lightningstrikes twice in the same place.Note: this code assumes that the atom random...
10
47
2
456
5
265
336
265
null
['ranId', 'pId', 'hId', 'label', 'shortname']
None
null
0
0
0
null
0
null
The function (IndexAllIds) defined within the public class called public.The function start at line 265 and ends at 336. It contains 47 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [265.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AddPhase2Index
def AddPhase2Index(rdObj,filename):'''Add a phase to the index during readingUsed where constraints are generated during import (ISODISTORT CIFs)'''ranId = rdObj.Phase['ranId']ph = 'from'+filename #phase is not named yetif ranId in PhaseRanIdLookup: returnmaxph = -1for r in PhaseRanIdLookup:maxph = max(maxph,int(PhaseR...
6
23
2
242
6
338
367
338
null
['ranId', 'pId', 'maxph', 'label', 'shortname', 'ph']
None
null
0
0
0
null
0
null
The function (AddPhase2Index) defined within the public class called public.The function start at line 338 and ends at 367. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [338.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LookupAtomId
def LookupAtomId(pId,ranId):'''Get the atom number from a phase and atom random Id:param int/str pId: the sequential number of the phase:param int ranId: the random Id assigned to an atom:returns: the index number of the atom (str)'''if not AtomRanIdLookup:raise Exception('Error: LookupAtomId called before IndexAllIds ...
6
11
2
83
1
369
386
369
null
['pId']
None
null
0
0
0
null
0
null
The function (LookupAtomId) defined within the public class called public.The function start at line 369 and ends at 386. It contains 11 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [369.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LookupAtomLabel
def LookupAtomLabel(pId,index):'''Get the atom label from a phase and atom index number:param int/str pId: the sequential number of the phase:param int index: the index of the atom in the list of atoms:returns: the label for the atom (str) and the random Id of the atom (int)'''if not AtomIdLookup:raise Exception('Error...
6
11
2
83
1
388
405
388
null
['pId']
None
null
0
0
0
null
0
null
The function (LookupAtomLabel) defined within the public class called public.The function start at line 388 and ends at 405. It contains 11 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [388.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LookupPhaseId
def LookupPhaseId(ranId):'''Get the phase number and name from a phase random Id:param int ranId: the random Id assigned to a phase:returns: the sequential Id (pId) number for the phase (str)'''if not PhaseRanIdLookup:raise Exception('Error: LookupPhaseId called before IndexAllIds was run')if ranId not in PhaseRanIdLoo...
3
6
1
36
0
407
417
407
null
[]
None
null
0
0
0
null
0
null
The function (LookupPhaseId) defined within the public class called public.The function start at line 407 and ends at 417. 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
LookupPhaseName
def LookupPhaseName(pId):'''Get the phase number and name from a phase Id:param int/str pId: the sequential assigned to a phase:returns:(phase,ranId) where phase is the name of the phase (str)and ranId is the random # id for the phase (int)'''if not PhaseIdLookup:raise Exception('Error: LookupPhaseName called before In...
5
9
1
53
1
419
433
419
null
['pId']
None
null
0
0
0
null
0
null
The function (LookupPhaseName) defined within the public class called public.The function start at line 419 and ends at 433. It contains 9 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LookupHistId
def LookupHistId(ranId):'''Get the histogram number and name from a histogram random Id:param int ranId: the random Id assigned to a histogram:returns: the sequential Id (hId) number for the histogram (str)'''if not HistRanIdLookup:raise Exception('Error: LookupHistId called before IndexAllIds was run')if ranId not in ...
3
6
1
36
0
435
445
435
null
[]
None
null
0
0
0
null
0
null
The function (LookupHistId) defined within the public class called public.The function start at line 435 and ends at 445. 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
LookupHistName
def LookupHistName(hId):'''Get the histogram number and name from a histogram Id:param int/str hId: the sequential assigned to a histogram:returns:(hist,ranId) where hist is the name of the histogram (str)and ranId is the random # id for the histogram (int)'''if not HistIdLookup:raise Exception('Error: LookupHistName c...
5
9
1
53
1
447
461
447
null
['hId']
None
null
0
0
0
null
0
null
The function (LookupHistName) defined within the public class called public.The function start at line 447 and ends at 461. It contains 9 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
fmtVarDescr
def fmtVarDescr(varname):'''Return a string with a more complete description for a GSAS-II variable:param str varname: A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a>] or <p>::RBname:<r>:<t>]):returns: a string with the description'''s,l = VarDescr(varname)return s+": "+l
1
3
1
20
0
463
472
463
null
[]
None
null
0
0
0
null
0
null
The function (fmtVarDescr) defined within the public class called public.The function start at line 463 and ends at 472. 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
VarDescr
def VarDescr(varname):'''Return two strings with a more complete description for a GSAS-II variable:param str name: A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a>] or <p>::RBname:<r>:<t>]):returns: (loc,meaning) where loc describes what item the variable is mapped(phase, histogram, etc.) and meaning...
25
68
1
603
5
474
556
474
null
['l', 'hlbl', 'albl', 'lbl', 's']
None
null
0
0
0
null
0
null
The function (VarDescr) defined within the public class called public.The function start at line 474 and ends at 556. It contains 68 lines of code and it has a cyclomatic complexity of 25. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
getVarDescr
def getVarDescr(varname):'''Return a short description for a GSAS-II variable:param str name: A full G2 variable name with 2 or 3 or 4 colons (<p>:<h>:name[:<a1>][:<a2>]):returns: a six element list as [`p`,`h`,`name`,`a1`,`a2`,`description`],where `p`, `h`, `a1`, `a2` are str values or `None`, for the phase number,the...
7
15
1
115
1
558
584
558
null
['l']
None
null
0
0
0
null
0
null
The function (getVarDescr) defined within the public class called public.The function start at line 558 and ends at 584. It contains 15 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
CompileVarDesc
def CompileVarDesc():'''Set the values in the variable lookup tables(:attr:`reVarDesc` and :attr:`reVarStep`).This is called in :func:`getDescr` and :func:`getVarStep` so thisinitialization is always done before use. These variables arealso used in script `makeVarTbl.py` which creates the table in section 3.2of the Sph...
4
144
0
688
0
586
768
586
null
[]
None
null
0
0
0
null
0
null
The function (CompileVarDesc) defined within the public class called public.The function start at line 586 and ends at 768. It contains 144 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
removeNonRefined
def removeNonRefined(parmList):'''Remove items from variable list that are not refined and should notappear as options for constraints:param list parmList: a list of strings of form "p:h:VAR:a" whereVAR is the variable name:returns: a list after removing variables where VAR matches aentry in local variable NonRefinedLi...
3
8
1
71
1
770
786
770
null
['NonRefinedList']
None
null
0
0
0
null
0
null
The function (removeNonRefined) defined within the public class called public.The function start at line 770 and ends at 786. 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
getDescr
def getDescr(name):'''Return a short description for a GSAS-II variable:param str name: The descriptive part of the variable name without colons (:):returns: a short description or None if not found'''CompileVarDesc() # compile the regular expressions, if neededfor key in reVarDesc:m = key.match(name)if m:reVarDesc[key...
4
11
1
51
1
788
805
788
null
['m']
None
null
0
0
0
null
0
null
The function (getDescr) defined within the public class called public.The function start at line 788 and ends at 805. It contains 11 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
getVarStep
def getVarStep(name,parmDict=None):'''Return a step size for computing the derivative of a GSAS-II variable:param str name: A complete variable name (with colons, :):param dict parmDict: A dict with parameter values or None (default):returns: a float that should be an appropriate step size, either fromthe value supplie...
5
12
2
77
2
807
829
807
null
['val', 'm']
None
null
0
0
0
null
0
null
The function (getVarStep) defined within the public class called public.The function start at line 807 and ends at 829. It contains 12 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [807.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GenWildCard
def GenWildCard(varlist):'''Generate wildcard versions of G2 variables. These introduce '*'for a phase, histogram or atom number (but only for one of thesefields) but only when there is more than one matching variable in theinput variable list. So if the input is this::varlist = ['0::AUiso:0', '0::AUiso:1', '1::AUiso:0...
8
23
1
145
7
831
869
831
null
['rexp', 'i1splt', 'item1', 'matchlist', 'nextL', 'currentL', 'wild']
None
null
0
0
0
null
0
null
The function (GenWildCard) defined within the public class called public.The function start at line 831 and ends at 869. It contains 23 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
LookupWildCard
def LookupWildCard(varname,varlist):'''returns a list of variable names from list varnamethat match wildcard name in varname:param str varname: a G2 variable name containing a wildcard(such as \\*::var):param list varlist: the list of all variable names used inthe current project:returns: a list of matching GSAS-II var...
3
3
2
41
1
871
882
871
null
['rexp']
None
null
0
0
0
null
0
null
The function (LookupWildCard) defined within the public class called public.The function start at line 871 and ends at 882. It contains 3 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [871.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
prmLookup
def prmLookup(name,prmDict):'''Looks for a parameter in a min/max dictionary, optionallyconsidering a wild card for histogram or atom number (use ofboth will never occur at the same time).:param name: a GSAS-II parameter name (str, see :func:`getVarDescr`and :func:`CompileVarDesc`) or a :class:`G2VarObj` object.:param ...
4
5
2
47
0
884
904
884
null
[]
None
null
0
0
0
null
0
null
The function (prmLookup) defined within the public class called public.The function start at line 884 and ends at 904. It contains 5 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [884.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_lookup
def _lookup(dic,key):'''Lookup a key in a dictionary, where None returns an empty stringbut an unmatched key returns a question mark. Used in :class:`G2VarObj`'''if key is None:return ""elif key == "*":return "*"else:return dic.get(key,'?')
3
7
2
33
0
907
916
907
null
[]
None
null
0
0
0
null
0
null
The function (_lookup) defined within the public class called public.The function start at line 907 and ends at 916. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [907.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SortVariables.cvnnums
def cvnnums(var):v = []for i in var.split(':'):#if i == '' or i == '*':#v.append(-1)#continuetry:v.append(int(i))except:v.append(-1)return v
3
8
1
41
0
921
931
921
null
[]
None
null
0
0
0
null
0
null
The function (SortVariables.cvnnums) defined within the public class called public.The function start at line 921 and ends at 931. 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
SortVariables
def SortVariables(varlist):'''Sorts variable names in a sensible manner'''def cvnnums(var):v = []for i in var.split(':'):#if i == '' or i == '*':#v.append(-1)#continuetry:v.append(int(i))except:v.append(-1)return vreturn sorted(varlist,key=cvnnums)
1
3
1
17
1
918
932
918
null
['v']
None
null
0
0
0
null
0
null
The function (SortVariables) defined within the public class called public.The function start at line 918 and ends at 932. 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,*args):self.phase = Noneself.histogram = Noneself.name = ''self.atom = Noneif len(args) == 1 and (type(args[0]) is list or type(args[0]) is tuple) and len(args[0]) == 4:# single arg with 4 valuesself.phase,self.histogram,self.name,self.atom = args[0]elif len(args) == 1 and ':' in args[0]:#parse a stri...
19
49
2
516
0
975
1,025
975
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 975 and ends at 1025. It contains 49 lines of code and it has a cyclomatic complexity of 19. It takes 2 parameters, represented as [975.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__str__
def __str__(self):return self.varname()
1
2
1
11
0
1,029
1,030
1,029
null
[]
None
null
0
0
0
null
0
null
The function (__str__) defined within the public class called public.The function start at line 1029 and ends at 1030. 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
__hash__
def __hash__(self):'Allow G2VarObj to be a dict key by implementing hashing'return hash(self.varname())
1
3
1
15
0
1,032
1,034
1,032
null
[]
None
null
0
0
0
null
0
null
The function (__hash__) defined within the public class called public.The function start at line 1032 and ends at 1034. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
varname
def varname(self,hist=None):'''Formats the GSAS-II variable name as a "traditional" GSAS-II variablestring (p:h:<var>:a) or (p:h:<var>):param str/int hist: if specified, overrides the histogram numberwith the specified value:returns: the variable name as a str'''a = ""if self.phase == "*":ph = "*"if self.atom:a = ":" +...
10
25
2
172
0
1,036
1,067
1,036
null
[]
None
null
0
0
0
null
0
null
The function (varname) defined within the public class called public.The function start at line 1036 and ends at 1067. It contains 25 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [1036.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__repr__
def __repr__(self):'''Return the detailed contents of the object'''s = "<"if self.phase == '*':s += "Phases: all; "if self.atom is not None:if ":" in str(self.atom):s += "Rigid body" + str(self.atom) + "; "else:s += "Atom #" + str(self.atom) + "; "elif self.phase is not None:ph =_lookup(PhaseRanIdLookup,self.phase)s +=...
11
29
1
244
0
1,069
1,099
1,069
null
[]
None
null
0
0
0
null
0
null
The function (__repr__) defined within the public class called public.The function start at line 1069 and ends at 1099. It contains 29 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
__eq__
def __eq__(self, other):'''Allow comparison of G2VarObj to other G2VarObj objects or strings.If any field is a wildcard ('*') that field matches.'''if type(other) is str:other = G2VarObj(other)elif type(other) is not G2VarObj:raise Exception("Invalid type ({}) for G2VarObj comparison with {}".format(type(other),other))...
13
15
2
128
0
1,101
1,118
1,101
null
[]
None
null
0
0
0
null
0
null
The function (__eq__) defined within the public class called public.The function start at line 1101 and ends at 1118. It contains 15 lines of code and it has a cyclomatic complexity of 13. It takes 2 parameters, represented as [1101.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
fmtVarByMode
def fmtVarByMode(self, seqmode, note, warnmsg):'''Format a parameter object for display. Note that these changesare only temporary and are only shown only when the Constraintsdata tree is selected.* In a non-sequential refinement or where the mode is 'use-all', thename is converted unchanged to a str* In a sequential r...
8
13
4
98
0
1,120
1,157
1,120
null
[]
None
null
0
0
0
null
0
null
The function (fmtVarByMode) defined within the public class called public.The function start at line 1120 and ends at 1157. It contains 13 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [1120.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_show
def _show(self):'For testing, shows the current lookup table'print ('phases'+ self.IDdict['phases'])print ('hists'+ self.IDdict['hists'])print ('atomDict'+ self.IDdict['atoms'])
1
5
1
39
0
1,159
1,163
1,159
null
[]
None
null
0
0
0
null
0
null
The function (_show) defined within the public class called public.The function start at line 1159 and ends at 1163. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetDefaultSample
def SetDefaultSample():'Fills in default items for the Sample dictionary for Debye-Scherrer & SASD'return {'InstrName':'','ranId':ran.randint(0,sys.maxsize),'Scale':[1.0,True],'Type':'Debye-Scherrer','Absorption':[0.0,False],'DisplaceX':[0.0,False],'DisplaceY':[0.0,False],'Temperature':300.,'Pressure':0.1,'Time':0.0,'F...
1
16
0
191
0
1,166
1,182
1,166
null
[]
None
null
0
0
0
null
0
null
The function (SetDefaultSample) defined within the public class called public.The function start at line 1166 and ends at 1182. It contains 16 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,formatName,longFormatName=None, extensionlist=[],strictExtension=False,):self.formatName = formatName # short string naming file typeif longFormatName: # longer string naming file typeself.longFormatName = longFormatNameelse:self.longFormatName = formatName# define extensions that are allowed for the ...
5
19
5
120
0
1,199
1,223
1,199
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1199 and ends at 1223. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [1199.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'self.errors = ''self.warnings = ''self.SciPy = False#image reader needed scipyself.repeat = Falseself.repeatcount = 0self.readfilename = '?'
1
8
1
36
0
1,226
1,233
1,226
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1226 and ends at 1233. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ExtensionValidator
def ExtensionValidator(self, filename):'''This methods checks if the file has the correct extension:returns:* False if this filename will not be supported by this reader (onlywhen strictExtension is True)* True if the extension matches the list supplied by the reader* None if the reader allows un-registered extensions'...
9
13
2
85
0
1,247
1,269
1,247
null
[]
None
null
0
0
0
null
0
null
The function (ExtensionValidator) defined within the public class called public.The function start at line 1247 and ends at 1269. It contains 13 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [1247.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ContentsValidator
def ContentsValidator(self, filename):'''This routine will attempt to determine if the file can be readwith the current format.This will typically be overridden with a method thattakes a quick scan of [some of]the file contents to do a "sanity" check if the fileappears to match the selected format.the file must be open...
1
2
2
10
0
1,271
1,281
1,271
null
[]
None
null
0
0
0
null
0
null
The function (ContentsValidator) defined within the public class called public.The function start at line 1271 and ends at 1281. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1271.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CIFValidator
def CIFValidator(self, filepointer):'''A :meth:`ContentsValidator` for use to validate CIF files.'''filepointer.seek(0)for i,l in enumerate(filepointer):if i >= 1000: return True'''Encountered only blank lines or comments in first 1000lines. This is unlikely, but assume it is CIF anyway, since we areeven less likely to...
9
20
2
139
0
1,283
1,308
1,283
null
[]
None
null
0
0
0
null
0
null
The function (CIFValidator) defined within the public class called public.The function start at line 1283 and ends at 1308. It contains 20 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [1283.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):# call parent __init__ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.Phase = None # a phase must be created with G2IO.SetNewPhase in the Readerself.SymOps = {} # specified when symmetry ...
1
7
5
51
0
1,321
1,328
1,321
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1321 and ends at 1328. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1321.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)# define contents of Structure Factor entryself.Parameters = []'self.Parameters is a list with two dicts for data parameter settings'self.InitPa...
1
9
5
73
0
1,349
1,366
1,349
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1349 and ends at 1366. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1349.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'ImportBaseclass.ReInitialize(self)self.InitParameters()self.Banks = [] #for multi bank data (usually TOF)self.RefDict = {'RefList':[],'FF':{},'Super':0}
1
6
1
42
0
1,367
1,372
1,367
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1367 and ends at 1372. 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
InitParameters
def InitParameters(self):'initialize the instrument parameters structure'Lambda = 0.70926HistType = 'SXC'self.Parameters = [{'Type':[HistType,HistType], # create the structure'Lam':[Lambda,Lambda]}, {}]'Parameters is a list with two dicts for data parameter settings'
1
8
1
41
0
1,374
1,381
1,374
null
[]
None
null
0
0
0
null
0
null
The function (InitParameters) defined within the public class called public.The function start at line 1374 and ends at 1381. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpdateParameters
def UpdateParameters(self,Type=None,Wave=None):'Revise the instrument parameters'if Type is not None:self.Parameters[0]['Type'] = [Type,Type]if Wave is not None:self.Parameters[0]['Lam'] = [Wave,Wave]
3
6
3
56
0
1,383
1,388
1,383
null
[]
None
null
0
0
0
null
0
null
The function (UpdateParameters) defined within the public class called public.The function start at line 1383 and ends at 1388. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1383.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.clockWd = None# used in TOFself.ReInitialize()
1
6
5
45
0
1,400
1,405
1,400
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1400 and ends at 1405. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1400.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'ImportBaseclass.ReInitialize(self)self.powderentry = ['',None,None] #(filename,Pos,Bank)self.powderdata = [] # Powder dataset'''A powder data set is a list with items [x,y,w,yc,yb,yd]:np.array(x), # x-axis valuesnp.array(y), # powder pattern intensitie...
1
18
1
101
0
1,407
1,434
1,407
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1407 and ends at 1434. It contains 18 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,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.ReInitialize()
1
5
5
40
0
1,442
1,447
1,442
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1442 and ends at 1447. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1442.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'ImportBaseclass.ReInitialize(self)self.smallangleentry = ['',None,None] #(filename,Pos,Bank)self.smallangledata = [] # SASD dataset'''A small angle data set is a list with items [x,y,w,yc,yd]:np.array(x), # x-axis valuesnp.array(y), # powder pattern in...
1
12
1
69
0
1,449
1,468
1,449
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1449 and ends at 1468. 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
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.ReInitialize()
1
5
5
40
0
1,476
1,481
1,442
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1476 and ends at 1481. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1442.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'ImportBaseclass.ReInitialize(self)self.smallangleentry = ['',None,None] #(filename,Pos,Bank)self.smallangledata = [] # SASD dataset'''A small angle data set is a list with items [x,y,w,yc,yd]:np.array(x), # x-axis valuesnp.array(y), # powder pattern in...
1
12
1
69
0
1,483
1,502
1,449
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1483 and ends at 1502. 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
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.ReInitialize()
1
5
5
40
0
1,510
1,515
1,442
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1510 and ends at 1515. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1442.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings'ImportBaseclass.ReInitialize(self)self.pdfentry = ['',None,None] #(filename,Pos,Bank)self.pdfdata = [] # PDF G(R) dataset'''A pdf g(r) data set is a list with items [x,y]:np.array(x), # r-axis valuesnp.array(y), # pdf g(r)'''self.comments = []self.idst...
1
8
1
46
0
1,517
1,528
1,517
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1517 and ends at 1528. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
__init__
def __init__(self,formatName,longFormatName=None,extensionlist=[],strictExtension=False,):ImportBaseclass.__init__(self,formatName,longFormatName,extensionlist,strictExtension)self.ReInitialize()
1
5
5
40
0
1,587
1,591
1,442
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 1587 and ends at 1591. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [1442.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ReInitialize
def ReInitialize(self):'Reinitialize the Reader to initial settings -- not used at present'ImportBaseclass.ReInitialize(self)self.InitParameters()
1
4
1
17
0
1,593
1,596
1,593
null
[]
None
null
0
0
0
null
0
null
The function (ReInitialize) defined within the public class called public.The function start at line 1593 and ends at 1596. 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..