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

BUGFIX: return events if provided when current = desired sfreq #13070

Merged
merged 11 commits into from
Jan 24, 2025
2 changes: 2 additions & 0 deletions doc/changes/devel/13070.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
return events if provided when current = desired sfreq
in :func:`mne.io.base.resample` by :newcontrib:`Roy Eric Wieske`.
1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
.. _Roman Goj: https://romanmne.blogspot.co.uk
.. _Ross Maddox: https://www.urmc.rochester.edu/labs/maddox-lab.aspx
.. _Rotem Falach: https://github.com/Falach
.. _Roy Eric Wieske: https://github.com/Randomidous
.. _Sammi Chekroud: https://github.com/schekroud
.. _Samu Taulu: https://phys.washington.edu/people/samu-taulu
.. _Samuel Deslauriers-Gauthier: https://github.com/sdeslauriers
Expand Down
5 changes: 4 additions & 1 deletion mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,10 @@ def resample(
sfreq = float(sfreq)
o_sfreq = float(self.info["sfreq"])
if _check_resamp_noop(sfreq, o_sfreq):
return self
if events:
return self, events
else:
return self

# When no event object is supplied, some basic detection of dropped
# events is performed to generate a warning. Finding events can fail
Expand Down
Loading