From 761e8279335cb9b544dc6dd58bd214647e4fce46 Mon Sep 17 00:00:00 2001 From: Florian Rau Date: Mon, 21 Oct 2024 12:25:57 +0100 Subject: [PATCH] add property getters for feedback delays --- CHANGELOG.md | 4 ++++ iblrig/__init__.py | 2 +- iblrig/base_choice_world.py | 18 +++++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a54ec026..bbb5306e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +8.24.6 +------ +* add property getters for feedback delays (for NM custom task) + 8.24.5 ------ * fix: visual stimulus not showing for first trial diff --git a/iblrig/__init__.py b/iblrig/__init__.py index 2e85cf79..08d92fda 100644 --- a/iblrig/__init__.py +++ b/iblrig/__init__.py @@ -6,7 +6,7 @@ # 5) git tag the release in accordance to the version number below (after merge!) # >>> git tag 8.15.6 # >>> git push origin --tags -__version__ = '8.24.5' +__version__ = '8.24.6' from iblrig.version_management import get_detailed_version_string diff --git a/iblrig/base_choice_world.py b/iblrig/base_choice_world.py index a3e4ab34..0e03f07c 100644 --- a/iblrig/base_choice_world.py +++ b/iblrig/base_choice_world.py @@ -410,7 +410,7 @@ def get_state_machine_trial(self, i): # No-go: hide the visual stimulus and play white noise. Go to exit_state after FEEDBACK_NOGO_DELAY_SECS. sma.add_state( state_name='no_go', - state_timer=self.task_params.FEEDBACK_NOGO_DELAY_SECS, + state_timer=self.feedback_nogo_delay, output_actions=[self.bpod.actions.bonsai_hide_stim, self.bpod.actions.play_noise], state_change_conditions={'Tup': 'exit_state'}, ) @@ -425,7 +425,7 @@ def get_state_machine_trial(self, i): ) sma.add_state( state_name='error', - state_timer=self.task_params.FEEDBACK_ERROR_DELAY_SECS, + state_timer=self.feedback_error_delay, output_actions=[self.bpod.actions.play_noise], state_change_conditions={'Tup': 'hide_stim'}, ) @@ -446,7 +446,7 @@ def get_state_machine_trial(self, i): ) sma.add_state( state_name='correct', - state_timer=self.task_params.FEEDBACK_CORRECT_DELAY_SECS - self.reward_time, + state_timer=self.feedback_correct_delay - self.reward_time, output_actions=[], state_change_conditions={'Tup': 'hide_stim'}, ) @@ -609,6 +609,18 @@ def reward_time(self): def quiescent_period(self): return self.trials_table.at[self.trial_num, 'quiescent_period'] + @property + def feedback_correct_delay(self): + return self.task_params['FEEDBACK_CORRECT_DELAY_SECS'] + + @property + def feedback_error_delay(self): + return self.task_params['FEEDBACK_ERROR_DELAY_SECS'] + + @property + def feedback_nogo_delay(self): + return self.task_params['FEEDBACK_NOGO_DELAY_SECS'] + @property def position(self): return self.trials_table.at[self.trial_num, 'position']