Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Oct 24, 2024
1 parent 8649207 commit 90cc171
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iblrig/base_choice_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,9 @@ def next_trial(self):
do_debias_trial = (self.trials_table.loc[self.trial_num - 1, 'trial_correct'] != 1) and last_contrast >= 0.5
self.trials_table.at[self.trial_num, 'debias_trial'] = do_debias_trial
if do_debias_trial:
iresponse = np.logical_and(~self.trials_table['response_side'].isna(),
self.trials_table['response_side'] != 0) # trials that had a response
iresponse = np.logical_and(
~self.trials_table['response_side'].isna(), self.trials_table['response_side'] != 0
) # trials that had a response
# takes the average of right responses over last 10 response trials
average_right = np.mean(self.trials_table['response_side'][iresponse[-np.maximum(10, iresponse.size) :]] == 1)
# the next probability of next stimulus being on the left is a draw from a normal distribution
Expand All @@ -1030,7 +1031,7 @@ def show_trial_log(self, extra_info: dict[str, Any] | None = None, log_level: in
info_dict = {
'Contrast Set': np.unique(np.abs(choiceworld.contrasts_set(self.training_phase))),
'Training Phase': self.training_phase,
'Debias Trial': self.trials_table.at[self.trial_num, 'debias_trial']
'Debias Trial': self.trials_table.at[self.trial_num, 'debias_trial'],
}

# update info dict with extra_info dict
Expand Down

0 comments on commit 90cc171

Please sign in to comment.