Allow subclasses of FigureClass to be passed to plot_raw/plot_epochs#13979
Allow subclasses of FigureClass to be passed to plot_raw/plot_epochs#13979frankier wants to merge 2 commits into
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?
| @@ -0,0 +1 @@ | |||
| Allow subclasses of :class:`MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding plot(...) methods of the raw and epochs classes. | |||
There was a problem hiding this comment.
| Allow subclasses of :class:`MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding plot(...) methods of the raw and epochs classes. | |
| Allow subclasses of :class:`MNEBrowseFigure` to be passed to plot_raw/plot_epochs, as well as the corresponding plot(...) methods of the raw and epochs classes, by :newcontrib:`First Last` |
then need a name -> url in doc/changes/names.inc
There was a problem hiding this comment.
... also, MNEBrowseFigure is not currently in the API docs. We either need to add it, or put this in double-backticks (code mode) as it currently can't link properly
|
|
||
| %(FigureClass)s | ||
|
|
||
| .. versionadded:: 1.12.2 |
There was a problem hiding this comment.
We won't backport so
| .. versionadded:: 1.12.2 | |
| .. versionadded:: 1.13 |
| %(verbose)s | ||
| %(FigureClass)s | ||
|
|
||
| .. versionadded:: 1.12.2 |
| # this is needed in test_docstring_parameters, which reads the file as text | ||
| docdict["¿test—üñɪçøɖɘ_keys*"] = "¿test—üñɪçøɖɘ_values*" | ||
|
|
||
| docdict["FigureClass"] = """ |
There was a problem hiding this comment.
pytest mne/tests/test_docstring_parameters.py complains about this not being in alphabetical order
| overview_mode=None, | ||
| splash=True, | ||
| verbose=None, | ||
| FigureClass=None, |
There was a problem hiding this comment.
I think it makes sense to name this with snake case even though the class itself is probably upper camel case
| FigureClass=None, | |
| figure_class=None, |
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.