Skip to content

Commit

Permalink
updates after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
tab-cmd committed Oct 2, 2024
1 parent 6bfa2b2 commit ac3d5ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bcipy/parameters/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@
"editable": false,
"type": "float"
},
"min_inq_per_series": {
"min_inq_len": {
"value": "1",
"section": "online_config",
"name": "Minimum Inquiries Per Series",
Expand Down
2 changes: 1 addition & 1 deletion bcipy/task/paradigm/matrix/copy_phrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MatrixCopyPhraseTask(RSVPCopyPhraseTask):
"max_minutes",
"max_selections",
"max_incorrect",
"min_inq_per_series",
"min_inq_len",
"show_feedback",
"feedback_duration",
"show_preview_inquiry",
Expand Down
23 changes: 10 additions & 13 deletions bcipy/task/paradigm/rsvp/copy_phrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ class RSVPCopyPhraseTask(Task):
'show_preview_inquiry', 'preview_inquiry_isi', 'preview_inquiry_error_prob',
'preview_inquiry_key_input', 'preview_inquiry_length', 'preview_inquiry_progress_method',
'spelled_letters_count',
'stim_color', 'stim_height', 'stim_jitter', 'stim_length', 'stim_number',
'stim_order', 'stim_pos_x', 'stim_pos_y', 'stim_space_char', 'target_color',
'task_buffer_length', 'task_color', 'task_height', 'task_text',
'stim_color', 'rsvp_stim_height', 'stim_jitter', 'stim_length', 'stim_number',
'stim_order', 'rsvp_stim_pos_x', 'rsvp_stim_pos_y', 'stim_space_char', 'target_color',
'task_buffer_length', 'task_color', 'rsvp_task_height', 'task_text', 'rsvp_task_padding',
'info_pos_x', 'info_pos_y', 'info_color', 'info_height', 'info_text', 'info_color', 'info_height', 'info_text',
]

Expand All @@ -130,8 +130,6 @@ def __init__(
self.window = win
self.daq = daq
self.parameters = parameters
self.signal_models = signal_models
self.language_model = language_model
self.fake = fake

self.validate_parameters()
Expand All @@ -145,9 +143,9 @@ def __init__(
self.button_press_error_prob = parameters['preview_inquiry_error_prob']

self.language_model = self.get_language_model()
signal_models = self.get_signal_models()
self.signal_model = signal_models[0] if signal_models else None
self.evidence_evaluators = self.init_evidence_evaluators(signal_models)
self.signal_models = self.get_signal_models()
self.signal_model = self.signal_models[0] if self.signal_models else None
self.evidence_evaluators = self.init_evidence_evaluators(self.signal_models)
self.evidence_types = self.init_evidence_types(self.signal_models, self.evidence_evaluators)

self.file_save = file_save
Expand All @@ -157,12 +155,11 @@ def __init__(
self.session_save_location = f"{self.file_save}/{SESSION_DATA_FILENAME}"
self.copy_phrase = parameters["task_text"]

self.signal_model = signal_models[0] if signal_models else None
self.evidence_precision = DEFAULT_EVIDENCE_PRECISION

self.feedback = self.init_feedback()

self.setup_copyphrase()
self.set()

# set a preview_only parameter
self.parameters.add_entry(
Expand Down Expand Up @@ -298,7 +295,7 @@ def default_trigger_handler(self) -> TriggerHandler:
return TriggerHandler(self.file_save, TRIGGER_FILENAME,
FlushFrequency.EVERY)

def setup(self) -> None:
def set(self) -> None:
"""Initialize/reset parameters used in the execute run loop."""

self.spelled_text = str(self.copy_phrase[0: self.starting_spelled_letters()])
Expand Down Expand Up @@ -389,7 +386,7 @@ def init_copy_phrase_task(self) -> None:
"""

self.copy_phrase_task = CopyPhraseWrapper(
self.parameters["min_inq_per_series"],
self.parameters["min_inq_len"],
self.parameters["max_inq_per_series"],
lmodel=self.language_model,
alp=self.alp,
Expand Down Expand Up @@ -529,7 +526,7 @@ def check_stop_criteria(self) -> bool:
if consecutive_incorrect(
target_text=self.copy_phrase,
spelled_text=self.spelled_text) >= self.parameters.get(
'max_incorrect', 3):
'max_incorrect'):
self.logger.info(
'Max number of consecutive incorrect selections reached '
'(configured with the max_incorrect parameter)')
Expand Down
2 changes: 1 addition & 1 deletion bcipy/task/tests/paradigm/rsvp/test_copy_phrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setUp(self):
'max_inq_len': 50,
'max_inq_per_series': 10,
'max_minutes': 20,
'min_inq_per_series': 1,
'min_inq_len': 5,
'max_selections': 50,
'max_incorrect': 10,
'notch_filter_frequency': 60.0,
Expand Down

0 comments on commit ac3d5ab

Please sign in to comment.