int-brain-lab / iblrig

Main repository for IBL rig code
https://int-brain-lab.github.io/iblrig/
MIT License
22 stars 21 forks source link

Run task QC in tests #659

Open bimac opened 6 months ago

bimac commented 6 months ago

see #695

k1o0 commented 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)
oliche commented 2 months ago

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.

oliche commented 2 weeks ago

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