Repository navigation
Fix orphaned annot window - #10776
Conversation
670981a to
029f34c
Compare
|
OK, I'm totally flummoxed. I've added some extremely verbose debugging lines, and here is the result: import os
import mne
mne.set_config('MNE_BROWSER_BACKEND', 'matplotlib')
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_filt-0-40_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file).crop(tmax=10).load_data()
mne.set_log_level('debug')
fig = raw.plot()output: So for some reason, which makes absolutely no sense. |
|
ok, after commenting out the In [1]: import os
...: import mne
...:
...: mne.set_config('MNE_BROWSER_BACKEND', 'matplotlib')
...: sample_data_folder = mne.datasets.sample.data_path()
...: sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
...: 'sample_audvis_filt-0-40_raw.fif')
...: raw = mne.io.read_raw_fif(sample_data_raw_file).crop(tmax=10).load_data()
...: mne.set_log_level('debug')
...: fig = raw.plot()
Opening raw data file /data/mne_data/MNE-sample-data/MEG/sample/sample_audvis_filt-0-40_raw.fif...
Read a total of 4 projection items:
PCA-v1 (1 x 102) idle
PCA-v2 (1 x 102) idle
PCA-v3 (1 x 102) idle
Average EEG reference (1 x 60) idle
Range : 6450 ... 48149 = 42.956 ... 320.665 secs
Ready.
Reading 0 ... 1502 = 0.000 ... 10.003 secs...
Using matplotlib as 2D backend.
Opening raw browser...
In [2]: from matplotlib import get_backend
In [3]: import matplotlib.pyplot as plt
In [4]: get_backend() # <-- WTF
Closing raw browser <MNEBrowseFigure size 2560x1440 with 5 Axes> # <-- WTF
Channels marked as bad: # <-- WTF
['MEG 2443', 'EEG 053'] # <-- WTF
Out[4]: 'QtAgg'The def get_backend():
"""
Return the name of the current backend.
See Also
--------
matplotlib.use
"""
return rcParams['backend']so drilling down further: In [1]: import os
...: import mne
...:
...: mne.set_config('MNE_BROWSER_BACKEND', 'matplotlib')
...: sample_data_folder = mne.datasets.sample.data_path()
...: sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
...: 'sample_audvis_filt-0-40_raw.fif')
...: raw = mne.io.read_raw_fif(sample_data_raw_file).crop(tmax=10).load_data()
...: mne.set_log_level('debug')
...: fig = raw.plot()
Opening raw data file /data/mne_data/MNE-sample-data/MEG/sample/sample_audvis_filt-0-40_raw.fif...
Read a total of 4 projection items:
PCA-v1 (1 x 102) idle
PCA-v2 (1 x 102) idle
PCA-v3 (1 x 102) idle
Average EEG reference (1 x 60) idle
Range : 6450 ... 48149 = 42.956 ... 320.665 secs
Ready.
Reading 0 ... 1502 = 0.000 ... 10.003 secs...
Using matplotlib as 2D backend.
Opening raw browser...
In [2]: import matplotlib
In [3]: matplotlib.rcParams['backend'] # <-- WTF
Closing raw browser <MNEBrowseFigure size 2560x1440 with 5 Axes> # <-- WTF
Channels marked as bad: # <-- WTF
['MEG 2443', 'EEG 053'] # <-- WTF
Out[3]: 'QtAgg'somehow matplotlib's instantiation of If anyone has any shadow of an idea about what might be going on here, please LMK |
Any way you could connect a If that doesn't work, I'd dig into the matplotlib code, find a place that will handle |
19cd96b to
432461e
Compare
|
The code on this is ready for review but I'd still like to add some tests that would have caught these regressions. |
|
Looks good so far! |
|
OK, I've added a test that fails on |
agramfort
left a comment
There was a problem hiding this comment.
thx a lot @drammock
I'll let @larsoner or @hoechenberger test / merge when they find the time
hoechenberger
left a comment
There was a problem hiding this comment.
@drammock this PR reverts lots of changes that should not be reverted, possibly a rebase went wrong or so
hoechenberger
left a comment
There was a problem hiding this comment.
Seems GH failed me, after reloading several,time, those changes I mentioned are not visible anymore … hum.
Argh sorry. I did rebase but git didn't complain about conflicts, I'll have to see what happened. |
I think there was a caching problem somewhere, I cannot see these problems anymore So all is good to go from my end! |
|
the macOS conda job timed out after 6 hours on the install step. Restarted. Has that behavior been seen before? |

This fixes problems with the matplotlib backend of the raw browser:
fig.show()MWE for the last item:
yields this output
note the line "Closing raw browser...", that shouldn't happen during figure creation