Skip to content

Conversation

@drammock
Copy link
Member

@drammock drammock commented Aug 31, 2022

closes #11032

Here is progress so far. NOTE: I recommend clicking the "edit" button for this comment and copy-pasting it into a full-screen text editor (and reducing font size as needed) so you can see the whole table at once without line wrapping / scrolling.

  • Params that already existed for that func/meth marked by ✓.
  • Newly-added params indicated by ADDED
  • Deprecated params indicated by DEPRECATED
  • params not-yet-but-might-be added indicated by YAGNI.
  • params judged not applicable to that func/meth indicated by n/a

Also the order of params has changed and all funcs/meths now have an * in their signatures after the first few params, making most params keyword-only. The param order (top-to-bottom) and position of the * are as in the table below:

param name viz.plot_topomap() Spectrum Epochs.plot_psd_topomap() AverageTFR / plot_tfr_topomap Evoked Covariance Projection inst.plot_projs_topomap() preprocessing.corrmap() notes
various data, pos, * bands tmin, tmax, bands tmin, tmax, fmin, fmax, * times, *, average info info, * icas, template, threshold, label
ch_type ✓, * ✓, * ✓, * n/a ✓, * (wasn't used; fixed) ✓, * Projection objects are one ch_type
various normalize, agg_fun, dB proj, method, normalize, agg_fun, dB baseline, mode scalings, proj scalings, proj, noise_cov
sensors ADDED ADDED ✓ (wasn't used; fixed)
show_names DEPRECATED ADDED ADDED ADDED ADDED ADDED ADDED when we have Info
names n/a n/a n/a n/a n/a n/a n/a n/a when we don't have Info
mask ADDED ADDED ADDED YAGNI YAGNI YAGNI? is there a use case for adding a mask to a proj topomap or corrmap?
mask_params ADDED ADDED ADDED YAGNI YAGNI YAGNI? is there a use case for adding a mask to a proj topomap or corrmap?
contours ADDED ADDED
outlines DEPRECATED "skirt"
sphere
image_interp ADDED ADDED ADDED ADDED
extrapolate ADDED ADDED ADDED ADDED ADDED
border ADDED ADDED ADDED ADDED
res ADDED ADDED YAGNI corrmap scales subplots for template vs. matches so better not to expose this
size ADDED ADDED ADDED YAGNI corrmap scales subplots for template vs. matches so better not to expose this
cmap
vlim ADDED ADDED ADDED ADDED YAGNI for now necessary when "joint" is a possibility, but for consistency use everywhere
vmin, vmax DEPRECATED - - DEPRECATED DEPRECATED DEPRECATED - - - replaced by vlim
cnorm ADDED ADDED ADDED ADDED ADDED ADDED ADDED YAGNI for now
colorbar YAGNI for now ADDED ADDED YAGNI for now
cbar_fmt YAGNI for now ADDED ADDED YAGNI for now
unit - - - DEPRECATED - - - - -
units YAGNI for now ADDED ADDED ADDED ADDED ADDED YAGNI for now
axes YAGNI corrmap has unpredictable number of axes
time_unit, time_format n/a n/a n/a n/a n/a n/a n/a n/a
title - - - DEPRECATED DEPRECATED DEPRECATED - - - DEPRECATED nothing automatic here other than providing top margin space
nrows, ncols n/a YAGNI for now YAGNI for now n/a n/a n/a n/a n/a relevant if n_topomaps unknown/large (when user passes bands or times)
plot n/a n/a n/a n/a n/a n/a n/a n/a
show
onselect TODO
n_jobs n/a n/a n/a n/a n/a n/a n/a
verbose YAGNI YAGNI YAGNI YAGNI YAGNI
method_kw n/a n/a n/a n/a n/a n/a n/a n/a

@drammock drammock force-pushed the standardize-topomap-args branch from 687fca8 to e75c922 Compare September 1, 2022 19:59
it will be approximated from the coordinates of ``'Oz'``). ``None`` (the
default) is equivalent to ``'auto'`` when enough extra digitization points
are available, and (0, 0, 0, {HEAD_SIZE_DEFAULT}) otherwise. Currently the
head radius does not affect plotting.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the text about radius not affecting plotting true? I haven't used plot_topomap for sometime now (I work on iEEG data now), but there was a time when radius affected the plotting. Many of the eeglab .set files I used had "invisible" head outlines because of this, as the channel positions were in mm or cm, but were interpreted by mne as meters (and so the head outline was the size of one channel in the topo plot).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder that too, but haven't had a chance to test it yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmagnuski update: head radius definitely does affect plotting. I'll remove this statement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming this!

@drammock
Copy link
Member Author

drammock commented Sep 9, 2022

OMG, the tragedies unearthed by this PR! I've just discovered that [raw|epochs|evoked].plot_projs_topomap() all have a ch_type argument that is silently ignored. raw.plot_projs_topomap(ch_type="foo") just works.

EDIT: fixed in 61a1746

@agramfort
Copy link
Member

agramfort commented Sep 10, 2022 via email

drammock and others added 6 commits September 22, 2022 18:07
…-args

* upstream/main:
  Fix mesh display in tutorial (mne-tools#11200)
  MAINT: Add arm64 CI using CirrusCI (mne-tools#11209)
  Fix spatial colors (mne-tools#11201)
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  add EpochsSpectrum.average() (mne-tools#11198)
@larsoner larsoner force-pushed the standardize-topomap-args branch from 930b216 to fa11476 Compare September 28, 2022 16:12
@larsoner
Copy link
Member

@drammock I pushed a couple commits to deal with #11046 and now everything is green. Feel free to merge if you're happy with my extra commits

@larsoner
Copy link
Member

You can ignore the windows conda failure, I'm working around it in #11213 and have opened joblib/threadpoolctl#131

@larsoner
Copy link
Member

@drammock drammock added the EOSS4 label Sep 29, 2022
@drammock drammock enabled auto-merge (squash) September 30, 2022 15:51
@drammock
Copy link
Member Author

OK I've visually inspected all the changed tutorials and fixed a couple inconsistencies between this PR and main. I'm ignoring small things like different amount of spacing between topomap and title. Marking as merge-when-green!

@larsoner
Copy link
Member

Thanks @drammock !

@drammock drammock merged commit 45720cc into mne-tools:main Sep 30, 2022
@agramfort
Copy link
Member

thanks a ton @drammock 🙏 🙏 🙏 🙏

larsoner added a commit to sappelhoff/mne-python that referenced this pull request Oct 4, 2022
* upstream/main:
  Don't insert superfluous newlines in subprocess log messages (mne-tools#11219)
  purge _get_args helper func (mne-tools#11215)
  Standardize topomap args (mne-tools#11123)
  MAINT: Ensure no datasets are downloaded in tests (mne-tools#11213)
larsoner added a commit to larsoner/mne-python that referenced this pull request Oct 11, 2022
* upstream/main: (64 commits)
  MAINT: Better check (mne-tools#11229)
  MAINT: Fix link and update instantiation note (mne-tools#11228)
  BUG: Add estimated fiducials when missing / assumed head coords (mne-tools#11212)
  Fix tfr db (mne-tools#11223)
  MAINT: Update link (mne-tools#11222)
  add CPGRL doc section (mne-tools#11216)
  Don't insert superfluous newlines in subprocess log messages (mne-tools#11219)
  purge _get_args helper func (mne-tools#11215)
  Standardize topomap args (mne-tools#11123)
  MAINT: Ensure no datasets are downloaded in tests (mne-tools#11213)
  MAINT: Fix Cirrus caching (mne-tools#11211)
  Fix mesh display in tutorial (mne-tools#11200)
  MAINT: Add arm64 CI using CirrusCI (mne-tools#11209)
  Fix spatial colors (mne-tools#11201)
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  ...
@drammock drammock deleted the standardize-topomap-args branch November 16, 2022 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: consistent API for topomap plotting

4 participants