Skip to content

Commit

Permalink
FIX: Order
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 1, 2023
1 parent 8ea8727 commit d82be9d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mne/_fiff/tests/test_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ def test_clean_info_bads():

info = pick_info(raw.info, picks_meg)
info._check_consistency()
info["bads"] += ["EEG 053"]
pytest.raises(RuntimeError, info._check_consistency)
with pytest.raises(ValueError, match="do not exist"):
info["bads"] += ["EEG 053"]
with pytest.raises(ValueError, match="unique"):
pick_info(raw.info, [0, 0])

Expand Down
3 changes: 2 additions & 1 deletion mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ def rename_channels(info, mapping, allow_duplicates=False, *, verbose=None):
raise ValueError("New channel names are not unique, renaming failed")

# do the remapping in info
info["bads"] = bads
info["bads"] = []
ch_names_mapping = dict()
for ch, ch_name in zip(info["chs"], ch_names):
ch_names_mapping[ch["ch_name"]] = ch_name
Expand All @@ -989,6 +989,7 @@ def rename_channels(info, mapping, allow_duplicates=False, *, verbose=None):
proj["data"]["col_names"], ch_names_mapping
)
info._update_redundant()
info["bads"] = bads
info._check_consistency()


Expand Down
2 changes: 1 addition & 1 deletion mne/preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"read_fine_calibration",
"write_fine_calibration",
],
"annotate_nan": ["annotate_nan"],
"_annotate_nan": ["annotate_nan"],
"interpolate": ["equalize_bads", "interpolate_bridged_electrodes"],
"_css": ["cortical_signal_suppression"],
"hfc": ["compute_proj_hfc"],
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mne/preprocessing/ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,8 +1372,8 @@ def _export_info(self, info, container, add_channels):
]
with info._unlock(update_redundant=True, check_after=True):
info["chs"] = ch_info
info["bads"] = [ch_names[k] for k in self.exclude]
info["projs"] = [] # make sure projections are removed.
info["bads"] = [ch_names[k] for k in self.exclude]

@verbose
def score_sources(
Expand Down

0 comments on commit d82be9d

Please sign in to comment.