Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ stages:
- bash: |
set -e
python -m pip install --progress-bar off --upgrade pip setuptools wheel codecov
python -m pip install --progress-bar off mne-qt-browser[opengl] vtk scikit-learn pytest-error-for-skips python-picard
python -m pip install --progress-bar off mne-qt-browser[opengl] vtk scikit-learn pytest-error-for-skips python-picard "pyqt5>=5.10,!=5.15.3"
python -m pip uninstall -yq mne
python -m pip install --progress-bar off --upgrade -e .[test]
displayName: 'Install dependencies with pip'
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/1.0.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Version 1.0.X

- Retain epochs metadata when using :func:`mne.channels.combine_channels` (:gh:`10504` by `Clemens Brunner`_)

- Fix issue with saving epochs once :func:`~mne.preprocessing.compute_current_source_density` has been used if a rejection threshold was used first (:gh:`10619` by `Alex Rockhill`_ and `Richard Höchenberger`_)

Version 1.0.2 (2022-04-15)
--------------------------
- Fix bug where ``theme`` was not handled properly in :meth:`mne.io.Raw.plot` (:gh:`10500` by `Eric Larson`_)
Expand Down
4 changes: 2 additions & 2 deletions mne/beamformer/tests/test_lcmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ def test_localization_bias_fixed(bias_params_fixed, reg, weight_norm, use_cov,
# no reg
(0.00, 'vector', None, True, None, 23, 24, 0.96, 0.97),
(0.00, 'vector', 'unit-noise-gain-invariant', True, None, 52, 54, 0.95, 0.96), # noqa: E501
(0.00, 'vector', 'unit-noise-gain', True, None, 44, 46, 0.97, 0.98),
(0.00, 'vector', 'nai', True, None, 44, 46, 0.97, 0.98),
(0.00, 'vector', 'unit-noise-gain', True, None, 44, 48, 0.97, 0.99),
(0.00, 'vector', 'nai', True, None, 44, 48, 0.97, 0.99),
(0.00, 'max-power', None, True, None, 14, 15, 0, 0),
(0.00, 'max-power', 'unit-noise-gain-invariant', True, None, 35, 37, 0, 0), # noqa: E501
(0.00, 'max-power', 'unit-noise-gain', True, None, 35, 37, 0, 0),
Expand Down
8 changes: 8 additions & 0 deletions mne/preprocessing/_csd.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,12 @@ def compute_current_source_density(inst, sphere='auto', lambda2=1e-5,
for pick in picks:
inst.info['chs'][pick].update(coil_type=FIFF.FIFFV_COIL_EEG_CSD,
unit=FIFF.FIFF_UNIT_V_M2)

# Remove rejection thresholds for EEG
if isinstance(inst, BaseEpochs):
if inst.reject and 'eeg' in inst.reject:
del inst.reject['eeg']
if inst.flat and 'eeg' in inst.flat:
del inst.flat['eeg']

return inst
16 changes: 15 additions & 1 deletion mne/preprocessing/tests/test_csd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from scipy import linalg

from mne.channels import make_dig_montage
from mne import create_info, EvokedArray, pick_types, Epochs
from mne import (create_info, EvokedArray, pick_types, Epochs, find_events,
read_epochs)
from mne.io import read_raw_fif, RawArray
from mne.io.constants import FIFF
from mne.utils import object_diff
Expand Down Expand Up @@ -183,3 +184,16 @@ def test_csd_fif():
ch.update(coil_type=FIFF.FIFFV_COIL_EEG, unit=FIFF.FIFF_UNIT_V)
raw_csd._data[pick] = raw._data[pick]
assert object_diff(raw.info, raw_csd.info) == ''


def test_csd_epochs(tmp_path):
"""Test making epochs, saving to disk and loading."""
raw = read_raw_fif(raw_fname)
raw.pick_types(eeg=True, stim=True).load_data()
events = find_events(raw)
epochs = Epochs(raw, events, reject=dict(eeg=1e-4), preload=True)
epochs = compute_current_source_density(epochs)
epo_fname = tmp_path / 'test_csd_epo.fif'
epochs.save(epo_fname)
epochs2 = read_epochs(epo_fname, preload=True)
assert_allclose(epochs._data, epochs2._data)
19 changes: 1 addition & 18 deletions mne/viz/backends/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def _qt_get_stylesheet(theme):
# but it's easy enough just to set it transparent and inherit
# the bgcolor of the window (which is the same). We also take
# the separator images from QDarkStyle (MIT).
icons_path = _qt_init_icons()
stylesheet = """\
QStatusBar {
border: 1px solid rgb(76, 76, 75);
Expand All @@ -245,23 +244,7 @@ def _qt_get_stylesheet(theme):
background-color: transparent;
border-bottom: 1px solid rgb(99, 99, 99);
}
QToolBar::separator:horizontal {
width: 16px;
image: url("%(icons_path)s/toolbar_separator_horizontal@2x.png");
}
QToolBar::separator:vertical {
height: 16px;
image: url("%(icons_path)s/toolbar_separator_vertical@2x.png");
}
QToolBar::handle:horizontal {
width: 16px;
image: url("%(icons_path)s/toolbar_move_horizontal@2x.png");
}
QToolBar::handle:vertical {
height: 16px;
image: url("%(icons_path)s/toolbar_move_vertical@2x.png");
}
""" % dict(icons_path=icons_path)
"""
else:
stylesheet = ''
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/azure_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ elif [ "${TEST_MODE}" == "pip-pre" ]; then
# SciPy Windows build is missing from conda nightly builds
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --no-deps -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" numpy
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --no-deps scipy
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --no-deps -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" pandas scikit-learn dipy statsmodels
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --no-deps --default-timeout=60 -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" pandas scikit-learn dipy statsmodels
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --no-deps -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" h5py Pillow matplotlib
# Until VTK comes out with a 3.10 wheel, we need to use PyVista's
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" https://github.com/pyvista/pyvista-wheels/raw/3b70f3933bc246b035354b172a0459ffc96b0343/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl
Expand Down
2 changes: 1 addition & 1 deletion tools/github_actions_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
echo "PyQt5"
pip install $STD_ARGS --pre --only-binary ":all:" --no-deps --extra-index-url https://www.riverbankcomputing.com/pypi/simple PyQt5 PyQt5-sip PyQt5-Qt5
echo "NumPy/SciPy/pandas etc."
pip install $STD_ARGS --pre --only-binary ":all:" --no-deps -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" numpy scipy pandas scikit-learn statsmodels dipy
pip install $STD_ARGS --pre --only-binary ":all:" --no-deps --default-timeout=60 -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" numpy scipy pandas scikit-learn statsmodels dipy
echo "H5py, pillow, matplotlib"
pip install $STD_ARGS --pre --only-binary ":all:" --no-deps -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" h5py pillow matplotlib
# We don't install Numba here because it forces an old NumPy version
Expand Down