Phase 4: expose PMI/MIR through the MNE wrapper#190
Merged
neuromechanist merged 4 commits intoJul 18, 2026
Merged
Conversation
Member
Author
Review (2 Sonnet reviewers: code, tests)Both confirmed the phase is thin, correct wiring; the code reviewer found nothing above its confidence bar (traced the full
Local gates green: ruff, |
neuromechanist
merged commit Jul 18, 2026
8978514
into
feature/issue-139-epic-mne-compat
7 checks passed
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the #133 separation-quality metrics onto the MNE-facing wrapper:
AMICAICA.mir(inst, model_idx=...)(Mutual Information Reduction, in nats) andAMICAICA.pmi(inst, model_idx=...)(pairwise mutual information between the fitted sources). Both extract the fitted channels from aRaw/Epochsand delegate toAMICA.mir/pmi(which already exist from #133), so MNE-side users get the same metrics as EEGLAB-side users.Closes #143. Part of epic #139. This is the final phase.
What's new
AMICAICA.mir(inst, *, model_idx=0, nbins=None)andpmi(inst, *, model_idx=0, nbins=None).model_idxis keyword-only (consistent with the other consumer methods) and validated against the fitted model count; both guard unfitted/degenerate via_check_fitted.Epochsare concatenated along time.Test plan
test-mnejob, real EEG):mir/pmireproduceAMICA.mir/pmion the picked-channel array exactly, per model;pmishape is(n_components, n_components); both work onEpochs;model_idxbounds and unfitted guards. Round-trip verified: wrapper MIR == array-API MIR (33.54 / 33.58 for the two models).ty check .,mkdocs build --strict, typos, and the mne suite (44) on real sample EEG.