Experiment Run Manager

The core experiment execution engine: takes tasks from the queue and schedules them by measurement/sequence/run level.

Overview

quatm/GUI/experiment/experiment_manager.py provides the experiment run manager (ExperimentManager): the engine that takes tasks out of the experiment queue and executes them. The queue polling runs in a worker thread, and tasks are scheduled in the hierarchy measurement (measurement) → repetition (repetition) → sequence/scan (sequence) → single run (run).

Key methods

MethodDescription
queue_fnContinuously polls the task dictionary: picks tasks by priority, task number and reservation time
runTask-run wrapper: guarantees teardown however the task ends
pausePauses / resumes the current experiment
terminate_experimentGraceful termination: lets the current run finish naturally before stopping
start_measurement / start_sequence / end_sequence / end_measurementHooks for the individual experiment stages
set_dictWrites a single parameter to an attribute of the experiment object
set_run_nr / set_rep_nrSynchronises the run / repetition number
start_queue / shutdownStarts / stops the resident queue worker

Usage

from quatm.GUI.experiment.experiment_manager import ExperimentManager

manager = ExperimentManager(browser)   # browser supplies the queue and the interface
manager.start_queue()

For a fuller description see Experiment manager.