Skip to content

ENH: Show rejection and flat thresholds in Report.add_epochs - #14448

Merged
larsoner merged 4 commits into
mne-tools:mainfrom
sruthisureshkumar-arch:report-reject-thresholds
Oct 23, 2026
Merged

larsoner merged 4 commits into
mne-tools:mainfrom
sruthisureshkumar-arch:report-reject-thresholds

Conversation

@sruthisureshkumar-arch

Copy link
Copy Markdown
Contributor

Reference issue (if any)

Closes #12396.

What does this implement/fix?

What I've added :
a new “Rejection thresholds” table in Report.add_epochs that we can see just above the Drop log that appears only when epochs were actually rejected (epochs._bad_dropped) this is automatically added, with no additional parameters, just as @larsoner suggested
The table shows:
one row per channel type with two columns that is - the reject value and the flat values in readable units, e.g. 350 µV instead of 0.00035 and also a custom rejection function shows as “custom function” and when no thresholds were used, no table is added.
I've combined the rejects and flats in the table and not as separate entries as @larsoner mentioned to make it easier to compare side by side but if necessary I can easily change the design to that instead!
Also, this picks up from #13617, which was closed and it adds a test, test_add_epochs_reject_thresholds, covering numbers with units, a custom function, and no thresholds.

Additional information

Disclosure:
Claude (Opus 5.5) drafted the first implementation and the tests, and I built on it, fixed style issues, ran the tests and the report locally, checked the output, and understand every line that was incorporated in the fix.
Here is the attached image of the output ran locally->
image

@welcome

welcome Bot commented Oct 23, 2026

Copy link
Copy Markdown

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@larsoner larsoner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

14448.newfeature.rst appears blank as well?

Comment thread mne/report/tests/test_report.py Resolved
@larsoner

Copy link
Copy Markdown
Member

Marking for squash+merge-when-green, thanks in advance @sruthisureshkumar-arch !

@larsoner
larsoner enabled auto-merge (squash) October 23, 2026 18:55
@larsoner
larsoner merged commit 6a6ca76 into mne-tools:main Oct 23, 2026
25 checks passed
@welcome

welcome Bot commented Oct 23, 2026

Copy link
Copy Markdown

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

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.

ENH: Add param to report.add_epochs to report reject/flat

2 participants