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
Limych_ha-apparent-temperature
public
public
0
0
test_entity_initialization
async def test_entity_initialization(hass: HomeAssistant):"""Test sensor initialization."""entity = ApparentTemperatureSensor(None, TEST_NAME, TEST_SOURCES)assert entity.unique_id is Noneentity = ApparentTemperatureSensor(TEST_UNIQUE_ID, TEST_NAME, TEST_SOURCES)entity.hass = hassassert entity.unique_id == TEST_UNIQUE_I...
1
26
1
152
1
210
244
210
null
['entity']
None
null
0
0
0
null
0
null
The function (test_entity_initialization) defined within the public class called public.The function start at line 210 and ends at 244. It contains 26 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Limych_ha-apparent-temperature
public
public
0
0
test_async_setup_platform
async def test_async_setup_platform(hass: HomeAssistant, temp, humi, wind, expected):"""Test platform setup."""await async_setup_test_entities(hass)await hass.async_start()await hass.async_block_till_done()hass.states.async_set("weather.test_monitored","0",{ATTR_WEATHER_TEMPERATURE: temp,ATTR_WEATHER_TEMPERATURE_UNIT: ...
1
28
5
176
1
256
287
256
null
['state']
None
null
0
0
0
null
0
null
The function (test_async_setup_platform) defined within the public class called public.The function start at line 256 and ends at 287. It contains 28 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [256.0] and does not return any value..
Limych_ha-apparent-temperature
public
public
0
0
test__get_temperature
async def test__get_temperature(hass: HomeAssistant):"""Test temperature getter."""await async_setup_test_entities(hass)entity = ApparentTemperatureSensor(TEST_UNIQUE_ID, TEST_NAME, TEST_SOURCES)entity.hass = hassassert entity._get_temperature(None) is Noneassert entity._get_temperature("sensor.unexistent") is Noneasse...
1
9
1
80
1
290
301
290
null
['entity']
None
null
0
0
0
null
0
null
The function (test__get_temperature) defined within the public class called public.The function start at line 290 and ends at 301. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Limych_ha-apparent-temperature
public
public
0
0
test__get_humidity
async def test__get_humidity(hass: HomeAssistant):"""Test humidity getter."""await async_setup_test_entities(hass)entity = ApparentTemperatureSensor(TEST_UNIQUE_ID, TEST_NAME, TEST_SOURCES)entity.hass = hassassert entity._get_humidity(None) is Noneassert entity._get_humidity("sensor.unexistent") is Noneassert entity._g...
1
8
1
68
1
304
314
304
null
['entity']
None
null
0
0
0
null
0
null
The function (test__get_humidity) defined within the public class called public.The function start at line 304 and ends at 314. 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..
Limych_ha-apparent-temperature
public
public
0
0
test__get_wind_speed
async def test__get_wind_speed(hass: HomeAssistant):"""Test wind speed getter."""await async_setup_test_entities(hass)entity = ApparentTemperatureSensor(TEST_UNIQUE_ID, TEST_NAME, TEST_SOURCES)entity.hass = hassassert entity._get_wind_speed(None) == 0.0assert entity._get_wind_speed("sensor.unexistent") == 0.0assert ent...
1
15
1
130
1
317
334
317
null
['entity']
None
null
0
0
0
null
0
null
The function (test__get_wind_speed) defined within the public class called public.The function start at line 317 and ends at 334. It contains 15 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Limych_ha-apparent-temperature
public
public
0
0
test_async_update
async def test_async_update(hass: HomeAssistant):"""Test platform setup."""await async_setup_test_entities(hass)entity = ApparentTemperatureSensor(TEST_UNIQUE_ID, TEST_NAME, ["weather.nonexistent"])entity.hass = hassentity._temp = "weather.nonexistent"entity._humd = "weather.test_monitored"await entity.async_update()as...
1
31
1
177
1
337
374
337
null
['entity']
None
null
0
0
0
null
0
null
The function (test_async_update) defined within the public class called public.The function start at line 337 and ends at 374. It contains 31 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
lint
def lint(session: nox.Session) -> None:"""Run the linter."""session.install("pre-commit")session.run("pre-commit", "run", "--all-files", "--show-diff-on-failure", *session.posargs)
1
5
1
35
0
15
22
15
null
[]
None
null
0
0
0
null
0
null
The function (lint) defined within the public class called public.The function start at line 15 and ends at 22. 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
pylint
def pylint(session: nox.Session) -> None:"""Run PyLint."""# This needs to be installed into the package environment, and is slower# than a pre-commit checksession.install(".", "pylint")session.run("pylint", "gsas_ii", *session.posargs)
1
3
1
33
0
26
33
26
null
[]
None
null
0
0
0
null
0
null
The function (pylint) defined within the public class called public.The function start at line 26 and ends at 33. 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
tests
def tests(session: nox.Session) -> None:"""Run the unit and regular tests."""session.install(".[test]")session.run("pytest", *session.posargs)
1
3
1
29
0
37
42
37
null
[]
None
null
0
0
0
null
0
null
The function (tests) defined within the public class called public.The function start at line 37 and ends at 42. 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
docs
def docs(session: nox.Session) -> None:"""Build the docs. Pass "--serve" to serve. Pass "-b linkcheck" to check links."""parser = argparse.ArgumentParser()parser.add_argument("--serve", action="store_true", help="Serve after building")parser.add_argument("-b", dest="builder", default="html", help="Build target (default...
6
29
1
178
3
46
84
46
null
['parser', 'extra_installs', 'shared_args']
None
null
0
0
0
null
0
null
The function (docs) defined within the public class called public.The function start at line 46 and ends at 84. It contains 29 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
build_api_docs
def build_api_docs(session: nox.Session) -> None:"""Build (regenerate) API docs."""session.install("sphinx")session.chdir("docs")session.run("sphinx-apidoc","-o","api/","--module-first","--no-toc","--force","../src/gsas_ii",)
1
12
1
43
0
88
103
88
null
[]
None
null
0
0
0
null
0
null
The function (build_api_docs) defined within the public class called public.The function start at line 88 and ends at 103. 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
build
def build(session: nox.Session) -> None:"""Build an SDist and wheel."""build_path = DIR.joinpath("build")if build_path.exists():shutil.rmtree(build_path)session.install("build")session.run("python", "-m", "build")
2
6
1
49
1
107
117
107
null
['build_path']
None
null
0
0
0
null
0
null
The function (build) defined within the public class called public.The function start at line 107 and ends at 117. 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_coll_ABOUT_Items
def _init_coll_ABOUT_Items(self, parent):parent.Append(wxID_ABSORBABOUT,'About')self.Bind(wx.EVT_MENU, self.OnABOUTItems0Menu, id=wxID_ABSORBABOUT)
1
3
2
31
0
93
96
93
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_ABOUT_Items) defined within the public class called public.The function start at line 93 and ends at 96. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [93.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_menuBar1_Menus
def _init_coll_menuBar1_Menus(self, parent):parent.Append(menu=self.ABSORB, title='Absorb')parent.Append(menu=self.KALPHA, title='Kalpha')parent.Append(menu=self.ABOUT, title='About')
1
4
2
49
0
98
102
98
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_menuBar1_Menus) defined within the public class called public.The function start at line 98 and ends at 102. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [98.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnCrkaMenu
def OnCrkaMenu(event):self.SetWaveEnergy(2.28962)
1
2
1
13
0
106
107
106
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnCrkaMenu) defined within the public class called public.The function start at line 106 and ends at 107. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnMnkaMenu
def OnMnkaMenu(event):self.SetWaveEnergy(2.10174)
1
2
1
13
0
109
110
109
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnMnkaMenu) defined within the public class called public.The function start at line 109 and ends at 110. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnFekaMenu
def OnFekaMenu(event):self.SetWaveEnergy(1.93597)
1
2
1
13
0
112
113
112
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnFekaMenu) 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. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnCokaMenu
def OnCokaMenu(event):self.SetWaveEnergy(1.78896)
1
2
1
13
0
115
116
115
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnCokaMenu) defined within the public class called public.The function start at line 115 and ends at 116. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnNikaMenu
def OnNikaMenu(event):self.SetWaveEnergy(1.65784)
1
2
1
13
0
118
119
118
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnNikaMenu) defined within the public class called public.The function start at line 118 and ends at 119. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnCukaMenu
def OnCukaMenu(event):self.SetWaveEnergy(1.54052)
1
2
1
13
0
121
122
121
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnCukaMenu) defined within the public class called public.The function start at line 121 and ends at 122. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnZnkaMenu
def OnZnkaMenu(event):self.SetWaveEnergy(1.43510)
1
2
1
13
0
124
125
124
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnZnkaMenu) defined within the public class called public.The function start at line 124 and ends at 125. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnGakaMenu
def OnGakaMenu(event):self.SetWaveEnergy(1.34134)
1
2
1
13
0
127
128
127
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnGakaMenu) defined within the public class called public.The function start at line 127 and ends at 128. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnMokaMenu
def OnMokaMenu(event):self.SetWaveEnergy(0.70926)
1
2
1
13
0
130
131
130
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnMokaMenu) defined within the public class called public.The function start at line 130 and ends at 131. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnAgkaMenu
def OnAgkaMenu(event):self.SetWaveEnergy(0.55936)
1
2
1
13
0
133
134
133
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnAgkaMenu) defined within the public class called public.The function start at line 133 and ends at 134. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items.OnInkaMenu
def OnInkaMenu(event):self.SetWaveEnergy(0.51357)
1
2
1
13
0
136
137
136
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items.OnInkaMenu) defined within the public class called public.The function start at line 136 and ends at 137. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_KALPHA_Items
def _init_coll_KALPHA_Items(self, parent):"Set of characteristic radiation from sealed tube sources"def OnCrkaMenu(event):self.SetWaveEnergy(2.28962)def OnMnkaMenu(event):self.SetWaveEnergy(2.10174)def OnFekaMenu(event):self.SetWaveEnergy(1.93597)def OnCokaMenu(event):self.SetWaveEnergy(1.78896)def OnNikaMenu(event):se...
1
35
2
272
0
104
160
104
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_KALPHA_Items) defined within the public class called public.The function start at line 104 and ends at 160. It contains 35 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [104.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_coll_ABSORB_Items
def _init_coll_ABSORB_Items(self, parent):parent.Append(wxID_NEW,'&New Element','Add new element')self.Delete = parent.Append(wxID_DELETE,'&Delete Element','Delete an element')self.Delete.Enable(False)parent.Append(wxID_EXIT,'&Exit','Exit Fprime')self.Bind(wx.EVT_MENU, self.OnExitMenu, id=wxID_EXIT)self.Bind(wx.EVT_MEN...
1
8
2
97
0
162
169
162
null
[]
None
null
0
0
0
null
0
null
The function (_init_coll_ABSORB_Items) defined within the public class called public.The function start at line 162 and ends at 169. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [162.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
_init_utils
def _init_utils(self):self.ABSORB = wx.Menu(title='')self.KALPHA = wx.Menu(title='')self.KALPHA.SetEvtHandlerEnabled(True)self.ABOUT = wx.Menu(title='')self.menuBar1 = wx.MenuBar()self._init_coll_ABSORB_Items(self.ABSORB)self._init_coll_KALPHA_Items(self.KALPHA)self._init_coll_ABOUT_Items(self.ABOUT)self._init_coll_men...
1
10
1
90
0
171
184
171
null
[]
None
null
0
0
0
null
0
null
The function (_init_utils) defined within the public class called public.The function start at line 171 and ends at 184. It contains 10 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_ctrls
def _init_ctrls(self, parent):wx.Frame.__init__(self, parent=parent,size=wx.Size(500, 400),style=wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX, title='Absorb')self._init_utils()self.SetMenuBar(self.menuBar1)self.DrawPanel()
1
6
2
62
0
186
191
186
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 186 and ends at 191. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [186.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetSize
def SetSize(self):w,h = self.GetClientSize()self.panel.SetSize(wx.Size(w,h))
1
3
1
29
0
193
195
193
null
[]
None
null
0
0
0
null
0
null
The function (SetSize) defined within the public class called public.The function start at line 193 and ends at 195. 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
DrawPanel
def DrawPanel(self):self.panel = wx.Panel(self)mainSizer = wx.BoxSizer(wx.VERTICAL)self.Results = wx.TextCtrl( parent=self.panel,style=wx.TE_MULTILINE|wx.TE_DONTWRAP )self.Results.SetEditable(False)mainSizer.Add(self.Results,1,wx.EXPAND)mainSizer.Add((10,15),0)if self.Elems:lablSizer = wx.BoxSizer(wx.HORIZONTAL)lablSiz...
3
103
1
1,541
0
197
311
197
null
[]
None
null
0
0
0
null
0
null
The function (DrawPanel) defined within the public class called public.The function start at line 197 and ends at 311. It contains 103 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
__init__
def __init__(self, parent):self._init_ctrls(parent)self.parent = parentself.Lines = []self.Elems = []self.linePicked = None
1
6
2
35
0
313
318
313
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 313 and ends at 318. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [313.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnExitMenu
def OnExitMenu(self, event):self.parent.G2plotNB.Delete('Absorb')self.Close()self.Destroy()
1
4
2
27
0
320
323
320
null
[]
None
null
0
0
0
null
0
null
The function (OnExitMenu) defined within the public class called public.The function start at line 320 and ends at 323. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [320.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnNewMenu
def OnNewMenu(self, event):ElList = []for Elem in self.Elems: ElList.append(Elem[0])PE = G2elemGUI.PickElements(self,ElList)if PE.ShowModal() == wx.ID_OK:Elem = PE.ElemPE.Destroy()if Elem:for El in Elem:ElemSym = El.strip().upper()if ElemSym not in ElList:atomData = G2elem.GetAtomInfo(ElemSym.capitalize())FormFactors =...
8
27
2
202
0
325
351
325
null
[]
None
null
0
0
0
null
0
null
The function (OnNewMenu) defined within the public class called public.The function start at line 325 and ends at 351. It contains 27 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [325.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDeleteMenu
def OnDeleteMenu(self, event):if len(self.Elems):ElList = []for Elem in self.Elems: ElList.append(Elem[0])S = []DE = G2elemGUI.DeleteElement(self,ElList)if DE.ShowModal() == wx.ID_OK:El = DE.GetDeleteElement().strip().upper()for Elem in self.Elems:if Elem[0] != El:S.append(Elem)self.Elems = Sself.CalcFPPS()if not self....
7
20
2
150
0
353
372
353
null
[]
None
null
0
0
0
null
0
null
The function (OnDeleteMenu) defined within the public class called public.The function start at line 353 and ends at 372. It contains 20 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [353.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnNumElem
def OnNumElem(self, event):for Elem in self.Elems:if event.GetEventObject().GetName() == Elem[0]:Elem[2] = float(event.GetEventObject().GetValue())event.GetEventObject().SetValue("%8.2f" % (Elem[2]))self.ifVol = Falseself.SetWaveEnergy(self.Wave)
3
7
2
77
0
374
380
374
null
[]
None
null
0
0
0
null
0
null
The function (OnNumElem) defined within the public class called public.The function start at line 374 and ends at 380. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [374.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText1
def OnSpinText1(self, event):self.SetWaveEnergy(float(self.SpinText1.GetValue()))
1
2
2
22
0
382
383
382
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText1) defined within the public class called public.The function start at line 382 and ends at 383. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [382.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText2
def OnSpinText2(self, event):self.SetWaveEnergy(self.Kev/(float(self.SpinText2.GetValue())))
1
2
2
28
0
385
386
385
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText2) defined within the public class called public.The function start at line 385 and ends at 386. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [385.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText3
def OnSpinText3(self,event):self.Volume = max(10.,float(self.SpinText3.GetValue()))self.ifVol = Trueself.SetWaveEnergy(self.Wave)
1
4
2
40
0
388
391
388
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText3) defined within the public class called public.The function start at line 388 and ends at 391. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [388.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText4
def OnSpinText4(self,event):self.Zcell = max(1,float(self.SpinText4.GetValue()))self.SetWaveEnergy(self.Wave)
1
3
2
34
0
393
395
393
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText4) defined within the public class called public.The function start at line 393 and ends at 395. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [393.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText5
def OnSpinText5(self, event):self.Radius = max(0.01,float(self.SpinText5.GetValue()))self.SetWaveEnergy(self.Wave)
1
3
2
36
0
397
399
397
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText5) defined within the public class called public.The function start at line 397 and ends at 399. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [397.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinText6
def OnSpinText6(self, event):self.Pack = min(1.0,max(0.01,float(self.SpinText6.GetValue())))self.SetWaveEnergy(self.Wave)
1
3
2
43
0
401
403
401
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinText6) defined within the public class called public.The function start at line 401 and ends at 403. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [401.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSpinButton
def OnSpinButton(self, event):move = self.SpinButton.GetValue()/10000.self.Wave = min(max(self.Wave+move,self.Wmin),self.Wmax)self.SpinButton.SetValue(0)self.SetWaveEnergy(self.Wave)
1
5
2
58
0
405
409
405
null
[]
None
null
0
0
0
null
0
null
The function (OnSpinButton) defined within the public class called public.The function start at line 405 and ends at 409. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [405.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnSlider1
def OnSlider1(self, event):if self.ifWave:Wave = float(self.slider1.GetValue())/1000.else:Wave = self.Kev/(float(self.slider1.GetValue())/1000.)self.SetWaveEnergy(Wave)
2
6
2
56
0
411
416
411
null
[]
None
null
0
0
0
null
0
null
The function (OnSlider1) defined within the public class called public.The function start at line 411 and ends at 416. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [411.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetWaveEnergy
def SetWaveEnergy(self,Wave):self.Wave = Waveself.Energy = self.Kev/self.Waveself.Energy = round(self.Energy,4)E = self.EnergyDE = E*self.Eres #smear by defined source resolutionself.SpinText1.SetValue("%.4f" % (self.Wave))self.SpinText2.SetValue("%.4f" % (self.Energy))self.SpinText1.Update()self.SpinText2.Update()if s...
15
87
2
1,028
0
418
505
418
null
[]
None
null
0
0
0
null
0
null
The function (SetWaveEnergy) defined within the public class called public.The function start at line 418 and ends at 505. It contains 87 lines of code and it has a cyclomatic complexity of 15. It takes 2 parameters, represented as [418.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CalcFPPS
def CalcFPPS(self):"""generate f" curves for selected elements does constant delta-lambda/lambda steps over defined range"""FPPS = []if self.Elems:wx.BeginBusyCursor()Corr = self.Zcell*self.Radius*self.Pack/(10.0*self.Volume)try:muT = []for iE,Elem in enumerate(self.Elems):Els = Elem[0]Els = Els = Els.ljust(2).lower()....
9
44
1
346
0
507
553
507
null
[]
None
null
0
0
0
null
0
null
The function (CalcFPPS) defined within the public class called public.The function start at line 507 and ends at 553. It contains 44 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnChoice1
def OnChoice1(self, event):if event.GetString() == "Wavelength":self.ifWave = Trueself.NewFPPlot = Trueself.Wave = round(self.Wave,4)self.slider1.SetRange(int(1000.*self.Wmin),int(1000.*self.Wmax))self.slider1.SetValue(int(1000.*self.Wave))self.SpinText1.SetValue("%6.4f" % (self.Wave))self.SpinText2.SetValue("%7.4f" % ...
3
22
2
241
0
555
576
555
null
[]
None
null
0
0
0
null
0
null
The function (OnChoice1) defined within the public class called public.The function start at line 555 and ends at 576. It contains 22 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [555.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnKeyPress
def OnKeyPress(self,event):if event.key == 'g':mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']self.UpDateAbsPlot(self.Wave,rePlot=False)
2
4
2
40
0
578
581
578
null
[]
None
null
0
0
0
null
0
null
The function (OnKeyPress) defined within the public class called public.The function start at line 578 and ends at 581. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [578.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
UpDateAbsPlot
def UpDateAbsPlot(self,Wave,rePlot=True):"""Plot mu vs wavelength 0.05-3.0A"""xylim = []try:if rePlot:asb = self.Page.figure.get_axes()[1]xylim = asb.get_xlim(),asb.get_ylim()newPlot = Falseexcept:new,plotNum,self.Page,self.fplot,lim = self.parent.G2plotNB.FindPlotTab('Absorb','mpl')self.Page.canvas.mpl_connect('pick_e...
9
61
3
628
0
583
644
583
null
[]
None
null
0
0
0
null
0
null
The function (UpDateAbsPlot) defined within the public class called public.The function start at line 583 and ends at 644. It contains 61 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [583.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnPick
def OnPick(self, event):self.linePicked = event.artist
1
2
2
14
0
646
647
646
null
[]
None
null
0
0
0
null
0
null
The function (OnPick) defined within the public class called public.The function start at line 646 and ends at 647. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [646.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnMotion
def OnMotion(self,event):xpos = event.xdataif xpos and xpos>0.1:ypos = event.ydataif self.ifWave:Wave = xposelse:Wave = self.Kev/xposWave = min(max(Wave,self.Wmin),self.Wmax)self.parent.G2plotNB.status.SetStatusText('Wavelength: %.4f, Energy: %.3f, %sR: %.3f'%(Wave,self.Kev/Wave,Gkmu,ypos),1)if self.linePicked:self.Set...
5
12
2
99
0
649
660
649
null
[]
None
null
0
0
0
null
0
null
The function (OnMotion) defined within the public class called public.The function start at line 649 and ends at 660. It contains 12 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [649.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnRelease
def OnRelease(self, event):if self.linePicked is None: returnself.linePicked = Nonexpos = event.xdataif xpos:if self.ifWave:Wave = xposelse:Wave = self.Kev/xposself.SetWaveEnergy(Wave)
4
10
2
51
0
662
671
662
null
[]
None
null
0
0
0
null
0
null
The function (OnRelease) defined within the public class called public.The function start at line 662 and ends at 671. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [662.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnABOUTItems0Menu
def OnABOUTItems0Menu(self, event):'''Displays the About window'''try:import wx.adv as wxadv# AboutBox moved here in Phoenixexcept:wxadv = wxinfo = wxadv.AboutDialogInfo()info.Name = 'Absorb'info.Copyright = '''Robert B. Von Dreele, 2009(C)Argonne National LaboratoryThis product includes software developedby the UChica...
2
20
2
49
0
673
694
673
null
[]
None
null
0
0
0
null
0
null
The function (OnABOUTItems0Menu) defined within the public class called public.The function start at line 673 and ends at 694. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [673.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
RC2Ftest
def RC2Ftest(npts,RChiSq0,nvar0,RChiSq1,nvar1):'''Compute the F-test probability that a model expanded with addedparameters (relaxed model) is statistically more likely than theconstrained (base) model:param int npts: number of observed diffraction data points:param float RChiSq0: Reduced Chi**2 for the base model:para...
3
12
5
100
4
38
58
38
null
['ratio', 'F', 'nu2', 'nu1']
None
null
0
0
0
null
0
null
The function (RC2Ftest) defined within the public class called public.The function start at line 38 and ends at 58. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [38.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
RwFtest
def RwFtest(npts,Rwp0,nvar0,Rwp1,nvar1):'''Compute the F-test probability that a model expanded with addedparameters (relaxed model) is statistically more likely than theconstrained (base) model:param int npts: number of observed diffraction data points:param float Rwp0: Weighted profile R-factor or GOF for the base mo...
3
12
5
104
4
60
80
60
null
['ratio', 'F', 'nu2', 'nu1']
None
null
0
0
0
null
0
null
The function (RwFtest) defined within the public class called public.The function start at line 60 and ends at 80. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [60.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
82
83
82
null
[]
None
null
0
0
0
null
0
null
The function (pickleLoad) defined within the public class called public.The function start at line 82 and ends at 83. 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
def main(application):'''Start up the GSAS-II GUI'''knownVersions = ['3.9','3.10','3.11','3.12']if '.'.join(platform.python_version().split('.')[:2]) not in knownVersions:dlg = wx.MessageDialog(None,f'GSAS-II Compare requires Python 3.9+\n Yours is {sys.version.split()[0]}','Python version error',wx.OK)try:dlg.ShowModa...
4
20
1
142
2
85
108
85
null
['knownVersions', 'dlg']
None
null
0
0
0
null
0
null
The function (main) defined within the public class called public.The function start at line 85 and ends at 108. It contains 20 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__
def __init__(self, parent):size = wx.Size(700,450)wx.Frame.__init__(self, name='dComp', parent=parent,size=size,style=wx.DEFAULT_FRAME_STYLE, title='GSAS-II data/model comparison')# misc varsself.VcovColor = 'RdYlGn'# plot windowtry:size = GSASIIpath.GetConfigValue('Plot_Size')if type(size) is tuple:passelif type(size)...
10
78
2
864
0
113
222
113
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 113 and ends at 222. It contains 78 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [113.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SelectGPX
def SelectGPX(self):'''Select a .GPX file to be read'''dlg = wx.FileDialog(self, 'Choose GSAS-II project file',wildcard='GSAS-II project file (*.gpx)|*.gpx',style=wx.FD_OPEN)try:if dlg.ShowModal() != wx.ID_OK: returnfil = os.path.splitext(dlg.GetPath())[0]+'.gpx'finally:dlg.Destroy()if os.path.exists(fil):#self.fileLis...
4
13
1
90
0
224
239
224
null
[]
None
null
0
0
0
null
0
null
The function (SelectGPX) defined within the public class called public.The function start at line 224 and ends at 239. 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
SelectMultGPX
def SelectMultGPX(self):'''Select multiple .GPX files to be read'''dlg = wx.FileDialog(self, 'Choose GSAS-II project file',wildcard='GSAS-II project file (*.gpx)|*.gpx',style=wx.FD_OPEN|wx.FD_MULTIPLE)try:if dlg.ShowModal() != wx.ID_OK: returnfiles = dlg.GetPaths()finally:dlg.Destroy()fileList = []for f in files:fil = ...
6
18
1
117
0
241
260
241
null
[]
None
null
0
0
0
null
0
null
The function (SelectMultGPX) defined within the public class called public.The function start at line 241 and ends at 260. 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
getMode
def getMode(self):'''returns the display mode (one of "Histogram","Phase","Project").Could return '?' in case of an error.'''for m in self.wxID_Mode:if self.Mode.FindItemById(self.wxID_Mode[m]).IsChecked():breakelse:m = '?'return m
3
7
1
40
0
262
271
262
null
[]
None
null
0
0
0
null
0
null
The function (getMode) defined within the public class called public.The function start at line 262 and ends at 271. It contains 7 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onRefresh
def onRefresh(self,event):'''reread all files, in response to a change in mode, etc.'''self.GPXtree.DeleteChildren(self.root)# delete tree contentsself.histList = []# clear list of loaded histogramsself.histListOrg = []self.projList = []self.hFilter.Enable(not self.getMode() == "Phase") # Filter disabled for Phase disp...
2
10
2
76
0
273
284
273
null
[]
None
null
0
0
0
null
0
null
The function (onRefresh) defined within the public class called public.The function start at line 273 and ends at 284. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [273.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetModeMenu
def SetModeMenu(self):'''Create the mode-specific menu and its contents'''modeMenu = wx.Menu(title='')oldmenu = self.MenuBar.Replace(self.modeMenuPos,modeMenu,self.getMode())wx.CallAfter(oldmenu.Destroy)if self.getMode() == "Histogram":item = modeMenu.Append(wx.ID_ANY,'Prince test')self.Bind(wx.EVT_MENU, self.onHistPri...
4
12
1
136
0
286
299
286
null
[]
None
null
0
0
0
null
0
null
The function (SetModeMenu) defined within the public class called public.The function start at line 286 and ends at 299. 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
loadFile
def loadFile(self,fil):'''read or reread a file'''if self.getMode() == "Histogram":self.LoadPwdr(fil)elif self.getMode() == "Phase":self.LoadPhase(fil)elif self.getMode() == "Project":self.LoadProject(fil)else:print("mode not implemented")
4
9
2
59
0
301
311
301
null
[]
None
null
0
0
0
null
0
null
The function (loadFile) defined within the public class called public.The function start at line 301 and ends at 311. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [301.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
doneLoad
def doneLoad(self):self.GPXtree.Expand(self.root)if self.getMode() == "Project":overId = self.GPXtree.InsertItem(pos=0,parent=self.root,text='Project Overview')self.GPXtree.SelectItem(overId)
2
5
1
54
0
314
318
314
null
[]
None
null
0
0
0
null
0
null
The function (doneLoad) defined within the public class called public.The function start at line 314 and ends at 318. 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
onLoadGPX
def onLoadGPX(self,event):'''Initial load of GPX file in response to a menu command'''fil = self.SelectGPX()if not fil: returnif not os.path.exists(fil): returnself.fileList.append([fil,'GPX'])self.loadFile(fil)self.doneLoad()
3
7
2
55
0
320
328
320
null
[]
None
null
0
0
0
null
0
null
The function (onLoadGPX) defined within the public class called public.The function start at line 320 and ends at 328. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [320.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onLoadMultGPX
def onLoadMultGPX(self,event):'''Initial load of multiple GPX files in response to a menu command'''for fil in self.SelectMultGPX():if not os.path.exists(fil): continueself.fileList.append([fil,'GPX'])self.loadFile(fil)self.doneLoad()
3
6
2
52
0
330
337
330
null
[]
None
null
0
0
0
null
0
null
The function (onLoadMultGPX) defined within the public class called public.The function start at line 330 and ends at 337. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [330.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onLoadWildGPX
def onLoadWildGPX(self,event,wildcard=None):'''Initial load of GPX file in response to a menu command'''home = os.path.abspath(os.getcwd())hlp = '''Enter a wildcard version of a file name.The directory is assumed to be "{}" unless specified otherwise.Extensions will be set to .gpx and .bak files will be ignored unlesst...
11
33
3
220
0
339
373
339
null
[]
None
null
0
0
0
null
0
null
The function (onLoadWildGPX) defined within the public class called public.The function start at line 339 and ends at 373. It contains 33 lines of code and it has a cyclomatic complexity of 11. It takes 3 parameters, represented as [339.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadPwdr
def LoadPwdr(self,fil):'''Load PWDR entries from a .GPX file to the tree.see :func:`GSASIImiscGUI.ProjFileOpen`'''G2frame = selffilep = open(fil,'rb')shortname = os.path.splitext(os.path.split(fil)[1])[0]wx.BeginBusyCursor()histLoadList = []try:while True:try:data = pickleLoad(filep)except EOFError:breakif not data[0][...
16
52
2
543
0
375
438
375
null
[]
None
null
0
0
0
null
0
null
The function (LoadPwdr) defined within the public class called public.The function start at line 375 and ends at 438. It contains 52 lines of code and it has a cyclomatic complexity of 16. It takes 2 parameters, represented as [375.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onHistFilter
def onHistFilter(self,event):'Load a filter string via a dialog in response to a menu event'defval = ''if self.PWDRfilter is not None:defval = self.PWDRfilteruniqueHist = sorted(set(self.histListOrg))dlg = G2G.SingleStringDialog(self,'Set string','Set a string that must be in histogram name',defval, choices=uniqueHist,...
4
18
2
116
0
440
457
440
null
[]
None
null
0
0
0
null
0
null
The function (onHistFilter) defined within the public class called public.The function start at line 440 and ends at 457. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [440.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadPhase
def LoadPhase(self,fil):'''Load Phase entries from a .GPX file to the tree.see :func:`GSASIImiscGUI.ProjFileOpen`'''G2frame = selffilep = open(fil,'rb')shortname = os.path.splitext(os.path.split(fil)[1])[0]wx.BeginBusyCursor()Phases = Nonetry:while True:try:data = pickleLoad(filep)except EOFError:breakif not data[0][0]...
11
47
2
339
0
459
519
459
null
[]
None
null
0
0
0
null
0
null
The function (LoadPhase) defined within the public class called public.The function start at line 459 and ends at 519. It contains 47 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [459.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LoadProject
def LoadProject(self,fil):'''Load the Covariance entry from a .GPX file to the tree.see :func:`GSASIImiscGUI.ProjFileOpen`'''import datetimeG2frame = selffilep = open(fil,'rb')saved = datetime.datetime.fromtimestamp(os.path.getmtime(fil)).strftime("%Y-%h-%d %H:%M")shortname = os.path.splitext(os.path.split(fil)[1])[0]p...
17
53
2
429
0
521
578
521
null
[]
None
null
0
0
0
null
0
null
The function (LoadProject) defined within the public class called public.The function start at line 521 and ends at 578. It contains 53 lines of code and it has a cyclomatic complexity of 17. It takes 2 parameters, represented as [521.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDataTreeSelChanged.ClearData
def ClearData(self):'''Initializes the contents of the dataWindow panel'''self.Unbind(wx.EVT_SIZE)self.SetBackgroundColour(wx.Colour(240,240,240))Sizer = self.GetSizer()if Sizer:try:Sizer.Clear(True)except:pass
3
9
1
50
0
581
591
581
null
[]
None
null
0
0
0
null
0
null
The function (OnDataTreeSelChanged.ClearData) defined within the public class called public.The function start at line 581 and ends at 591. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OnDataTreeSelChanged
def OnDataTreeSelChanged(self,event):def ClearData(self):'''Initializes the contents of the dataWindow panel'''self.Unbind(wx.EVT_SIZE)self.SetBackgroundColour(wx.Colour(240,240,240))Sizer = self.GetSizer()if Sizer:try:Sizer.Clear(True)except:passG2frame = selfitem = event.GetItem()#print('selected',item)lbl = G2frame....
9
45
2
388
0
580
637
580
null
[]
None
null
0
0
0
null
0
null
The function (OnDataTreeSelChanged) defined within the public class called public.The function start at line 580 and ends at 637. It contains 45 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [580.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onProjFtest
def onProjFtest(self,event):'''Compare two projects (selected here if more than two are present)using the statistical F-test (aka Hamilton R-factor test), see:* Hamilton, R. W. (1965), Acta Crystallogr. 18, 502-510.* Prince, E., Mathematical Techniques in Crystallography and Materials Science, Second ed. (Springer-Verl...
21
102
2
735
0
660
770
660
null
[]
None
null
0
0
0
null
0
null
The function (onProjFtest) defined within the public class called public.The function start at line 660 and ends at 770. It contains 102 lines of code and it has a cyclomatic complexity of 21. It takes 2 parameters, represented as [660.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
onHistPrinceTest
def onHistPrinceTest(self,event):'''Compare two histograms (selected here if more than two are present)using the statistical test proposed by Ted Prince inActa Cryst. B35 1099-1100. (1982). Also see Int. Tables Vol. C(1st Ed.) chapter 8.4, 618-621 (1995).'''items = []item, cookie = self.GPXtree.GetFirstChild(self.root)...
9
46
2
329
0
772
841
772
null
[]
None
null
0
0
0
null
0
null
The function (onHistPrinceTest) defined within the public class called public.The function start at line 772 and ends at 841. It contains 46 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [772.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.ft_to_intensity
def 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(aList_q[count_q])# Sets P(r=0) =0.0. Later scaling includes a baseline term. integral = 0.0count_r = 1while count_r < num_r:r = float(aList_r[count_r])pr = float(aLi...
3
17
5
110
0
41
68
41
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.ft_to_intensity) defined within the public class called public.The function start at line 41 and ends at 68. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [41.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.score_Ic
def score_Ic(aList_q,aList_i,aList_i_sd,aList_i_calc):num_q = len(aList_q)idif = 0.0isum = 0.0sd_sq = 0.0chi_sq = 0.0# Least squares scale for calculated I onto observed IS = 0.0Sx = 0.0Sy = 0.0Sxx = 0.0Sxy = 0.0count = 0while count < num_q:x = float(aList_i_calc[count])y = float(aList_i[count])S = S + 1.0Sx = Sx + xSy...
3
40
4
272
0
72
130
72
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.score_Ic) defined within the public class called public.The function start at line 72 and ends at 130. It contains 40 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [72.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.write_all_data
def write_all_data(file_intensity,aList_q,aList_i,aList_i_calc,aString):num_q = len(aList_q)file = open(file_intensity,'w',)aString = '# ' + aString + '\n'file.write(aString)i = 0while i < num_q:q = aList_q[i]intensity = aList_i[i]intensity_calc = aList_i_calc[i]aString = str(q) + ' ' + str(intensity) + ' ' + str(inten...
2
15
5
107
0
134
157
134
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.write_all_data) defined within the public class called public.The function start at line 134 and ends at 157. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [134.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.read_i
def read_i(aList_q,aList_i,aList_i_sd,inFile,angstrom_scale):scale_units = 1.0/angstrom_scaleQ,Io,wt,Ic,Ib,Ifb = Profile[:6]Qmin = Limits[1][0]Qmax = Limits[1][1]wtFactor = ProfDict['wtFactor']Back,ifBack = data['Back']Ibeg = np.searchsorted(Q,Qmin)Ifin = np.searchsorted(Q,Qmax)+1#include last pointaList_q += list(Q[Ib...
1
13
5
138
0
161
205
161
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.read_i) defined within the public class called public.The function start at line 161 and ends at 205. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [161.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.read_pdb
def read_pdb(aList_beads_x,aList_beads_y,aList_beads_z,pdbfile_in):xmean = 0.0ymean = 0.0zmean = 0.0nbeads = 0file = open(pdbfile_in,'r')allLines = file.readlines()file.close()for eachLine in allLines:tag = eachLine[0:6]tag = tag.strip()if tag == 'ATOM':atom_name = eachLine[13:16]atom_name = atom_name.strip() if atom_n...
7
39
4
275
0
209
265
209
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.read_pdb) defined within the public class called public.The function start at line 209 and ends at 265. It contains 39 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [209.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.pdb_writer
def pdb_writer(aList_x_write,aList_y_write,aList_z_write,out_file,aString):atom_number = 0res_number = 0dummy_b = 0num_atoms = len(aList_x_write)file = open(out_file,'w')file.write(aString)file.write('\n')i = 0while i < num_atoms:x = float(aList_x_write[i])y = float(aList_y_write[i])z = float(aList_z_write[i]) x = '%.3...
3
36
5
261
0
293
336
293
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.pdb_writer) defined within the public class called public.The function start at line 293 and ends at 336. It contains 36 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [293.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.set_box
def set_box(aList_beads_x,aList_beads_y,aList_beads_z,\aList_box_x_all,aList_box_y_all,aList_box_z_all,\aList_box_score,box_step,dmax,rsearch):dmax_over2 = dmax/2.0search_sq = rsearch**2num_beads = len(aList_beads_x)count_x = -dmax_over2while count_x < dmax_over2:count_y = -dmax_over2while count_y < dmax_over2:count_z ...
7
31
10
188
0
340
380
340
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.set_box) defined within the public class called public.The function start at line 340 and ends at 380. It contains 31 lines of code and it has a cyclomatic complexity of 7. It takes 10 parameters, represented as [340.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.set_box_fast
def set_box_fast(aList_beads_x,aList_beads_y,aList_beads_z,\aList_box_x_all,aList_box_y_all,aList_box_z_all,\aList_box_score,box_step,dmax,rsearch):dmax_over2 = dmax/2.0num_box = int(dmax/box_step)search_sq = rsearch**2XYZ = np.meshgrid(np.linspace(-dmax_over2,dmax_over2,num_box),np.linspace(-dmax_over2,dmax_over2,num_...
3
20
10
225
0
384
405
384
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.set_box_fast) defined within the public class called public.The function start at line 384 and ends at 405. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 10 parameters, represented as [384.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.set_vol
def set_vol(aList_box_x_all,aList_box_y_all,aList_box_z_all,aList_box_score,\aList_box_x,aList_box_y,aList_box_z,vol_target,box_pt_vol):num_pts = len(aList_box_score)num_tries = int(max(aList_box_score))density_thresh = max(aList_box_score) - 1.0vol = vol_target + 1.0i = 0while i < num_tries:density_thresh = density_th...
11
49
9
287
0
409
472
409
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.set_vol) defined within the public class called public.The function start at line 409 and ends at 472. It contains 49 lines of code and it has a cyclomatic complexity of 11. It takes 9 parameters, represented as [409.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.disallowed_beads
def disallowed_beads(aList_beads_x,aList_beads_y,aList_beads_z,aList_contacts,\aList_box_x,aList_box_y,aList_box_z,rsearch):num_beads = len(aList_beads_x)num_boxes = len(aList_box_x)contact_limit_sq = rsearch**2count = 0while count < num_beads:x_bead = float(aList_beads_x[count])y_bead = float(aList_beads_y[count])z_be...
5
25
8
169
0
476
510
476
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.disallowed_beads) defined within the public class called public.The function start at line 476 and ends at 510. It contains 25 lines of code and it has a cyclomatic complexity of 5. It takes 8 parameters, represented as [476.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.calc_pr
def calc_pr(aList_beads_x,aList_beads_y,aList_beads_z,aList_pr_model,hist_grid):num_hist = len(aList_pr_model)count = 0while count < num_hist:aList_pr_model[count] = 0.0count = count + 1nbeads = len(aList_beads_x)max_dr = (float(num_hist)-1.0)*hist_gridi = 0while i < nbeads:j = 0while j < i:dr = get_dr(aList_beads_x[i]...
4
27
5
203
0
514
553
514
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.calc_pr) defined within the public class called public.The function start at line 514 and ends at 553. It contains 27 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [514.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.pr_dif
def pr_dif(aList_pr,aList_pr_model,skip):num_hist = len(aList_pr)delta_hist_sum = 0.0delta_hist_sum_sq = 0.0hist_sum = 0.0i = skipwhile i < num_hist:model = float(aList_pr_model[i])data = float(aList_pr[i])delta_hist = abs(data - model)delta_hist_sum = delta_hist_sum + delta_histhist_sum = hist_sum + datadelta_hist_sum...
2
18
3
117
0
557
581
557
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.pr_dif) defined within the public class called public.The function start at line 557 and ends at 581. It contains 18 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [557.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.pr_rfactor
def pr_rfactor(aList_pr,aList_pr_sd,aList_pr_model,skip):num_hist = len(aList_pr)delta_hist_sum = 0.0hist_sum = 0.0i = skipwhile i < num_hist:model = float(aList_pr_model[i])exp = float(aList_pr[i])delta_hist = exp - modeldelta_hist_sum = delta_hist_sum + abs(delta_hist)hist_sum = hist_sum + expi = i + 1delta_hist_sum ...
2
14
4
84
0
585
604
585
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.pr_rfactor) defined within the public class called public.The function start at line 585 and ends at 604. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [585.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.vdw_energy
def vdw_energy(econ12,econ6,e_width,dr,bead_sep3):if dr > bead_sep3:vdw = 0.0else:dr_e6 = dr**6dr_e12 = dr_e6**2vdw = econ12/dr_e12 - 2.0*econ6/dr_e6vdw = max(vdw,e_width)return vdw;
2
9
5
59
0
608
618
608
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.vdw_energy) defined within the public class called public.The function start at line 608 and ends at 618. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [608.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.vdw_energies
def vdw_energies(econ12,econ6,e_width,drs,bead_sep3):drs_e6 = drs**6drs_e12 = drs_e6**2vdws = econ12/drs_e12 - 2.0*econ6/drs_e6vdws = np.where(drs>bead_sep3,0.,vdws)vdws = np.where(vdws>e_width,vdws,e_width)return vdws
1
7
5
67
0
620
627
620
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.vdw_energies) defined within the public class called public.The function start at line 620 and ends at 627. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [620.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.random_beads
def random_beads(aList_beads_x,aList_beads_y,aList_beads_z,\ nbeads,dmax,aList_symm,bias_z):half_side = 0.5*dmaxscale_xy = 1.0 - bias_zscale_z = 1.0 + bias_zx_range = scale_xy * half_sidey_range = scale_xy * half_sidez_range = scale_z * half_sidenum_ops = len(aList_symm)i = 0while i < nbeads:triangle = random.triangula...
3
36
7
259
0
631
677
631
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.random_beads) defined within the public class called public.The function start at line 631 and ends at 677. It contains 36 lines of code and it has a cyclomatic complexity of 3. It takes 7 parameters, represented as [631.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.read_pr
def read_pr(aList_r,aList_pr,aList_pr_sd,aList_pr_model,\aList_pr_model_test,aList_pr_model_test2,inFile):angstrom_scale = 1.0Bins,Dbins,BinMag = data['Pair']['Distribution']aList_r += list(Bins)aList_pr += list(BinMag)aList_pr_sd += list(np.ones_like(Bins)/100.)aList_pr_model += list(np.zeros_like(Bins))aList_pr_model...
2
25
7
216
0
681
770
681
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.read_pr) defined within the public class called public.The function start at line 681 and ends at 770. It contains 25 lines of code and it has a cyclomatic complexity of 2. It takes 7 parameters, represented as [681.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.scale_pr
def scale_pr(aList_pr,aList_pr_sd,aList_pr_model):num_hist = len(aList_pr)total_dr = 0.0total_pr = 0.0i = 0while i < num_hist:total_dr = total_dr + float(aList_pr_model[i])total_pr = total_pr + float(aList_pr[i])i = i + 1scale = total_dr/total_pri = 0while i < num_hist:aList_pr[i] = scale*float(aList_pr[i]) aList_pr_sd...
3
16
3
108
0
774
794
774
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.scale_pr) defined within the public class called public.The function start at line 774 and ends at 794. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [774.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.get_dr
def get_dr(x1,y1,z1,x2,y2,z2):x1 = float(x1)y1 = float(y1)z1 = float(z1)x2 = float(x2)y2 = float(y2)z2 = float(z2)dr = (x1 - x2)**2 + (y1-y2)**2 + (z1-z2)**2dr = max(dr,0.1)dr = math.sqrt(dr)return dr;
1
11
6
97
0
798
810
798
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.get_dr) defined within the public class called public.The function start at line 798 and ends at 810. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [798.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.get_drs
def get_drs(xyz,XYZ):returnnp.sqrt(np.sum((XYZ-xyz)**2,axis=1))
1
2
2
29
0
814
816
814
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.get_drs) defined within the public class called public.The function start at line 814 and ends at 816. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [814.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.center_beads
def center_beads(x,y,z,aList_beads_x,aList_beads_y,aList_beads_z,radii_1,radii_2):num_beads = len(aList_beads_x)#xsum = 0.0#ysum = 0.0#zsum = 0.0#count_beads = 0.0##i = 0#while i < num_beads:##dr = get_dr(x,y,z,aList_beads_x[i],aList_beads_y[i],aList_beads_z[i])##if dr > radii_1 and dr < radii_2:#count_beads = count_be...
4
11
8
143
0
820
861
820
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.center_beads) defined within the public class called public.The function start at line 820 and ends at 861. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 8 parameters, represented as [820.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.get_total_energy
def get_total_energy(aList_beads_x,aList_beads_y,aList_beads_z,econ12,econ6,bead_sep3):nbeads = len(aList_beads_x)vdw_all = 0.0i = 0while i < nbeads:xyz = np.array([aList_beads_x[i],aList_beads_y[i],aList_beads_z[i]])XYZ = np.array([aList_beads_x[:i],aList_beads_y[:i],aList_beads_z[:i]]).Tdrs = get_drs(xyz,XYZ)vdws = v...
2
13
6
129
0
865
893
865
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.get_total_energy) defined within the public class called public.The function start at line 865 and ends at 893. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [865.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.e_min
def e_min(aList_beads_x,aList_beads_y,aList_beads_z,bead_sep,bead_sep3,aList_symm):eps = bead_sep/(2.0**(1.0/6.0))eps12 = eps**12eps6 = eps**6step_max = bead_sepscale = 0.0icount = -1nbeads = len(aList_beads_x)num_ops = len(aList_symm)num_cycles = 51i = 0while i < num_cycles:icount = icount + 1aList_beads_x_new = []aLi...
13
99
6
664
0
897
1,059
897
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.e_min) defined within the public class called public.The function start at line 897 and ends at 1059. It contains 99 lines of code and it has a cyclomatic complexity of 13. It takes 6 parameters, represented as [897.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
G2shapes.make_symm
def make_symm(aList_symm,num_symm):angle_step = 360.0/float(num_symm)i = 1while i < num_symm:theta = float(i) * angle_steptheta = math.radians(theta)cos_theta = math.cos(theta)sin_theta = math.sin(theta)aList_s = [cos_theta,sin_theta,-sin_theta,cos_theta]aList_symm.append(aList_s)i = i + 1return aList_symm;
2
12
2
83
0
1,063
1,077
1,063
null
[]
None
null
0
0
0
null
0
null
The function (G2shapes.make_symm) defined within the public class called public.The function start at line 1063 and ends at 1077. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1063.0] and does not return any value..