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

Matrix Inquiry Preview #353

Merged
merged 8 commits into from
Oct 10, 2024
Merged

Matrix Inquiry Preview #353

merged 8 commits into from
Oct 10, 2024

Conversation

lawhead
Copy link
Collaborator

@lawhead lawhead commented Oct 4, 2024

Overview

Added Inquiry Preview functionality for Matrix Calibration and Matrix Copy Phrase. Fixed a bug in RSVP Copy Phrase when using Inquiry Preview.

Ticket

https://www.pivotaltracker.com/story/show/188181571

Contributions

  • Added ButtonPressHandler classes for managing button press interactions. There is a different handler for each mode (press to accept, press to reject, preview only).
  • Updated display demos.
  • Added Inquiry Preview functionality to Matrix display.
  • Initialized Matrix Calibration and Copy Phrase tasks with preview parameters.
  • Refactored rsvp calibration to use button press handler classes.

Test

  • Added unit tests for ButtonPressHandlers.
  • Added unit tests for Inquiry Preview functionality in RSVP and Matrix displays.

@lawhead lawhead requested a review from tab-cmd October 4, 2024 22:59
self.max_wait = max_wait
self.key_input = key_input
self.clock = clock or Clock()
self.response: Optional[List] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

List[str, float]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it would actually need to be something like Union[List[str], List[int]], which isn't quite right either. The problem is that a list is actually not a good representation of this data structure. It would make more sense to be a Tuple[str, float], which we do in some places. I made a cleanup ticket to address this across the code base: https://www.pivotaltracker.com/story/show/188409248.

mode: ButtonPressMode) -> Type[ButtonPressHandler]:
"""Get the appropriate handler constructor for the given button press mode."""
mapping = {
ButtonPressMode.NOTHING: PreviewOnlyButtonPressHandler,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach!

@@ -128,6 +135,15 @@ def schedule_to(self,
self.stimuli_timing = timing or []
self.stimuli_colors = colors or []

@property
Copy link
Contributor

Choose a reason for hiding this comment

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

This property is also set on the task class?

@lawhead lawhead merged commit 7508da5 into 2.0.0rc4 Oct 10, 2024
6 checks passed
@lawhead lawhead deleted the matrix-inquiry-preview branch October 10, 2024 15:32
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.

2 participants