Skip to content

Refactor auto response#129

Merged
micahwoodard merged 4 commits into
mainfrom
refactor-auto-response
Jul 7, 2026
Merged

Refactor auto response#129
micahwoodard merged 4 commits into
mainfrom
refactor-auto-response

Conversation

@micahwoodard

@micahwoodard micahwoodard commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Refactors auto response to auto reward. On auto reward trials, reward is given immediately after go cue and trial resume as normal after. Skips reward in reward response period if auto reward.

closes #118

@bruno-f-cruz

Copy link
Copy Markdown
Member

It is not clear to me this is the intended logic. For instance, if auto-reward trials, you still want animals to wait for "RewardDelayduration" and "RewardConsumptionDuration"? I modified it to skip the reward delay (since the reward has already been delivered) but to keep waiting the reward consumption since the subject still has to collect the reward. We can modify further if needed.

There were a few bugs I detected in case it helps:

  1. you probably wanted to use zip not merge to check the condition between the trial type and the IsRewarded
  2. The current condition is not longer symmetrical; as a result, if IsRewarded == True and IsAutoReward is not null, if i am understanding correctly, the state machine will get stuck forever.

@micahwoodard

Copy link
Copy Markdown
Collaborator Author

It is not clear to me this is the intended logic. For instance, if auto-reward trials, you still want animals to wait for "RewardDelayduration" and "RewardConsumptionDuration"? I modified it to skip the reward delay (since the reward has already been delivered) but to keep waiting the reward consumption since the subject still has to collect the reward. We can modify further if needed.

@bruno-f-cruz I was implementing it based on this comment . It seems like logic should be the reward was delivered immediately after the go cue and then the trial proceeded normally after except that no other reward is given. @alexpiet is that correct?

@bruno-f-cruz

Copy link
Copy Markdown
Member

It is not clear to me this is the intended logic. For instance, if auto-reward trials, you still want animals to wait for "RewardDelayduration" and "RewardConsumptionDuration"? I modified it to skip the reward delay (since the reward has already been delivered) but to keep waiting the reward consumption since the subject still has to collect the reward. We can modify further if needed.

@bruno-f-cruz I was implementing it based on this comment . It seems like logic should be the reward was delivered immediately after the go cue and then the trial proceeded normally after except that no other reward is given. @alexpiet is that correct?

Fair enough! I changed the implementation to match those requirements. The reward delay is now also implemented for the non-existing reward during auto-water trials. I guess worst case scenario, people can set it to 0.

@micahwoodard

Copy link
Copy Markdown
Collaborator Author

@arjunsridhar12345 just a heads up this introduces breaking changes by renaming is_auto_response_right to is_auto_reward_right. The logic should remain the same though

@micahwoodard micahwoodard merged commit baab121 into main Jul 7, 2026
4 checks passed
@micahwoodard micahwoodard deleted the refactor-auto-response branch July 7, 2026 18:44
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.

Response time 0 on auto_response trials

3 participants