Repository navigation
Add cart2topo coordinate conversion - #45
suraj-ranganath wants to merge 10 commits into
Conversation
Code Review — PR #45: Add cart2topo coordinate conversion
OverviewThis PR does two distinct things:
Both are solid, but the parity harness is the bulk of the review surface.
|
| Category | Severity | Item |
|---|---|---|
stage_comparison.py shape return type |
Medium | shape_py/shape_mat can now be None; old callers may break silently |
| Python 3.8 compat | Medium | Path.is_relative_to() requires Python ≥ 3.9 |
Bare KeyError in compare_stage_outputs |
Low | Missing "data" key gives an unhelpful error |
except Exception in _is_numeric_array |
Low | Too broad; masks bugs |
| Test style consistency | Low | Mix of unittest.TestCase and pytest-native in new code |
AGENTS.md placement |
Nit | Top-level is unusual; consider .claude/ |
ICA deviation max_atol=200.0 |
Nit | Document intended shrinkage plan with a linked issue |
The cart2topo function itself is ready to merge. The parity harness is well-designed — the main asks before merging are clarifying the stage_comparison.py return-type contract and confirming the Python floor for is_relative_to.
🤖 Generated with Claude Code
|
Closing because this PR is no longer relevant. |
Summary
This PR ports EEGLAB's current
cart2topocoordinate conversion behavior to Python in EEGPREP.Changes:
eegprep.cart2topo.cart2topofor converting Cartesian channel coordinates to EEGLAB topoplottheta/radiuscoordinates.N x 3coordinate arrays and separatex, y, zcoordinate vectors.cart2topofrom the top-leveleegprepnamespace for compatibility with existing EEGPREP function patterns.thetaandradiusagainst EEGLAB'scart2topo.Stacking / Merge Order
This is a stacked PR. The branch was created from
feat/parity-harness-foundationand is blocked by PR #43. Review can happen now, but this should merge only after #43 lands or after this branch is rebased onto the default branch once #43 is merged.Notes
Current EEGLAB
cart2topo.mhas deprecated documentation for GUI/squeeze/center options, but the active implementation rejects additional parameters and delegates toconvertlocs(..., 'cart2all'). This Python port implements that active non-GUI behavior.Validation
python -m pytest tests/test_cart2topo.py -qpassed:9 passedpython -m pytest tests/test_topoplot.py tests/test_cart2topo.py -qpassed:38 passed, 2 subtests passed