Phase 3: preserve pamica-specific metadata through the MNE wrapper#189
Merged
neuromechanist merged 4 commits intoJul 18, 2026
Merged
Conversation
Member
Author
Review (4 Sonnet reviewers: code, tests, silent-failure, comments)All actionable findings addressed in commit 4a... The code-reviewer found nothing above its confidence bar (verified the Correctness / robustness
Docs / comments
Tests (the reviewers' gaps)
Local gates green: ruff, |
neuromechanist
merged commit Jul 18, 2026
81e1f45
into
feature/issue-139-epic-mne-compat
7 checks passed
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
An
mne.preprocessing.ICAcarries no source-density family, GG shape, or component-sharing state, so those pamica-specific fitted parameters would be silently dropped by theto_mne_icaexport. This phase exposes them as read accessors onAMICAICA(and, for parity, onAMICA/AMICATorchNG).Closes #142. Part of epic #139. Read-only metadata accessors — no algorithm or fit-path change.
What's new
get_pdftype(model_idx=...)->(n_components,)source-density family code (0-4) per component.PDFTYPE_NAMES(exported frompamica.mne_compatandpamica.torch_impl) maps codes to names:generalized_gaussian,super_gaussian_cosh,gaussian,logistic,sub_gaussian_cosh. Codes differ per component only under the adaptive switcher (pdftype=1, Adaptive-PDF selection for AMICATorchNG #26).get_rho(model_idx=...)->(n_mix, n_components)generalized-Gaussian shape parameters (meaningful forpdftype=0).shared_components()-> one group of(model_idx, component_idx)pairs per column merged across models byshare_comps(Implement component sharing (share_comps) in AMICATorchNG #60); empty when nothing is shared (a single model, or a default multi-model fit with sharing off).All three exist on
AMICATorchNG(guarded on unfitted), delegate throughAMICA(with the degenerate-fit_check_usableguard), and are surfaced onAMICAICAwith keyword-onlymodel_idxvalidated against the fitted backend's model count.Test plan
pamica/tests/torch_tests/test_ng_metadata.py(base CI, real EEG): default family is generalized Gaussian; a fixedpdftype=2fit reports Gaussian;rhoshape/bounds;shared_componentsempty for 1-model and default 2-model, and non-empty with a valid(>=2 models)structure whenshare_compsmerges (real fit,comp_thresh=0.9); unfit guards;PDFTYPE_NAMEScovers 0-4.test-mnejob): per-modelget_pdftype/get_rho,PDFTYPE_NAMESmapping, emptyshared_componentsby default,model_idxbounds, and the unfitted guard.ty check .,mkdocs build --strict, typos, and the backend (7) + mne (39) suites on real sample EEG.