Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] auto-add event_id key for BAD_ACQ_SKIP #1258

Merged
merged 5 commits into from
May 30, 2024

Conversation

drammock
Copy link
Member

@drammock drammock commented May 29, 2024

PR Description

closes #1257

write_raw_bids will now allow the situation where BAD_ACQ_SKIP annotations are present in the raw file, but no corresponding key is present in the user-passed event_id dict.

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

mne_bids/read.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.46%. Comparing base (87eea28) to head (aff3f57).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1258      +/-   ##
==========================================
- Coverage   97.61%   97.46%   -0.16%     
==========================================
  Files          40       40              
  Lines        8685     8703      +18     
==========================================
+ Hits         8478     8482       +4     
- Misses        207      221      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@drammock
Copy link
Member Author

IDK what codecov is complaining about: from the diff on their site it looks like 100% of the new lines are hit

mne_bids/read.py Outdated
if set(desc_without_id) & special_annots:
for annot in special_annots:
# use a value guaranteed to not be in use
event_id = {annot: max(event_id.values()) + 1} | event_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps go much higher? Like, + 10000 or so? To clearly separate those events from the rest

Copy link
Member

@hoechenberger hoechenberger May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sappelhoff If you feel this is unnecessary, go ahead and merge

it was just a thought

also since we do something similar in MNE itself I believe, with super high event codes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean this?

Suggested change
event_id = {annot: max(event_id.values()) + 1} | event_id
event_id = {annot: max(event_id.values()) + 10000} | event_id

I think it's a reasonable point 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in aff3f57

@sappelhoff
Copy link
Member

IDK what codecov is complaining about: from the diff on their site it looks like 100% of the new lines are hit

I find the following suspicious:

BASE commit is 26 commits behind HEAD on main c87a823

see: https://app.codecov.io/gh/mne-tools/mne-bids/pull/1258

it's using 87eea28 as the BASE commit, which is really outdated 🤔 I would have expected it to use HEAD as the BASE commit (c87a823)

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @drammock

@sappelhoff sappelhoff added this to the 0.15 milestone May 30, 2024
@drammock drammock changed the title auto-add event_id key for BAD_ACQ_SKIP [MRG] auto-add event_id key for BAD_ACQ_SKIP May 30, 2024
@drammock
Copy link
Member Author

all green except codecov (which as discussed is misbehaving here; PR coverage is 100%)

@hoechenberger hoechenberger merged commit 62523f7 into mne-tools:main May 30, 2024
18 of 19 checks passed
@hoechenberger
Copy link
Member

Great, thanks, Dan!

@drammock drammock deleted the auto-add-special-annots branch September 25, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_read_events errors on BAD_ACQ_SKIP
3 participants