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 4 months ago

bimac commented 4 months ago

see #695

k1o0 commented 4 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 4 weeks 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.