[pre-commit.ci] pre-commit autoupdate#12837
Merged
Conversation
updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.4](astral-sh/ruff-pre-commit@v0.6.3...v0.6.4)
Member
|
@sappelhoff adding a hotfix here for this CircleCI error that appears to be due to (I think) #12830, can you see if a warning should indeed be emitted for this montage or if it's a mistake that crept in in #12830? |
Member
|
Oof actually my hotfix is not enough, it causes an error. I'll push so you can see it in CircleCI: |
Member
|
Yes, this is an error I inadvertently introduced. I will add a fix and will include a line to the test that would have caught this! thanks for pinging me :) |
Member
|
This shows that the issue is: # %%
import mne
montage_path = mne.datasets.misc.data_path() / "sample_eeg_mri" / "sample_mri_montage.elc"
with open(montage_path) as fid:
for line in fid:
if "Labels\n" in line:
break
ch_names_ = []
for line in fid:
if not line or not set(line) - {" "}:
break
parsed1 = line.strip(" ").strip("\n") # old parsing
parsed2 = line.strip(" ").strip("\n").split() # new parsing
print(f"{line.strip()} | {parsed1} | {parsed2}")
# %%☝️ I wanted to also support ELC files that specify channel labels on a single line. I wasn't thinking about channel labels with spaces ... but that is what causes the issue. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updates: