Repository navigation
Review fixes for #693: frame orientation cases - #694
Conversation
Fixes four cases #693 left: a coordsystem that names no system was still read as RAS; names with EEGLAB in them were no longer ALS unless spelled exactly; MNI152NLin6Asym, the schema spelling from BIDS 1.11.0, and miscased names such as captrak lost their positions; and a frame named ALS or RAS was applied as that orientation. The unknown-frame warning now names the coordsystem file, not the channels file. Tested: uv run pytest tests/test_bids_load_frombids_helpers.py
The BIDS schema spells this template MNI152NLin6Asym from 1.11.0, while the appendix's table and lean's frame table had only MNI152NLin6ASym, so the Zarr route refused a current dataset's frame. The lean docs now describe the import as it reads frames after the review fixes, and the changelog no longer says the import turns CTF, 4DBti or KitYokogawa. Tested: eegprep-lean tests -m "not network" (PYTHONPATH=src, from packages/eegprep-lean, as CI runs them); the four new MNI152NLin6Asym cases fail against the old table.
The changelog entry and BIDS guide no longer say a coordsystem with no EEGCoordinateSystem is read as RAS, and now state the case-insensitive match, the EEGLAB rules and the label-inference fallback. The older eegprep_lean.to_eeg entry drops its CTF clause, and the pop_load_frombids help gains the frame rule. Tested: docutils parse of the edited RST; pytest tests/test_guifunc_pophelp_chansel.py.
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 @neuromechanist's task in 47s —— View job PR review: #694, the review fixes for #693's frame orientation
Verdict: No blocking issues. All four cases from the #693 review are fixed. There are two minor suggestions inline and one doc nit below. I could not run the tests in this job: the sandbox asked for approval for Correctness
Suggestions (inline)
Doc nitThe lean bullet in
TestsThe new cases are focused, and the PR description says they fail on #693's head:
They extend the existing parametrized tests instead of adding a new file, as AGENTS.md asks. |
| elif coord_system is None: | ||
| warning( | ||
| f"Coordinate system {coord_system!r} of {fo.filename} has no " | ||
| f"Coordinate system {coord_system_name!r} in {report['CoordsystemFrom']} has no " |
There was a problem hiding this comment.
🤖 Nit: when the coordsystem has no EEGCoordinateSystem, this prints Coordinate system None in sub-01/eeg/..._coordsystem.json has no orientation in the BIDS coordinate-systems appendix. That reads as if a system called None was looked up. A separate message for the missing name would be clearer, e.g. "{report['CoordsystemFrom']} names no EEGCoordinateSystem; not overriding channel locations.". The parametrized test checks repr(system) in warning, so the None case would need its own assertion.
| name, is ALS. Any other system is looked up in the BIDS coordinate-systems appendix. | ||
| Returns ``None`` for ``Other``, a name the appendix does not list, or no name at all. | ||
| """ | ||
| if coordsystem.get('EEGCoordinateSystemDescription') == 'EEGLAB': |
There was a problem hiding this comment.
🤖 Nit: EEGCoordinateSystem now matches regardless of case and surrounding spaces, but EEGCoordinateSystemDescription still has to equal 'EEGLAB' exactly. So "eeglab" or "EEGLAB " in the description falls through to the system lookup. develop also compared it exactly, so this isn't a regression. If case-insensitive matching is the rule now, the description could be normalized the same way, e.g. str(...).strip().upper() == 'EEGLAB'. Fine to leave as is if the exact match is intentional.
This PR targets #693's branch, agent/20261125-fix-692, not develop, so its commits land in #693. It fixes the four cases from the review on #693:
The unknown-frame warning now names the coordsystem file, not the channels file. All four cases go through one helper, bids_coordsystem_orientation in coords.py, which builds on #693's BIDS_ALS_SYSTEMS and BIDS_RAS_SYSTEMS. The changelog, the BIDS guide and the pop_load_frombids help describe the result.
Tests: #693's frame tests gain each case and an EEGCoordinateSystemDescription of EEGLAB. Eight of them fail on #693's head and pass here. eegprep-lean's tests gain MNI152NLin6Asym, including the cross-route comparison, and fail without the lean fix. Run locally: tests/test_bids_load_frombids_helpers.py (32 passed); the eegprep-lean suite as CI runs it (406 passed, 28 skipped); the full suite without MATLAB and without the pamica module (3397 passed, plus 5 ASR failures that also fail on develop on this macOS machine and pass in #693's CI); ruff, ty and ./pre-commit.py.
Part of #692
Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.