Skip to content

Remove timestamp from non-response events#119

Open
bruno-f-cruz wants to merge 1 commit into
mainfrom
fix-response-serialization
Open

Remove timestamp from non-response events#119
bruno-f-cruz wants to merge 1 commit into
mainfrom
fix-response-serialization

Conversation

@bruno-f-cruz

Copy link
Copy Markdown
Member

This PR introduces a breaking change to the Response software event:

  • Response deadline and auto-response are now propagated with a timestamp set to "NaN"
  • Since the Bonsai.Harp.Timestamp<T> constructor does not accept NaN as a timestamp, we introduce a breaking change by serializing as Tuple<Nullable<bool>, double> instead.

This should make the decision to only include hw-derived timestamps in this event more systematic and introduce less downstream analysis issues like in #118

Closes #118

@alexpiet

Copy link
Copy Markdown
Collaborator

looping in @arjunsridhar12345 since this will create a breaking change in the data format. @arjunsridhar12345 Please review these changes

@micahwoodard

Copy link
Copy Markdown
Collaborator

@alexpiet does this register auto responses how you expect? It seems like this will still immediately end the response time period when there is an automatic water event. I am unclear if that is the desired approach.

@alexpiet

Copy link
Copy Markdown
Collaborator

I dont understand what this PR is changing. The delivering of auto-water should not impact the timing of subsequent events

@bruno-f-cruz

Copy link
Copy Markdown
Member Author

I don't understand what this PR is changing. The delivery of auto-water should not impact the timing of subsequent events

Ok lets turn this into a question: What should the response time be when the animals get auto-water? Similarly, what should the response time be if the animals go over the choice deadline?

@alexpiet

Copy link
Copy Markdown
Collaborator

What should the response time be when the animals get auto-water?

The response time should be the time in which the animal licks, that is the time in which the animal makes a response

Similarly, what should the response time be if the animals go over the choice deadline?

The same as any other ignored trial

@bruno-f-cruz

Copy link
Copy Markdown
Member Author

What should the response time be when the animals get auto-water?

The response time should be the time in which the animal licks, that is the time in which the animal makes a response

Similarly, what should the response time be if the animals go over the choice deadline?

The same as any other ignored trial

I think we may have misunderstood the auto-water. I thought that when auto-water is given, the trial finishes. It sounds like what you want is to drop a little bit of water at the spout and proceed with the trial as usual. Can you confirm?

@bruno-f-cruz bruno-f-cruz force-pushed the fix-response-serialization branch from 6149d29 to c728afb Compare June 30, 2026 21:27
@alexpiet

Copy link
Copy Markdown
Collaborator

Yes, auto-water is water that is given at the go cue

@bruno-f-cruz

Copy link
Copy Markdown
Member Author

Can the animal be rewarded twice in that trial then?

@alexpiet

Copy link
Copy Markdown
Collaborator

I think we are talking in circles past each other. A mouse cannot be rewarded twice in a trial. On an auto-water trial, the reward time is immediately after the go cue. The choice or response time is the time in which the mouse licks. If the mouse does not lick, then the choice or response time is NaN. If the mouse responds, then there is a consumption period and then the trial ends. If the mouse does not respond, we wait until the end of the response period, and then the trial ends.

Here is a snippet of the start of stage_1_warmup, so every trial is auto-water. Note the first trial the mouse does not respond.

Screenshot 2026-06-30 at 4 41 39 PM

For the same session, we see that all rewards are the go-cue aligned auto-rewards

Screenshot 2026-06-30 at 4 48 37 PM

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