Experiment Queue Manager
Tabular experiment task queue: task dictionary, priority sorting, pause/termination and reserved execution.
Overview
quatm/GUI/experiment/experiment_queue.py provides the experiment queue manager (ExperimentQueue
): it shows the task queue as a table (the task dictionary expDict, keyed by task number) and
supports priority sorting, state tracking and controls such as pause/terminate/delete. submit() is
the only enqueueing entry point on the GUI thread (task numbers are allocated centrally, and the Looper
also goes through it via the submitItem signal).
Key methods
| Method | Description |
|---|---|
submit | The single enqueueing entry point: allocates task numbers centrally |
pause | Pauses/resumes the currently running experiment |
set_sleeping | Sets a task to Sleeping / Queued (reserved execution) |
terminate_clicked / terminate_all | Gracefully terminates the selected / all tasks (Termination Pending) |
delete_item / delete_clicked | Deletes a task (graceful termination if it is running) |
update_item | Refreshes the row of a task |
set_model | Replaces the table model (ScheduleModel) |
Task-state enumeration: Queued / Waiting / Sleeping / Running / Paused / Scanning / Terminating / Termination Pending / Done / Failed.
Usage
from quatm.GUI.experiment.experiment_queue import ExperimentQueue
q = ExperimentQueue(browser=parent) # embedded in the experiment browser
q.submit(task_dict) # enqueue (called on the GUI thread)
For a fuller description see Experiment queue.