Skip to content

Commit

Permalink
BUG: Fix bug with no picks (#8954)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Feb 24, 2021
1 parent 0b784b8 commit 52ebe72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Bugs

- Fix bug with :meth:`raw.plot() <mne.io.Raw.plot>` where ``scalings='auto'`` did not compute scalings using the full range of data (:gh:`8806` by `Eric Larson`_)

- Fix bug with :meth:`raw.plot() <mne.io.Raw.plot>` where setting a ``lowpass`` could lead to non-data-channels not plotting (:gh:`8954` by `Eric Larson`_)

- Fix bug with :meth:`mne.io.Raw.load_data` and :meth:`mne.Epochs.drop_bad` where ``verbose`` logging was not handled properly (:gh:`8884` by `Eric Larson`_)

- Fix bug with :func:`mne.io.read_raw_nicolet` where header type values such as num_sample and duration_in_sec where not parsed properly (:gh:`8712` by `Alex Gramfort`_)
Expand Down
4 changes: 3 additions & 1 deletion mne/viz/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,9 @@ def _update_data(self):
starts = np.maximum(starts[mask], start) - start
stops = np.minimum(stops[mask], stop) - start
for _start, _stop in zip(starts, stops):
_picks = np.where(np.in1d(picks, self.mne.picks_data))
_picks = np.where(np.in1d(picks, self.mne.picks_data))[0]
if len(_picks) == 0:
break
this_data = data[_picks, _start:_stop]
if isinstance(self.mne.filter_coefs, np.ndarray): # FIR
this_data = _overlap_add_filter(
Expand Down
5 changes: 3 additions & 2 deletions mne/viz/tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# License: Simplified BSD

import numpy as np
import os.path as op
import itertools

import numpy as np
from numpy.testing import assert_allclose
import pytest
import matplotlib
Expand Down Expand Up @@ -569,7 +569,8 @@ def test_plot_raw_filtered(filtorder, raw):
raw.plot(lowpass=40, clipping='transparent', filtorder=filtorder)
raw.plot(highpass=1, clipping='clamp', filtorder=filtorder)
raw.plot(lowpass=40, butterfly=True, filtorder=filtorder)
plt.close('all')
# shouldn't break if all shown are non-data
RawArray(np.zeros((1, 100)), create_info(1, 20., 'stim')).plot(lowpass=5)


def test_plot_raw_psd(raw):
Expand Down

0 comments on commit 52ebe72

Please sign in to comment.