hans / hans/dot-prediction

07 [task] Cycle builder — materialize per-cycle tidy tables from parquets

Open
#18 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

wayfinder:task
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Part of #11

## Question

Materialize the per-cycle **shared object** as tidy parquet tables from the EC347 parquets, exactly per the data model fixed in #13. This is the execution ticket that produces the object every downstream stage (§3, §4, §6) consumes.

**Task (execution — AFK where possible; no OpenGL needed, pandas/matplotlib only, `uv run`):**

Build a cycle-extraction step producing three parquet tables (all spatial fields CANVAS 1922×1396):

- **`cycle_gaze`** — long, one row per 100 Hz sample over `reveal[k-1]→reveal[k]`: `t` (behavior_t_ms), `x`, `y` (gx/gy_canvas), `em_type`, `gaze_valid`, `on_screen`, `homography_valid`, `segment`∈{free_behavior,feedback_delay}, `t_norm`, `video_frame_frac`, keys `(subject_id, seq_id, trial_idx, k=tpt)`.
- **`cycle_meta`** — one row per cycle: `click_xy`, `true_next_xy`, event times+frames (`reveal_prev`, `click`, `reveal_next`), keys.
- **`cycle_dots`** — long, one row per (cycle, dot): `role`∈{revealed,future}, `order`, `x`, `y`.

**Sources / transforms:** `gaze_per_sample.parquet`, `trials_with_video.parquet`; dots via `homography_solver.behavior_to_screen → gaze_projection.screen_to_canvas`. Cycles k∈3..14 (12/trial × 20 = 240). Dot sets **derived** from `true_x/y` ordered by `tpt` within trial (no `prev_x/y` column). `t_norm` = linear [0,1] per sub-segment.

**Resolution:** runnable builder + the three tables written for EC347, plus a sanity check: 240 cycles; `feedback_delay` ≈ 1502 ms fixed and `free_behavior` variable; per cycle `revealed` count = k and `future` count = 15−k.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the data model in #13, then inspect gaze_per_sample.parquet, trials_with_video.parquet, homography_solver.behavior_to_screen, and gaze_projection.screen_to_canvas. Run the builder with uv run and verify that it writes cycle_gaze, cycle_meta, and cycle_dots for EC347, with 240 cycles, the stated feedback delay, and the required revealed and future counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, pandas, python
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.