Skip to content

Commit

Permalink
BUG: Fix bug with split epochs and ICA (mne-tools#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Feb 19, 2024
1 parent 5d4e3c3 commit 3c9a22c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
pip install --upgrade --progress-bar off pip
pip install --upgrade --progress-bar off "autoreject @ https://api.github.com/repos/autoreject/autoreject/zipball/master" "mne[hdf5] @ git+https://github.com/mne-tools/mne-python@main" "mne-bids[full] @ https://api.github.com/repos/mne-tools/mne-bids/zipball/main" numba
pip install -ve .[tests]
pip install "PyQt6!=6.6.1" "PyQt6-Qt6!=6.6.1"
pip install "PyQt6!=6.6.1,!=6.6.2" "PyQt6-Qt6!=6.6.1,!=6.6.2"
- run:
name: Check Qt
command: |
Expand Down
19 changes: 10 additions & 9 deletions docs/source/v1.6.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@

### :bug: Bug fixes

- Fix minor issues with path handling for cross-talk and calibration files (#834 by @larsoner)
- Fix bug where EEG `reject` params were not used for `ch_types = ["meg", "eeg"]` (#839 by @larsoner)
- Fix bug where implicit `mf_reference_run` could change across invocations of `mne_bids_pipeline`, breaking caching (#839 by @larsoner)
- Fix bug where `--no-cache` had no effect (#839 by @larsoner)
- Fix bug where the Maxwell filtering step would fail if [`find_noisy_channels_meg = False`][mne_bids_pipeline._config.find_noisy_channels_meg]` was used (#847 by @larsoner)
- Fix bug where raw, empty-room, and custom noise covariances were errantly calculated on data without ICA or SSP applied (#840 by @larsoner)
- Fix bug where multiple channel types (e.g., MEG and EEG) were not handled correctly in decoding (#853 by @larsoner)
- Fix bug where the previous default for [`ica_n_components`][mne_bids_pipeline._config.ica_n_components] of `0.8` was too conservative, changed the default to `None` to match MNE-Python (#853 by @larsoner)
- Fix bug where the events table for the average subject could overflow in reports (#854 by @larsoner)
- Fixed minor issues with path handling for cross-talk and calibration files (#834 by @larsoner)
- Fixed EEG `reject` use for `ch_types = ["meg", "eeg"]` in epoch cleaning (#839 by @larsoner)
- Fixed bug where implicit `mf_reference_run` could change across invocations of `mne_bids_pipeline`, breaking caching (#839 by @larsoner)
- Fixed `--no-cache` behavior having no effect (#839 by @larsoner)
- Fixed Maxwell filtering failures when [`find_noisy_channels_meg = False`][mne_bids_pipeline._config.find_noisy_channels_meg]` is used (#847 by @larsoner)
- Fixed raw, empty-room, and custom noise covariances calculation, previously they could errantly be calculated on data without ICA or SSP applied (#840 by @larsoner)
- Fixed multiple channel type handling (e.g., MEG and EEG) in decoding (#853 by @larsoner)
- Changed the default for [`ica_n_components`][mne_bids_pipeline._config.ica_n_components] from `0.8` (too conservative) to `None` to match MNE-Python's default (#853 by @larsoner)
- Prevent events table for the average subject overflowing in reports (#854 by @larsoner)
- Fixed split file behavior for Epochs when using ICA (#855 by @larsoner)

### :medical_symbol: Code health

Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/steps/preprocessing/_08a_apply_ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def apply_ica_epochs(
) -> dict:
bids_basename = in_files["ica"].copy().update(processing=None)
out_files = dict()
out_files["epochs"] = in_files["epochs"].copy().update(processing="ica")
out_files["epochs"] = in_files["epochs"].copy().update(processing="ica", split=None)
out_files["report"] = bids_basename.copy().update(
processing="ica", suffix="report", extension=".html"
)
Expand Down
2 changes: 2 additions & 0 deletions mne_bids_pipeline/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def pytest_configure(config):
always:constrained_layout not applied.*:UserWarning
ignore:datetime\.datetime\.utcfromtimestamp.*:DeprecationWarning
ignore:datetime\.datetime\.utcnow.*:DeprecationWarning
# pandas with no good workaround
ignore:The behavior of DataFrame concatenation with empty.*:FutureWarning
"""
for warning_line in warning_lines.split("\n"):
warning_line = warning_line.strip()
Expand Down
8 changes: 7 additions & 1 deletion mne_bids_pipeline/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ class _TestOptionsT(TypedDict, total=False):
_n_jobs = {"preprocessing/_05_make_epochs": 1}
""",
},
"ds000248_ica": {},
"ds000248_ica": {
"extra_config": """
_raw_split_size = "60MB"
_epochs_split_size = "30MB"
_n_jobs = {}
"""
},
"ds000248_T1_BEM": {
"steps": ("source/make_bem_surfaces",),
"requires": ("freesurfer",),
Expand Down

0 comments on commit 3c9a22c

Please sign in to comment.