Skip to content

Commit 0ccde77

Browse files
committed
refactor(ratings): rename flow module to screens
1 parent 198659f commit 0ccde77

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/mid_det/ratings/__main__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from mid_det.io import recording
3333
from mid_det.ratings import core as rcore
3434
from mid_det.ratings import display as rdisplay
35-
from mid_det.ratings import flow
35+
from mid_det.ratings import screens
3636
from mid_det.ratings.setup_wizard import run_ratings_wizard
3737

3838
_PACKAGE_DIR = Path(__file__).resolve().parent # src/mid_det/ratings/
@@ -97,32 +97,32 @@ def run() -> None:
9797
pos=(0, -0.38), height=1.0 / 28, color="white", autoLog=False,
9898
)
9999

100-
pages = flow.load_instruction_pages(_TEXT_DIR)
100+
pages = screens.load_instruction_pages(_TEXT_DIR)
101101
# pages: 0=intro, 1=valence, 2=arousal, 3=independence, 4=final
102102

103103
# ── INSTRUCTIONS + PRACTICE DEMOS ────────────────────────────────────────
104104
if show_instructions:
105-
flow.show_text_page(win, kb, instr_text, instr_hint, pages[0])
106-
flow.show_text_page(win, kb, instr_text, instr_hint, pages[1])
107-
flow.run_slider(win, kb, stim, "valence", cue=None) # valence practice demo
108-
flow.show_text_page(win, kb, instr_text, instr_hint, pages[2])
109-
flow.run_slider(win, kb, stim, "arousal", cue=None) # arousal practice demo
110-
flow.show_text_page(win, kb, instr_text, instr_hint, pages[3])
105+
screens.show_text_page(win, kb, instr_text, instr_hint, pages[0])
106+
screens.show_text_page(win, kb, instr_text, instr_hint, pages[1])
107+
screens.run_slider(win, kb, stim, "valence", cue=None) # valence practice demo
108+
screens.show_text_page(win, kb, instr_text, instr_hint, pages[2])
109+
screens.run_slider(win, kb, stim, "arousal", cue=None) # arousal practice demo
110+
screens.show_text_page(win, kb, instr_text, instr_hint, pages[3])
111111

112112
# Final "press 3 to select" page is always shown (MATLAB inst5).
113-
flow.show_text_page(win, kb, instr_text, instr_hint, pages[4])
113+
screens.show_text_page(win, kb, instr_text, instr_hint, pages[4])
114114

115115
# ── RATING TRIALS ────────────────────────────────────────────────────────
116-
flow.show_fixation(win, stim)
116+
screens.show_fixation(win, stim)
117117
results: list[dict] = []
118118
for cue in rcore.RATING_CUES:
119-
valence = flow.run_slider(win, kb, stim, "valence", cue)
120-
arousal = flow.run_slider(win, kb, stim, "arousal", cue)
119+
valence = screens.run_slider(win, kb, stim, "valence", cue)
120+
arousal = screens.run_slider(win, kb, stim, "arousal", cue)
121121
results.append({
122122
"polarity": cue.polarity, "magnitude": cue.magnitude,
123123
"valence": valence, "arousal": arousal,
124124
})
125-
flow.show_fixation(win, stim)
125+
screens.show_fixation(win, stim)
126126

127127
# ── WRITE CSV ────────────────────────────────────────────────────────────
128128
# (manifest.json was already written to run_dir at startup)
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
2-
Screen-flow helpers for the cue-ratings survey: text pages, the slider
3-
interaction loop, and the inter-trial fixation. These own the draw + key-poll
4-
loops (I/O + response logic), keeping mid_det.ratings.display a pure draw layer
5-
and mid_det.ratings.__main__ a thin orchestrator.
2+
Interactive screens for the cue-ratings survey: text pages, the slider
3+
interaction loop, and the inter-trial fixation. Each shows one screen and waits
4+
for input, owning the draw + key-poll loops (I/O + response logic) so that
5+
mid_det.ratings.display stays a pure draw layer and mid_det.ratings.__main__ a
6+
thin orchestrator.
67
78
Ported from MATLAB RunRatings.m.
89
"""

0 commit comments

Comments
 (0)