Skip to content

Commit

Permalink
Add argument splash to disable splash-screen from Qt-browser (#12185)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
mscheltienne and larsoner authored Nov 8, 2023
1 parent 8d86df6 commit 14f4f86
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 4 deletions.
7 changes: 4 additions & 3 deletions doc/changes/devel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ Enhancements
- :func:`~mne.epochs.make_metadata` now accepts ``tmin=None`` and ``tmax=None``, which will bound the time window used for metadata generation by event names (instead of a fixed time). That way, you can now for example generate metadata spanning from one cue or fixation cross to the next, even if trial durations vary throughout the recording (:gh:`12118` by `Richard Höchenberger`_)
- Add support for passing multiple labels to :func:`mne.minimum_norm.source_induced_power` (:gh:`12026` by `Erica Peterson`_, `Eric Larson`_, and `Daniel McCloy`_ )
- Added documentation to :meth:`mne.io.Raw.set_montage` and :func:`mne.add_reference_channels` to specify that montages should be set after adding reference channels (:gh:`12160` by `Jacob Woessner`_)
- Add argument ``splash`` to the function using the ``qt`` browser backend to allow enabling/disabling the splash screen (:gh:`12185` by `Mathieu Scheltienne`_)

Bugs
~~~~
- Fix bug where :func:`mne.io.read_raw_gdf` would fail due to improper usage of ``np.clip`` (:gh:`12168` by :newcontrib:`Rasmus Aagaard`)
- Fix bug where :func:`mne.io.read_raw_gdf` would fail due to improper usage of ``np.clip`` (:gh:`12168` by :newcontrib:`Rasmus Aagaard`)
- Fix bugs with :func:`mne.preprocessing.realign_raw` where the start of ``other`` was incorrectly cropped; and onsets and durations in ``other.annotations`` were left unsynced with the resampled data (:gh:`11950` by :newcontrib:`Qian Chu`)
- Fix bug where ``encoding`` argument was ignored when reading annotations from an EDF file (:gh:`11958` by :newcontrib:`Andrew Gilbert`)
- Mark tests ``test_adjacency_matches_ft`` and ``test_fetch_uncompressed_file`` as network tests (:gh:`12041` by :newcontrib:`Maksym Balatsko`)
Expand All @@ -70,7 +71,7 @@ Bugs
- Fix bug with reported component number and errant reporting of PCA explained variance as ICA explained variance in :meth:`mne.Report.add_ica` (:gh:`12155`, :gh:`12167` by `Eric Larson`_ and `Richard Höchenberger`_)
- Fix bug with axis clip box boundaries in :func:`mne.viz.plot_evoked_topo` and related functions (:gh:`11999` by `Eric Larson`_)
- Fix bug with ``subject_info`` when loading data from and exporting to EDF file (:gh:`11952` by `Paul Roujansky`_)
- Fix bug where :class:`mne.Info` HTML representations listed all channel counts instead of good channel counts under the heading "Good channels" (:gh:`12145` by `Eric Larson`_)
- Fix bug where :class:`mne.Info` HTML representations listed all channel counts instead of good channel counts under the heading "Good channels" (:gh:`12145` by `Eric Larson`_)
- Fix rendering glitches when plotting Neuromag/TRIUX sensors in :func:`mne.viz.plot_alignment` and related functions (:gh:`12098` by `Eric Larson`_)
- Fix bug with delayed checking of :class:`info["bads"] <mne.Info>` (:gh:`12038` by `Eric Larson`_)
- Fix bug with :ref:`mne coreg` where points inside the head surface were not shown (:gh:`12147`, :gh:`12164` by `Eric Larson`_)
Expand All @@ -86,7 +87,7 @@ Bugs
- Fix bug with :func:`~mne.viz.plot_raw` where changing ``MNE_BROWSER_BACKEND`` via :func:`~mne.set_config` would have no effect within a Python session (:gh:`12078` by `Santeri Ruuskanen`_)
- Improve handling of ``method`` argument in the channel interpolation function to support :class:`str` and raise helpful error messages (:gh:`12113` by `Mathieu Scheltienne`_)
- Fix combination of ``DIN`` event channels into a single synthetic trigger channel ``STI 014`` by the MFF reader of :func:`mne.io.read_raw_egi` (:gh:`12122` by `Mathieu Scheltienne`_)
- Fix bug with :func:`mne.io.read_raw_eeglab` and :func:`mne.read_epochs_eeglab` where automatic fiducial detection would fail for certain files (:gh:`12165` by `Clemens Brunner`_)
- Fix bug with :func:`mne.io.read_raw_eeglab` and :func:`mne.read_epochs_eeglab` where automatic fiducial detection would fail for certain files (:gh:`12165` by `Clemens Brunner`_)

API changes
~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions mne/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,7 @@ def plot(
*,
theme=None,
overview_mode=None,
splash=True,
):
return plot_epochs(
self,
Expand All @@ -1324,6 +1325,7 @@ def plot(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)

@copy_function_doc_to_method_doc(plot_topo_image_epochs)
Expand Down
2 changes: 2 additions & 0 deletions mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,7 @@ def plot(
*,
theme=None,
overview_mode=None,
splash=True,
verbose=None,
):
return plot_raw(
Expand Down Expand Up @@ -1838,6 +1839,7 @@ def plot(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
verbose=verbose,
)

Expand Down
2 changes: 2 additions & 0 deletions mne/preprocessing/ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,7 @@ def plot_sources(
*,
theme=None,
overview_mode=None,
splash=True,
):
return plot_ica_sources(
self,
Expand All @@ -2569,6 +2570,7 @@ def plot_sources(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)

@copy_function_doc_to_method_doc(plot_ica_scores)
Expand Down
8 changes: 8 additions & 0 deletions mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4201,6 +4201,14 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
.. versionchanged:: 1.1 Added ``'eeglab'`` option.
"""

docdict[
"splash"
] = """
splash : bool
If True (default), a splash screen is shown during the application startup. Only
applicable to the ``qt`` backend.
"""

docdict[
"split_naming"
] = """
Expand Down
2 changes: 1 addition & 1 deletion mne/viz/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def _get_browser(show, block, **kwargs):
figsize = kwargs.setdefault("figsize", _get_figsize_from_config())
if figsize is None or np.any(np.array(figsize) < 8):
kwargs["figsize"] = (8, 8)
kwargs["splash"] = True if show else False
kwargs["splash"] = kwargs.get("splash", True) and show
if kwargs.get("theme", None) is None:
kwargs["theme"] = get_config("MNE_BROWSER_THEME", "auto")
if kwargs.get("overview_mode", None) is None:
Expand Down
5 changes: 5 additions & 0 deletions mne/viz/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ def plot_epochs(
*,
theme=None,
overview_mode=None,
splash=True,
):
"""Visualize epochs.
Expand Down Expand Up @@ -881,6 +882,9 @@ def plot_epochs(
%(overview_mode)s
.. versionadded:: 1.1
%(splash)s
.. versionadded:: 1.6
Returns
-------
Expand Down Expand Up @@ -1086,6 +1090,7 @@ def plot_epochs(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)

fig = _get_browser(show=show, block=block, **params)
Expand Down
7 changes: 7 additions & 0 deletions mne/viz/ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def plot_ica_sources(
*,
theme=None,
overview_mode=None,
splash=True,
):
"""Plot estimated latent sources given the unmixing matrix.
Expand Down Expand Up @@ -99,6 +100,9 @@ def plot_ica_sources(
%(overview_mode)s
.. versionadded:: 1.1
%(splash)s
.. versionadded:: 1.6
Returns
-------
Expand Down Expand Up @@ -139,6 +143,7 @@ def plot_ica_sources(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)
elif isinstance(inst, Evoked):
if start is not None or stop is not None:
Expand Down Expand Up @@ -1266,6 +1271,7 @@ def _plot_sources(
*,
theme=None,
overview_mode=None,
splash=True,
):
"""Plot the ICA components as a RawArray or EpochsArray."""
from ..epochs import BaseEpochs, EpochsArray
Expand Down Expand Up @@ -1410,6 +1416,7 @@ def _plot_sources(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)
if is_epo:
params.update(
Expand Down
5 changes: 5 additions & 0 deletions mne/viz/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def plot_raw(
*,
theme=None,
overview_mode=None,
splash=True,
verbose=None,
):
"""Plot raw data.
Expand Down Expand Up @@ -196,6 +197,9 @@ def plot_raw(
%(overview_mode)s
.. versionadded:: 1.1
%(splash)s
.. versionadded:: 1.6
%(verbose)s
Returns
Expand Down Expand Up @@ -394,6 +398,7 @@ def plot_raw(
use_opengl=use_opengl,
theme=theme,
overview_mode=overview_mode,
splash=splash,
)

fig = _get_browser(show=show, block=block, **params)
Expand Down

0 comments on commit 14f4f86

Please sign in to comment.