Skip to content

Commit

Permalink
Use inst.pick() instead of inst.pick_types() (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger authored Oct 30, 2023
1 parent 327cb94 commit 2ff1a35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/source/v1.5.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Ensure `memory_file_method = "hash"` is tested (#768 by @larsoner)
- Enable [pre-commit.ci](https://pre-commit.ci) (#774 by @larsoner)
- Use `pooch` for web downloads (#775 by @larsoner)
- Ensure compatibility with MNE-Python 1.6 (#800 by @hoechenberger)

### :bug: Bug fixes

Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/_import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def import_er_data(
cfg=cfg,
bids_path_bads=bids_path_er_bads_in,
)
raw_er.pick_types(meg=True, exclude=[])
raw_er.pick("meg", exclude=[])

# Don't deal with ref for now (initial data quality / auto bad step)
if bids_path_ref_in is None:
Expand Down
7 changes: 2 additions & 5 deletions mne_bids_pipeline/steps/sensor/_05_decoding_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ def prepare_epochs_and_y(
*, epochs: mne.BaseEpochs, contrast: Tuple[str, str], cfg, fmin: float, fmax: float
) -> Tuple[mne.BaseEpochs, np.ndarray]:
"""Band-pass between, sub-select the desired epochs, and prepare y."""
epochs_filt = epochs.copy().pick_types(
meg=True,
eeg=True,
)
epochs_filt = epochs.copy().pick(["meg", "eeg"])

# We only take mag to speed up computation
# because the information is redundant between grad and mag
if cfg.datatype == "meg" and cfg.use_maxwell_filter:
epochs_filt.pick_types(meg="mag")
epochs_filt.pick("mag")

# filtering out the conditions we are not interested in, to ensure here we
# have a valid partition between the condition of the contrast.
Expand Down

0 comments on commit 2ff1a35

Please sign in to comment.