models.utils package#
Submodules#
models.utils.cue module#
- class models.utils.cue.Cue(filename: str, function: Any, parameters: dict)[source]#
Bases:
object
This class executes a specific cue (a script/function) defined by the user in a different python file (e.g. Print a value, Save a velue in a file, etc.). The cue can be anything that the user wants to execute when the trial starts or ends.
- Parameters:
function (Any) – The function that will be executed when the cue is called.
parameters (dict) – The parameters that will be passed to the cue function when it is executed.
- Raises:
MissingParameterError – The
function
parameter is required.
config.json
example:file (str): Cue file path.
parameters (dict): The parameters that will be passed to the cue function defined in file when it is executed. This can be anything that the user needs to pass to the cue function.
models.utils.duration module#
models.utils.script_execution module#
- models.utils.script_execution.script_execute(script_path: str) Dict[str, Any] [source]#
This function executes a custom python script and returns the locals dict that was generated by the script.
- Parameters:
script_path (str) – The path to the custom python script.
- Raises:
ValueError – The script file doesn’t exist.
- Returns:
The locals dict that was generated by the script.