Skip to content

Fix hemis generation in test_vertex_to_mni_fs_nibabel to cover both - #14183

Open
marcus-campbell wants to merge 1 commit into
mne-tools:mainfrom
marcus-campbell:fix-freesurfer-hemisphere-fixture
Open

Fix hemis generation in test_vertex_to_mni_fs_nibabel to cover both#14183
marcus-campbell wants to merge 1 commit into
mne-tools:mainfrom
marcus-campbell:fix-freesurfer-hemisphere-fixture

Conversation

@marcus-campbell

@marcus-campbell marcus-campbell commented Aug 20, 2026

Copy link
Copy Markdown

Reference issue (if any)

I wasn't able to find an existing issue for this bug.

What does this implement/fix?

This fixes test_vertex_to_mni_fs_nibabel so that it covers both hemispheres.

rng.integers(0, 1) always returns 0 (exclusive upper bound), so hemis was all zeros and the test only compared left-hemisphere coordinates. Changed to rng.integers(0, 2) so the right hemisphere is exercised too.

Test-only change; the seeded RNG keeps it deterministic.

Additional information

AI Disclosure: I didn't actually use AI to write any code or comments here, but I technically found this bug during an AI-assisted static analysis project that I've been working on. The AI assisting me was OpenAI Codex gpt-5.6-sol (xhigh). Just stating that for transparency; maintainers, just yell if this disclosure is too pedantic.

hemispheres

rng.integers(0, 1) always returns 0, so the test only compared
coordinates for the left hemisphere. Use rng.integers(0, 2) so left and
right hemispheres are both tested.
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