Skip to content

ICA plot_components opens figure one by one (and might hang depending on the console) #11693

@mscheltienne

Description

@mscheltienne

Description of the problem

A video will be clearer. Same behavior in a regular python console and in an IPython console.

Screencast.from.05-12-2023.04.45.47.PM.webm

The figure are shown one by one after you close the old one. At least in a python or IPython console, it works. In spyder, it hangs the console after you close the first figure 😞

Tested both in a working environment and in a fresh environment with only pip install ipython mne installed (MNE 1.4).

Steps to reproduce

from mne.datasets import sample
from mne.io import read_raw_fif
from mne.preprocessing import ICA


directory = sample.data_path() / "MEG" / "sample"
raw = read_raw_fif(directory / "sample_audvis_raw.fif", preload=False)
raw.pick_types(eeg=True)
raw.crop(0, 10)
raw.load_data()
raw.filter(1., 40.)
ica = ICA(n_components=None)
ica.fit(raw)
ica.plot_components(inst=raw)

No idea what is causing it at the moment, will try to look into it. Might be related to #11654 and to #11510

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions