Skip to content

feat(review): groups, time bins, keypoint distances and a statistics engine - #235

Merged
gbradham merged 6 commits into
mainfrom
feat/review-set-groups
Oct 29, 2026
Merged

gbradham merged 6 commits into
mainfrom
feat/review-set-groups

Conversation

@gbradham

@gbradham gbradham commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Three Session Review additions plus the statistics engine they feed.

1. Assign sessions to groups

Groups could only come from a hand-written glider_project.json. Now:

  • Session pool: Ctrl/Shift-click sessions, right-click → Move to , New group…, or Remove from group.
  • Saved to the manifest when the cohort was opened as a folder (created if missing); subjects, days and treatments are kept. A broken manifest is never saved over. Sessions opened as files are grouped for the review only (status bar says so).
  • Pool, epoch table and exports update immediately. Recordings sharing a session id share one manifest record, so they move together.

2. Time-bin export

Export → Time bins (CSV)…: bins of 1, 3, 5, 10 min or custom, over the whole session or the selected range, tidy (bin, bin_start_s, bin_end_s) or wide. Each animal is binned on its own zero (flow start, else first frame); the last bin is clipped and labelled honestly. Width is remembered.

3. Keypoint distances overlay

A Distances chip in the viewer draws the pixel distance between keypoint pairs. Right-click it for default pairs, all pairs, none, or individual pairs; the choice is remembered per keypoint set.

4. Statistics engine (glider.analysis.stats, no UI yet)

Qt-free, scipy-only, no new dependencies:

  • Group vs group: Welch/Student t, Mann-Whitney; one-way/Welch ANOVA, Kruskal-Wallis; Tukey, Games-Howell, Dunn post-hocs.
  • Epoch vs epoch: paired t, Wilcoxon; RM-ANOVA with Mauchly + Greenhouse-Geisser/Huynh-Feldt; Friedman.
  • Group × epoch: mixed ANOVA with simple-effects follow-ups.
  • Across time bins: per-animal slopes, linear/quadratic contrasts, first vs last; partial last bins excluded by default (they fake habituation).
  • Auto test selection states its reason; effect sizes with CIs; Bonferroni/Holm/BH; incomplete animals are named, never silently dropped.
  • Reference values pinned against pingouin 0.7 / scikit-posthocs (1e-9 or better); trend contrasts pinned by exact identities.

The Statistics tab and the "run everything" sweep come in a follow-up.

Tests

Session Review GUI, project manifest, cohort, epochs and stats suites: 635 passed. ruff and black clean.

🤖 Generated with Claude Code

Select sessions in Session Review's pool (Ctrl/Shift-click), right-click,
and move them to a group, a new group, or out of one. A cohort opened as a
folder saves the groups to glider_project.json, keeping its subjects and
other session fields; a broken manifest is never saved over. Sessions opened
as files are grouped for the review only.
Export > Time bins (CSV) splits each session, on its own zero, into bins of
1, 3, 5, 10 or a custom number of minutes, tidy or wide, over the whole
session or the selected range. The viewer's Distances chip draws the pixel
distance between keypoint pairs; right-click it to choose the pairs, which
are remembered per keypoint set.
Qt-free, scipy-only tests on the epoch and time-bin tables: group vs group,
epoch vs epoch, group x epoch (mixed ANOVA with sphericity corrections) and
trends across bins (per-animal slopes, polynomial contrasts, first vs last).
Auto test selection explains its choice; effect sizes carry CIs. Reference
values pinned against pingouin and scikit-posthocs.
@gbradham gbradham changed the title feat(review): assign sessions to groups in Session Review feat(review): groups, time bins, keypoint distances and a statistics engine Oct 29, 2026
Bin labels use a plain hyphen (0-1 min), and the window, epoch and time-bin
exports are written with a UTF-8 byte-order mark, so Excel no longer shows an
en dash or other non-ASCII range names as mojibake.
@gbradham
gbradham merged commit 3491202 into main Oct 29, 2026
4 checks passed
@gbradham
gbradham deleted the feat/review-set-groups branch October 29, 2026 19:13
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.

1 participant