You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Normalise the semantics of DataStructureMetadata.n_trials (per subject vs dataset total) #1202
DataStructureMetadata.n_trials is documented as "Total number of trials per subject" (moabb/datasets/metadata/schema.py), but the catalogue does not follow one convention. On develop (9c6b1ccfa, 160 metadata entries):
n_trials type
count
int
79
None
43
str (textual summary)
24
dict (per subset)
14
Among the 30 int entries that can be cross-checked against n_trials_per_class, 25 equal the per-subject sum, 1 equals the per-subject sum over all sessions, and 4 match neither (e.g. Tavakolan2017 = 2880 with 60 trials/class × 12 subjects × 4 sessions, BNCI2020_001 = 80 vs 241 per class). The open dataset PRs add more variants: dataset totals (Corsi2026 14 431, Ma2022 11 988, LioiXP1 780), per-block counts (Iwama2023 20), and per-session values.
The paper-grounded metadata audit (2026-09-30) flagged n_trials as the single largest source of low-confidence mismatches (50 of ~200), almost all of them per-run vs per-session vs per-subject vs dataset-total ambiguities rather than wrong numbers.
Proposal
Keep the schema meaning: n_trials = trials per subject, summed over sessions and runs (the quantity a user gets from get_data() for one subject). Document it explicitly with the formula n_trials ≈ sum(n_trials_per_class.values()) × sessions_per_subject when classes are balanced across sessions.
Add a validate_metadata_against_dataset check (warning level) comparing n_trials with n_trials_per_class × sessions_per_subject and with the #Trials / class × #Classes × #Sessions columns of summary_*.csv.
Move dataset-wide totals and per-run/per-block counts into trials_context (free text) or n_blocks, never into n_trials.
Normalise the 24 str and 14 dict entries where the sources allow an integer; keep str only for genuinely irregular designs.
Activity
fix(metadata): normalise DataStructureMetadata.n_trials to per-subjec…