Open bimac opened 6 months ago
@oliche The following should work at a rig for extracting trials:
# `task` variable here is an iblrig Session obj after calling run method
from ibllib.pipes.dynamic_pipeline import get_trials_tasks
extraction_tasks = get_trials_tasks(task.paths['SESSION_FOLDER'])
extraction_task = extraction_tasks[0]
extraction_task.setUp() # assert data present
trials = extraction_task.extract_behaviour(save=False)
The added complexity here is that in order for this to work, there is a need to create a realistic mock of the bpod data output, which is closely related to the state machine. A way around it would be to collect actual data from each instance of the tasks we want to cover and feed this as fixture to the extractor.
There are also some tools for creating synthetic wheel data in the wheel extraction tests. https://github.com/int-brain-lab/ibllib/blob/e110a244db60f67cd47d1e01c10a8faec132885c/ibllib/tests/qc/test_task_metrics.py#L207-L282
see #695