Batch mode - eulerlab/QDSpy GitHub Wiki
How it works
QDSpy (>= v0.9.6, experimental branch) now contains a dictionary for "environment setting". The key BATCH_MODE
tells QDSpy that it runs a batch script with multiple stimuli imported, such as this example:
import QDS
QDS.environ["BATCH_MODE"] = True
import noise_Colored1
import Cricket_1
Simply run the script directly using uv run .\Stimuli\batch.py
(here the script is assumed to be located in the Stimuli
folder of QDSpy) and it will present all imported stimuli. Changes to the imported stimulus scripts are not needed (but see caveats below).
Note: There is also another option for presenting batches of stimuli: The most recent QDSpy version contains an MQTT version. In brief, one starts the MQTT client (QDSpy_MQTT_main.py
) on the stimulus PC, which connects to some MQTT broker - an own or some free one in the internet. Then one can send MQTT commands (e.g., load stimulus, run it etc.) from any other PC that has access to the same MQTT broker. A demo command client is test_mqtt.py
. Since one can monitor the status of the current stimulus played, it is possible to write a Python script that present a list of stimuli (one by one) the the stimulus PC.
Current caveats
This is a rather quick fix to then batch function request, therefore, there are some caveats, which can be addressed once the batch functionality turns out to be useful.
- All stimuli imported in a batch script need to be already compiled, otherwise they are not presented.
- Starting a batch script from the GUI: It will be run (=stimuli are presented) already on clicking "compile" and the "play" button will not become enabled.