Skip to content

fix: autowater on ignore trials annotated as earned - #105

Merged
arjunsridhar12345 merged 4 commits into
devfrom
104-fix-autowater-on-ignore-trials-annotated-as-earned
Sep 17, 2026
Merged

arjunsridhar12345 merged 4 commits into
devfrom
104-fix-autowater-on-ignore-trials-annotated-as-earned

Conversation

@arjunsridhar12345

Copy link
Copy Markdown
Collaborator

Attempts to close #104. Previously, the reward delivery hardware timestamp was correlating with the resposne software event to find the nearest trial. For sessions where there are lots of ignored trials, this causes an issue where the previous trial ends up being the trial chosen since the response fires at the response deadline (after the go-cue) while auto water fires at the go-cue.

The fix here uses the trial outcome window (this should be more constantly reliable and gate to the trial window) to correlate the reward delivery hardware timestamps coming from the harp valve to the corresponding trial. I ran this fix on this session locally: 872547_2026-09-11_13-05-03, and trial 499 is now marked with label auto in the nwb acquisition (see here).

Also tested on a few sessions that were unaffected and the labels stayed the same

@micahwoodard
micahwoodard self-requested a review September 17, 2026 21:16
``is_auto_reward_right``, flipping ``auto`` to ``earned``. Autowater on an
ignore trial is the worst case -- the water lands at the go cue while the
trial's own ``Response`` waits out the full response deadline -- but the
boundary is what makes containment correct, whatever the response latency.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda feels weird to explain legacy approach in the doc string but if it's there to prevent another issue like this, then maybe it makes sense

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll probably do another PR to condense some of the docs, but I kind of want to keep it for now just as a reference in case it pops up and I won't remember what's going on

@arjunsridhar12345
arjunsridhar12345 merged commit a710fd7 into dev Sep 17, 2026
3 checks passed
@arjunsridhar12345
arjunsridhar12345 deleted the 104-fix-autowater-on-ignore-trials-annotated-as-earned branch September 17, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants