Repository navigation
[STUDY] Load EEGLAB MATLAB STUDY files - #653
Conversation
pop_loadstudy reads MATLAB .study files, decodes uint16 characters as Latin-1, and rebases dataset paths when the study directory has moved. Co-authored-by: Suraj Ranganath <[email protected]>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @suraj-ranganath's task in 1m 25s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notes
Checked: correctness of the |
| _warn_legacy_design(study) | ||
| alleeg = _load_datasets(study) if load_datasets else [] | ||
| study, alleeg = std_checkset(study, alleeg) | ||
| std_checkfiles(study, alleeg) |
There was a problem hiding this comment.
Important: the return value is thrown away, so this call has no effect. The only thing it can do is raise an error.
std_checkfiles only builds a report (check_datasetinfo and _measure_cache_report mutate nothing). Its _measure_cache_report runs np.asarray(group[field], dtype=float) on every changrp/cluster erpdata/specdata/erspdata/itcdata/topo. EEGLAB stores those as {cond x group} cell arrays whose cells have different column counts (subjects per condition). Your docstring says these measure arrays now "stay in place" after a .mat load, so a STUDY saved with precomputed measures reaches this call as a ragged list. NumPy then raises ValueError: inhomogeneous shape, and pop_loadstudy fails on a file EEGLAB loads without trouble.
See
eegprep/src/eegprep/functions/studyfunc/std_checkfiles.py
Lines 36 to 52 in fc6fff5
Fix: remove the call. If you want EEGLAB's load-time warning, use ok, report = std_checkfiles(study, alleeg, return_report=True) and logger.warning the problems, and make _measure_cache_report handle cell-shaped measures. Either way, add a test that loads a .mat STUDY with a ragged changrp.erpdata cell.
std_checkfiles was called for a discarded report and raised on cell arrays whose cells have different lengths. Co-authored-by: Suraj Ranganath <[email protected]>
EEGLAB pop_loadstudy.m calls std_checkfiles. A cell whose arrays differ in length stays a cell, which is how MATLAB stores changrp.erpdata. Co-authored-by: Suraj Ranganath <[email protected]>
Keep both changelog bullets. Drop the STUDY load xfails that #653 made pass, and keep the three design-cell failures from that branch. Co-authored-by: Suraj Ranganath <[email protected]>
Keep the ASRCalibrationError changelog bullet, then the pop_loadstudy bullet from #653, then the existing Unreleased notes. Co-authored-by: Suraj Ranganath <[email protected]>
pop_loadstudy reads EEGLAB MATLAB .study files, decodes uint16 characters as Latin-1, and rebases dataset paths after the study directory moves. EEGLAB pop_loadstudy.m line 182 (d0963be) calls std_checkfiles. That function returns immediately at std_checkfiles.m line 47, so the call does not inspect measures. A changrp.erpdata cell of lengths 2 and 5 stays a cell. eeg_getversion reports the installed package version. The STUDY fixture cluster went from 9 strict xfails to 6 passing and 3 remaining. No MATLAB reference run.
Part of #430