Allow subclasses of FigureClass to be passed to plot_raw/plot_epochs - #13979
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
larsoner
left a comment
There was a problem hiding this comment.
Docs should probably also mention that this param only affects the matplotlib plotting backend.
Do you think it's worth adding some version of this to an advanced raw viz example?
d5e8ef6 to
98ab4b3
Compare
|
Okay I've tried to address all of these and added an example |
larsoner
left a comment
There was a problem hiding this comment.
Can you see if you can get pytest mne/tests/test_docstring_parameters.py to pass locally? CIs are still unhappy with the ordering
| @@ -0,0 +1 @@ | |||
| Allow subclasses of `MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` | |||
There was a problem hiding this comment.
single backtick is default linking mode (which for us is :py:obj: I think), if not adding to public API need code mode
| Allow subclasses of `MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` | |
| Allow subclasses of ``MNEBrowseFigure`` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` |
There was a problem hiding this comment.
If you want to keep it this way, you need to add it to the public API + docs, so in doc/api/visualization.rst. This is why CircleCI complains (part of it at least!) Also if you do want to keep it, then let's explicitly link
| Allow subclasses of `MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` | |
| Allow subclasses of :class:`mne.viz.MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` |
There was a problem hiding this comment.
... and actually this path is a pain because of imports, etc. Lets just make these code...
7a0ff1d to
223c163
Compare
* Allow subclasses of `MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes. * Add an example showing onionskinning of MEG traces
223c163 to
315feee
Compare
|
|
||
| docdict["figure_class"] = """ | ||
| figure_class : class | ||
| The backend specific `MNEBrowseFigure` class to use. This is typically used |
There was a problem hiding this comment.
| The backend specific `MNEBrowseFigure` class to use. This is typically used | |
| The backend specific :class:`mne.viz.MNEBrowseFigure` class to use. This is typically used |
| @@ -0,0 +1 @@ | |||
| Allow subclasses of `MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding `plot(...)` methods of the raw and epochs classes, by :newcontrib:`Frankie Robertson` | |||
There was a problem hiding this comment.
... and actually this path is a pain because of imports, etc. Lets just make these code...
|
Pushed the reST fixes, otherwise LGTM, marking for merge-when-green. Thanks in advance @frankier ! |
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
* upstream/main: Make scrollbar handlers draggable (mne-tools#14040) [pre-commit.ci] pre-commit autoupdate (mne-tools#14052) Warn when Epochs events fall outside the raw data range (mne-tools#12989) (mne-tools#14004) Ensure epochs being concatenated have compatible event ids (mne-tools#14051) Widen main content area (mne-tools#14015) MAINT: remove dead gain/bits/value_range fields from _read_header in … (mne-tools#14047) ENH: replace `_get_blocks` binary reader with mffpy Reader API (mne-tools#14043) MAINT: Update dependency specifiers (mne-tools#14048) [dependabot]: Bump the actions group with 2 updates (mne-tools#14049) Simplify doc building with more refleak (mne-tools#14045) ENH: add overlay Brain GUI (mne-tools#14031) ENH: support multiple simultaneous overlays in Brain.add_data (mne-tools#13995) Add option to show a zero line in browser (mne-tools#14018) FIX: pass cmap name string not tuple to interactive topomap slider kwargs (mne-tools#14039) Doc/add ai policy pointer (mne-tools#14037) Allow subclasses of FigureClass to be passed to plot_raw/plot_epochs (mne-tools#13979) MAINT: Replace manual PNS binary block reader in `_read_segment_file` with `mffpy` (mne-tools#14030)
* upstream/main: (206 commits) Improve type checks (mne-tools#14036) Make scrollbar handlers draggable (mne-tools#14040) [pre-commit.ci] pre-commit autoupdate (mne-tools#14052) Warn when Epochs events fall outside the raw data range (mne-tools#12989) (mne-tools#14004) Ensure epochs being concatenated have compatible event ids (mne-tools#14051) Widen main content area (mne-tools#14015) MAINT: remove dead gain/bits/value_range fields from _read_header in … (mne-tools#14047) ENH: replace `_get_blocks` binary reader with mffpy Reader API (mne-tools#14043) MAINT: Update dependency specifiers (mne-tools#14048) [dependabot]: Bump the actions group with 2 updates (mne-tools#14049) Simplify doc building with more refleak (mne-tools#14045) ENH: add overlay Brain GUI (mne-tools#14031) ENH: support multiple simultaneous overlays in Brain.add_data (mne-tools#13995) Add option to show a zero line in browser (mne-tools#14018) FIX: pass cmap name string not tuple to interactive topomap slider kwargs (mne-tools#14039) Doc/add ai policy pointer (mne-tools#14037) Allow subclasses of FigureClass to be passed to plot_raw/plot_epochs (mne-tools#13979) MAINT: Replace manual PNS binary block reader in `_read_segment_file` with `mffpy` (mne-tools#14030) Fix transition bandwidth reported in 'filter too short' error (mne-tools#11406) (mne-tools#14005) ENH: Show the current time as a vertical line in plot_evoked_topo (mne-tools#14032) ...
What does this implement/fix?
This change allows for customization of raw/epoch plots via passing in a subclass of MNEBrowseFigure.
Currently I have achieved this in my own code through monkeypatching. This PR is the first steps towards cleaning things up to make extensions cleaner.