VU-Cog-Sci / exptools2

Version 2 of exptools (by KnapenLab)
11 stars 9 forks source link

Break out of running trial #21

Closed StevenM1 closed 4 years ago

StevenM1 commented 4 years ago

Adds a method that allows a user to break out of the draw loop while running a trial (probably not so useful during an actual experiment but great for debugging). More or less the same as stop_phase() but the break is located outside of the phase loop.

lukassnoek commented 4 years ago

Looks good to me! @tknapen ?

StevenM1 commented 4 years ago

I make an additional change, which allows the trial phase to be passed to trial.log_phase_info() as an argument. Originally, log_phase_info() used self.phase within the method to determine the phase in which log_phase_info() was called. However, this may not always be correct: If the phase is fully completed before win.flip() is called (e.g., its duration was 0s), self.phase is updated before the window is flipped and log_phase_info() is called.

In my case, I 0s-duration phases are useful for jittering purposes (pseudo-random durations of a phase, of which 0s is an option). But I can imagine them also being useful in certain behavioral experiments where the trial length can be adjusted based on behavior

I'm not entirely sure if this change is in line with the philosophy behind exptools2 though

lukassnoek commented 4 years ago

Seems like a useful feature. Basic testing showed no issues, so I'm going to merge this.