From ce6ff24886e6db5d9e325ddbdbf26f95a684b60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Wed, 11 May 2022 09:23:53 +0200 Subject: [PATCH] Simplify #10619 --- mne/preprocessing/_csd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mne/preprocessing/_csd.py b/mne/preprocessing/_csd.py index da7b3d51cab..c5f99ac7efb 100644 --- a/mne/preprocessing/_csd.py +++ b/mne/preprocessing/_csd.py @@ -179,10 +179,10 @@ def compute_current_source_density(inst, sphere='auto', lambda2=1e-5, # Remove rejection thresholds for EEG if isinstance(inst, BaseEpochs): - inst.reject = None if inst.reject is None else \ - {k: v for k, v in inst.reject.items() if k != 'eeg'} - inst.flat = None if inst.flat is None else \ - {k: v for k, v in inst.flat.items() if k != 'eeg'} + 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