MRG: Allow _plot_mri_contours() to return arrays#9818
MRG: Allow _plot_mri_contours() to return arrays#9818hoechenberger merged 4 commits intomne-tools:mainfrom
Conversation
mne/viz/misc.py
Outdated
| fig, axs, _, _ = _prepare_trellis(len(slices), n_col) | ||
| plt.close(fig) # we'll create a figure for each slice |
There was a problem hiding this comment.
Why even create this fig, axs at all when the next line is plt.close(fig)?
There was a problem hiding this comment.
Whoops, this line was copied by mistake, shouldn't be here
mne/viz/misc.py
Outdated
| slices_as_subplots : bool | ||
| Whether to add all slices as subplots to a single figure, or to | ||
| create a new figure for each slice. | ||
| fig_kind : 'figure' | 'array' | ||
| Whether to return Matplotlib figures or NumPy arrays. |
There was a problem hiding this comment.
I'd assume YAGNI on two parameters here and just keep it as we had it with one. We either want a single figure with multiple panels as the output (i.e., to be shown), or a list of ndarray (i.e., for reports or other embedding).
|
CI failures seem unrelated. |
|
does it help already for something? it helps memory somewhere? |
Before the major Report refactoring that was just merged, it was done figure-by-figure for memory reasons IIRC, yeah. So that PR had a small regression in that respect. This PR Should fix it. |
|
(In current |
agramfort
left a comment
There was a problem hiding this comment.
+1 for MRG when green
thx @hoechenberger
drammock
left a comment
There was a problem hiding this comment.
CI failures are mayavi-related deprecation warnings:
E DeprecationWarning: In the future, a default value of type 'dict' in an Any trait will be shared between all instances. To keep the current semantics, replace `Any({})` with `Any(factory=dict)` or `Any({1: 2})` (for example) with `Any(factory=dict, args=({1: 2},))`.
seems unrelated.
* upstream/main: MAINT: Update broken link, fix rendering (mne-tools#9829) Ensure plot_ica_sources() always plots traces of rejected ICs on top (mne-tools#9823) Improve plot_ica_sources() docstring (mne-tools#9825) MRG: Fix docstring for plot_ica_components() (mne-tools#9826) unpin jsonschema and filter its warning instead (mne-tools#9822) Add warning for SNIRF files with != 2 wavelengths (mne-tools#9817) add show_scalebars param to epochs.plot() (mne-tools#9815) MRG: Allow _plot_mri_contours() to return arrays (mne-tools#9818) MRG: Expand ~ in _check_fname() (mne-tools#9613) Improve ICA.plot_overlay() docstrings (mne-tools#9820) WIP, MAINT: Fix CircleCI (again) (mne-tools#9814) MRG, ENH: Add options to fit_dipole (mne-tools#9810) Rework Reports (new history) (mne-tools#9754) MRG, CI: Use VTK pre (mne-tools#9803)
Fixes #9812
I don't think we need a changelog entry for this one.
cc @larsoner