Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibration task refactor #330

Merged
merged 15 commits into from
Jul 3, 2024
Merged

Calibration task refactor #330

merged 15 commits into from
Jul 3, 2024

Conversation

lawhead
Copy link
Collaborator

@lawhead lawhead commented Jun 27, 2024

Overview

Refactored calibration tasks to pull out common workflow into a parent task. In the process, added session logging to Matrix and RSVP tasks.

Ticket

https://www.pivotaltracker.com/story/show/187637041
https://www.pivotaltracker.com/story/show/187636806
https://www.pivotaltracker.com/story/show/187636860

Contributions

  • Created a BaseCalibrationTask to codify the calibration workflow. Factored the execute method into smaller methods to provide more granularity for subclasses to customize behavior. Note that the execute loop is now iterating through a generator, rather than through a list of items. This allows subclasses more flexibility to dynamically determine the next inquiry to display and to terminate the task if a sufficient amount of data has been recorded.
  • Updated other calibration tasks to subclass BaseCalibrationTask and specialize where needed (ex. display, inquiry generation, session data).
  • Updated unit tests; fixed typing issues; etc.
  • Added session data for Matrix Calibration
  • Added session data for RSVP Calibration

Test

  • Ran unit tests
  • Ran all calibration tasks (RSVP, Matrix, VEP, timing tests). Ran offline analysis on RSVP calibration.

@lawhead lawhead changed the base branch from main to 2.0.0rc4 June 27, 2024 21:54
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an enum?

Copy link
Contributor

@tab-cmd tab-cmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice refactoring of our calibration tasks!! Thanks for doing the work!

colors: List[str]

@property
def target(self) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some documentation on the expected stimuli would be helpful. It seems like it would expect target fixation inquiry_stimuli?

"""Symbols used in the calibration"""
return self._symbol_set

def name(self) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we might throw a not implemented error if name wasn't defined?

"""Trigger Type.

This method is passed to convert_timing_triggers to properly assign TriggerTypes
to the timing of stimuli presented.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful to document the assumptions here.

target prompt, fixation, stimuli (nontarget or target; dep on target

# Allow for some additional data to be collected for later processing
self.wait()

def cleanup(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could throw a not implemented error. We can add that in the future once we add cleanup to these tasks more explicitly though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think cleanup may be optional for many tasks so I prefer to leave this empty by default.

@lawhead lawhead merged commit e8d5186 into 2.0.0rc4 Jul 3, 2024
6 checks passed
@lawhead lawhead deleted the calib-task-refactor branch July 3, 2024 21:03
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.

3 participants