Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gui/GUIutils/guiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def iter_except(function, exception):

def ConfigureTest(Test, Module_ID, Output_Dir, Input_Dir):
if not Output_Dir:
if 'xtalk' in Test:
Test = 'OpenBumpTest'
test_dir = os.environ.get("DATA_dir") + "/Test_" + str(Test)
if not os.path.isdir(test_dir):
try:
Expand Down
39 changes: 37 additions & 2 deletions Gui/python/TestHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import Gui.siteSettings as site_settings
from Gui.python.logging_config import get_logger
from Gui.python.CustomizedWidget import chip_iref_db
from InnerTrackerTests.TestSequences import CompositeTests_Modules, Test_to_Ph2ACF_Map
from InnerTrackerTests.TestSequences import CompositeTests_Modules, Test_to_Ph2ACF_Map, OpenBumpTest
from Gui.siteSettings import icicle_instrument_setup


Expand Down Expand Up @@ -313,6 +313,9 @@ def __init__(self, runwindow, master, info, firmware, txt_files={}):
self.powergroup = None
for group_key, group in self.instruments.powering_groups.items():
self.powergroup = group

self._openBumpTest_running = False
self._openBumpTest_subtest_index = 0

def finished_run_process(self, _, exitStatus, i):
logger.info("Inside finsihed_run_process")
Expand Down Expand Up @@ -530,19 +533,26 @@ def runCompositeTest(self, testName):
if self.halt:
return
runTestList = self.test_list


logger.debug("Past the Openbump test conditional block")
if self.testIndexTracker == len(self.test_list):
logger.debug("Reset testIndexTracker")
# self.testIndexTracker = 0
# self.testsAttempted = 0
return

testName = runTestList[self.testIndexTracker]
if self.testIndexTracker + 1 < len(
runTestList
): # Check if there is a next test
nextTest = runTestList[self.testIndexTracker + 1]
else:
nextTest = None
logger.info("The testName is: %s", testName)
if testName == "OpenBumpTest":
logger.debug("Running OpenBumpTest")
self.runOpenBumpTest()
return
self.runSingleTest(testName, nextTest)

def ramp_progress_bar(self, max):
Expand All @@ -556,6 +566,13 @@ def ramp_progress_bar(self, max):
value = 100 * np.abs(voltages[i] / max[i]) if max[i] != 0 else 0

self.updateProgressBar.emit(bar, value, text)
def runOpenBumpTest(self):
self._openBumpTest_running = True
self._openBumpTest_subtest_index = 0
subtest = OpenBumpTest[self._openBumpTest_subtest_index]
logger.info(f"Running OpenBumpTest subtest: {subtest}")
self.currentTest = subtest
self.runSingleTest(subtest)

def runADC(self):
if "adc_board" in self.instruments._instrument_dict.keys():
Expand Down Expand Up @@ -1938,6 +1955,8 @@ def on_finish(self, processIndex: int):
logger.warning("Process would not terminate, so killing it now...")
self.run_processes[processIndex].kill()



if "IVCurve" in self.currentTest:
self.saveTest(processIndex, self.run_processes[processIndex])
return
Expand All @@ -1949,6 +1968,22 @@ def on_finish(self, processIndex: int):

self.saveConfigs(process_index=processIndex)
# Don't continue on sequence until all processes have finished the current test
if self._openBumpTest_running:
self._openBumpTest_subtest_index += 1
if self._openBumpTest_subtest_index < len(OpenBumpTest):
subtest = OpenBumpTest[self._openBumpTest_subtest_index]
logger.info(f"Running next OpenBumpTest subtest: {subtest}")
self.currentTest = subtest
self.input_dir = self.output_dir # Chain the output of the last test as input for the next
#self.output_dir = "" # Reset output directory to force creation of a new one
self.runSingleTest(subtest)
return # Skip normal finish routine
else:
# Finished all subtests
self.currentTest = "OpenBumpTest"
logger.info("All OpenBumpTest subtests finished. Validating...")
print(f"Current openbumptest subtest index = {self._openBumpTest_subtest_index}")
self._openBumpTest_running = False

# Ensure that all processes have finished before continuing
self.finished_processes += 1
Expand Down
11 changes: 2 additions & 9 deletions Gui/python/TestValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ def ResultGrader(
)

else:
if testName in (
"PixelAlive_highcharge_xtalk",
"PixelAlive_coupled_xtalk",
"PixelAlive_uncoupled_xtalk",
):
BBanalysis_root_files.extend(
outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if file.endswith(".root")
)

# Note: This may be useful
# chip_canvas_path_template = "Detector/Board_{boardID}/OpticalGroup_{ogID}/Hybrid_{hybridID}/Chip_{chipID:02d}"
Expand All @@ -181,12 +173,13 @@ def ResultGrader(
#relevant_files = [
# outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir)
#]

relevant_files = [
outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if module_name in file or file.endswith(".xml")
]
dqmpattern = re.compile(rf"_Hybrid_{module_hybridID}\.root$")
relevant_files.extend([outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if dqmpattern.search(file)])

#relevant_files.extend([outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if file.endswith(".root")])
logger.debug(f"{relevant_files=}")
_1, _2 = felis.set_module(
module_name,
Expand Down
Loading