fix: autowater on ignore trials annotated as earned - #105
Merged
arjunsridhar12345 merged 4 commits intoSep 17, 2026
Merged
arjunsridhar12345 merged 4 commits into
arjunsridhar12345 merged 4 commits into
Conversation
micahwoodard
self-requested a review
September 17, 2026 21:16
micahwoodard
approved these changes
Sep 17, 2026
| ``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. |
There was a problem hiding this comment.
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
Collaborator
Author
There was a problem hiding this comment.
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
deleted the
104-fix-autowater-on-ignore-trials-annotated-as-earned
branch
September 17, 2026 23:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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