Repository navigation
Description
Found while reviewing PR #672 (branch agent/20261123-fix-670). topoplot takes **kwargs and only reads a subset. Every other name is accepted and has no effect. EEGLAB topoplot.m errors on an unknown parameter (Unknown input parameter '...' ???, the otherwise branch of the option switch). iclabel is the one name that file explicitly ignores.
As of 8953a1ec, emarker and emarker2 raise ValueError from topoplot (not supported yet in eegprep). pop_topoplot option text forwards them, so the GUI path raises too. They are still not drawn. Every other unimplemented name stays silent.
topoplot reads: noplot, plotchans, gridscale, electrodes / ELECTRODES, intrad, plotrad, method, style, colormap, maplimits, numcontour, colorbar, markersize, showlabels, axes, and title on a blank map.
EEGLAB names that are accepted and ignored, from the topoplot.m switch:
- markers and labels:
emarkercolors,emarkersize/emsize,emarkersize1chan/emarkersizemark,efontsize/efsize,electcolor/ecolor,scatter - head and interpolation:
conv,plotdisk,intsquare(hardcoded'on'),interplimits/headlimits,nosedir,chantype,drawaxis,circgrid,shrink,headrad(named in the docstring; the drawn head usessqueezefac * rmaxand never reads the argument),headcolor/hcolor,contourcolor/ccolor,shading,plotgrid/gridplot(named in the docstring; never read),whitebk/whiteback/forprint - dipoles:
dipole,dipsphere,dipnorm/dipnormmax,diplen,dipscale,diporient,dipcolor - other:
verbose,chaninfo,masksurf,contourvals,pmask
A name that is not in either list, such as foobar, is also ignored.
Callers that already pass names topoplot does not read:
tests/test_topoplot.pypassesverbose='off'andchaninfo=envtopo,spectopo, andtimtopoforward their option dicts with**options/**plot_options- EEGLAB
pop_topoplot.mappends'masksurf','on', and'chaninfo'/'verbose'when those exist. With dipoles it also appends'dipole'and'dipscale'. Pythonpop_topoplotdoes not append those today;plotdipis accepted and not drawn
Definition of done:
- Draw
emarkerandemarker2with visual parity againsttopoplot.m({marker color size linewidth}and{chans marker color size linewidth}), including the single-channelemarkersize1chansize. Do not stop at accepting the arguments. - Replace the open
**kwargssink with an explicit allow-list. A key that is not on that list raisesValueErrornamingtopoplotand the key, matching the EEGLAB unknown-parameter error. - The allow-list has to keep working for the internal callers above (
masksurf,chaninfo,verbose, and the dipole names onceplotdipdraws them) before unknown keys start raising. A key that is allowed only because a caller passes it, and is still not implemented, should stay on the list until it is implemented or the caller stops passing it.
Activity