gui package
Submodules
gui.input_screen module
- class gui.input_screen.InputScreen(*args, **kwargs)[source]
Bases:
Frame- regex_validation(local_id, mod_sn, version)[source]
Performs RegEx validation on the local ID and the module serial number, with the option to manually override. Also tests to see if the module serial number suggests a v1.1 module or v2. :param - local_id: Local OX### ID number, tests to match ^OX[0-9]{4}$ :param - mod_sn: Module Serial Number (full ID), tests to match ^20UPGM2[0-9]{7}$ :param - version: v1.1 (^20UPGM2211[0-9]{4}$) or v2 (^20UPGM2321[0-9]{4}$ or ^20UPGM2421[0-9]{4}$)
- Returns:
flag to indicate whether the local ID and serial number look reasonable.
- Return type:
True | False
- Parameters:
local_id (str)
mod_sn (str)
version (str)
- set_mod_data(attr, value, mod_data)[source]
Function to save module information into ModuleTestData object
- Parameters:
attr (str) – Attribute/key to be saved to
value (str) – Value of attribute
mod_data (ModuleTestData) – ModuleTestData object to store information
- Raises:
AttributeError – raised if
- validate_module_info(master, mod_data, mod_sn, local_id, version, overwrite_config, home_path)[source]
Validates module info entered and downloads config files from database if successful
- Parameters:
mod_sn (str) – String containing the global module serial number
local_id (str) – String containing the local (Oxford) module identifier
overwrite_config (bool) – Boolean flag from checkbox indicating whether config files should be written over
mod_data (ModuleTestData)
version (str)
home_path (str)
- Returns:
if attempting to unintentionally rewrite config files
- Return type:
None
- class gui.input_screen.LoadModuleInfo(*args, **kwargs)[source]
Bases:
Tk- Parameters:
mod_data (ModuleTestData)
- class gui.input_screen.TestSuite(*args, **kwargs)[source]
Bases:
Tk- Parameters:
mod_data (ModuleTestData)
gui.module_test_data module
gui.sandbox module
gui.test_interface module
- class gui.test_interface.TestInterface(*args, **kwargs)[source]
Bases:
FrameInterface (or base class) from which all the sets of tests inherit.
This defines the basic behaviour for a pre-defined set of tests including making a set of buttons, running the associated scripts.
- PWD = '/home/docs/checkouts/readthedocs.org/user_builds/atlas-summer-project/checkouts/latest/docs/source'
- check_mod_data_loaded(mod_data)[source]
Tests whether all the module testing properties have been saved into the ModuleTestData file. NB: Only checks for existence, not validity - we assume that the imported data is all reasonable.
- Parameters:
mod_data (ModuleTestData) – Module test data
- Returns:
Throws an exception and returns None if the attributes don’t exist.
- Return type:
mod_data.loc_id, mod_data.mod_sn, mod_data.temp, mod_data.version | None, None, None, None
- gen_cmd()[source]
“Returns the command template for the relevant test scripts, changing the config depending on the chip version and temperature; to be overridden by child classes.
- Return type:
str
- make_buttons(master, tests, mod_data)[source]
Loops over list of tests and makes corresponding buttons. Strips the std_prefix in YARR scans.
- Parameters:
master – controlling tk.Frame
tests (list) – list[strings] of test names
mod_data (ModuleTestData) – ModuleTestData object containing information about the module to pass through to button functions.
- open_popup(master, test, cmd, override=False)[source]
Opens small popup window with progress bar and executes the script for the test. Also defines actions to be taken after the test script has been executed (on_done).
- Parameters:
master – controlling Frame (Test Suite)
test (str) – name of the test, with any flags
cmd (str) – shell command to be executed, including any cd to relevant dirs, cd back to working dir
override (bool) – flag whether to override timeout and error handling # TODO
- run_cmd(cmd, on_done)[source]
“Threaded subprocess run (shell command). :param cmd: shell command to be executed, including prepended cd to script dir :type cmd: str :param on_done: function to define behaviour after command has been executed (e.g., stop progress bar and close popup). :type on_done: function
- Parameters:
cmd (str)
- run_test(master, button, test, mod_data)[source]
Locates and runs the script requested, autofilling module information.
- Parameters:
master – Window containing the frame
button (tkinter.Button) – tkinter button triggering the script
test (str) – name of script
mod_data (ModuleTestData) – ModuleTestData object with module data (SN, local ID etc) loaded.
- test_name = 'Base Test'
gui.test_suite module
- class gui.test_suite.EyeDiagram(*args, **kwargs)[source]
Bases:
TestInterface- chip_enabled(mod_data)[source]
Reads the relevant config file, located in module-qc-database-tools, to output which ASICs are turned on.
- Parameters:
mod_data (ModuleTestData) – ModuleTestData object containing ID and serial number
- Returns:
list of integers in [0,1] designating whether the corresponding ASIC is off or on.
- Return type:
enabled
- disable_chips(master, mod_data, chk_boxes)[source]
Writes to the config JSON with updated information (from checkboxes) as to which ASICS are to be turned off or on. If there is any write error, the original data is written in stead.
- Parameters:
master – controlling tk.Frame so that the popup can be closed
mod_data (ModuleTestData) – ModuleTestData object containing local ID and serial number, as well as whether it is a warm or cold test so that the correct JSON file can be located.
chk_boxes (list[int]) – list of integers corresponding to whether chip[i] is off (0) or on (1).
- gen_cmd(mod_data)[source]
“Returns the command template for the relevant test scripts, changing the config depending on the chip version and temperature; to be overridden by child classes.
- Parameters:
mod_data (ModuleTestData)
- get_test_list(mod_data)[source]
- Parameters:
mod_data (ModuleTestData)
- open_eyediagram_popup(master, eye_diag, delay, mod_data)[source]
Plots the heatmap for the eyeDiagram, as well as whether suitable delays have been found or not and gives the option (as checkboxes) to disable or re-enable particular chips.
- Parameters:
master – Controlling tk.Frame so that a popup can be added on top.
eye_diag (list[int]) – sanitised link quality values from eye diagram shell output (output of sanitise_plot_eye_diagram function)
delay (list[bool]) – list of booleans indicating whether a delay has been successfully found for a certain lane (output of sanitise_plot_eye_diagram function)
mod_data (ModuleTestData)
- sanitise_plot_eye_diagram(master, mod_data, file='./gui/logs/eyeDiagram.log')[source]
Reads and sanitises the shell output of the eyeDiagram script. Removes new line breaks, removes pipe delimiter, and removes shell colour information.
- Parameters:
master – controlling tk.Frame to pass through to other functions
mod_data (ModuleTestData)
file (str) – path to eyeDiagram.log. Default is ..gui/logs/eyeDiagram.log
- test_name = 'Communication'
- class gui.test_suite.MinHealthTests(*args, **kwargs)[source]
Bases:
TestInterface- gen_cmd(mod_data)[source]
“Returns the command template for the relevant test scripts, changing the config depending on the chip version and temperature; to be overridden by child classes.
- Parameters:
mod_data (ModuleTestData)
- test_name = 'Mininum Health Tests'
- class gui.test_suite.PixelFailTests(*args, **kwargs)[source]
Bases:
TestInterface- gen_cmd(mod_data)[source]
“Returns the template for the pixel fail test scripts, changing the config depending on the chip version
- Parameters:
mod_data (ModuleTestData)
- test_name = 'Pixel Fail'
- class gui.test_suite.PrelimTests(*args, **kwargs)[source]
Bases:
TestInterface- gen_cmd(mod_data)[source]
“Returns the command template for the relevant test scripts, changing the config depending on the chip version and temperature; to be overridden by child classes.
- get_test_list(mod_data)[source]
- Parameters:
mod_data (ModuleTestData)
- test_name = 'Preliminary Tests'
- class gui.test_suite.Tuning(*args, **kwargs)[source]
Bases:
TestInterface- gen_cmd(mod_data)[source]
“Returns the command template for the relevant test scripts, changing the config depending on the chip version and temperature; to be overridden by child classes.
- Parameters:
mod_data (ModuleTestData)
- test_name = 'Tuning'