Reward deliveries are being attributed to the wrong trial on ignore trials. The fix I think should be to match reward deliveries to the trial window from the trial outcome, not nearest Response event. Issue shows up mainly in disengaged sessions with lots of ignored trials
get_reward_deliveries assigns each reward delivery to the trial with the
nearest Response timestamp. Proximity matching has no notion of a trial
boundary, so a delivery can inherit a neighbouring trial's autowater state.
On an ignore trial the Response event fires at the response deadline (~5 s
after the go cue) while autowater fires at the go cue itself. When the previous
trial's response falls inside that ~5 s gap, it is nearer to the delivery than
the trial's own response, and the delivery takes the previous trial's
is_auto_reward_right — None — and is annotated "earned" instead of
"auto".
See original issue: https://github.com/AllenNeuralDynamics/DF-Refactoring/issues/222
Reward deliveries are being attributed to the wrong trial on ignore trials. The fix I think should be to match reward deliveries to the trial window from the trial outcome, not nearest Response event. Issue shows up mainly in disengaged sessions with lots of ignored trials
get_reward_deliveriesassigns each reward delivery to the trial with thenearest
Responsetimestamp. Proximity matching has no notion of a trialboundary, so a delivery can inherit a neighbouring trial's autowater state.
On an ignore trial the
Responseevent fires at the response deadline (~5 safter the go cue) while autowater fires at the go cue itself. When the previous
trial's response falls inside that ~5 s gap, it is nearer to the delivery than
the trial's own response, and the delivery takes the previous trial's
is_auto_reward_right—None— and is annotated"earned"instead of"auto".See original issue: https://github.com/AllenNeuralDynamics/DF-Refactoring/issues/222