FIX: correct mode parameter in get_point_spread and get_cross_talk#13754
FIX: correct mode parameter in get_point_spread and get_cross_talk#13754Famous077 wants to merge 5 commits intomne-tools:mainfrom
Conversation
|
Hi @Famous077 ! Thanks for the PR! I took a quick look at your code here. Good catch on the mismatch between parameter names passed to With that said, the internal function Cheers. |
Hi @nordme , thanks for the suggestion. I've added 'sum' and 'maxval' to the public API - they now map through to the internal function correctly, the validation and n_comp guard are updated, and all 3 tests pass locally. Please take a look and let me know if anything needs to be updated. |
nordme
left a comment
There was a problem hiding this comment.
Ok, function code looks good to me, but I think we need to add a doc update. The public won't know we've got the "sum" and "maxval" options available unless we update the "mode" parameter description in the docstrings of mne.minimum_norm.get_point_spread and mne.minimum_norm.get_cross_talk on the website. Note in the source code for these functions, the mode parameter description calls in pre-written text, %(mode_pctf)s. To change that parameter description, we need to touch another file, mne/utils/docs.py, which contains a docdict dictionary where we store parameter descriptions for parameters that get used in multiple functions. You can use the info already there as a guide to add extra information about "sum" and "maxval" options to the docdict["mode_pctf"] item. This will get pulled in to all the functions that use this parameter.
Fixed issue #13128
What does this implement/fix?
Found a bug where the
modeparameter inget_point_spread()andget_cross_talk()wasn't working as documented. The public API says'max'and'svd'are valid modes, but the internal helper function_summarise_psf_ctfuses different names ('maxnorm'and'pca'),so passing
'max'or'svd'just silently returned all verticeswithout any summarisation — no error, no warning.
Changes made:
ValueError_summarise_psf_ctfAdditional information
Verified the fix works correctly with both individual vertex indices and labels.
All 3 existing tests pass after the changes.