Skip to content

Commit

Permalink
Merge branch 'main' into xfit
Browse files Browse the repository at this point in the history
  • Loading branch information
wmvanvliet authored Jan 26, 2025
2 parents 0f3239a + 3db12ff commit 17e28b0
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changes/devel/13070.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Return events when requested even when current matches the desired sfreq in :meth:`mne.io.Raw.resample` by :newcontrib:`Roy Eric Wieske`.
1 change: 1 addition & 0 deletions doc/changes/devel/13082.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with automated Mesa 3D detection for proper 3D option setting on systems with software rendering, by `Eric Larson`_.
1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,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
1 change: 1 addition & 0 deletions examples/preprocessing/movement_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
##############################################################################
# After checking the annotated movement artifacts, calculate the new transform
# and plot it:

new_dev_head_t = compute_average_dev_head_t(raw, head_pos)
raw.info["dev_head_t"] = new_dev_head_t
fig = mne.viz.plot_alignment(
Expand Down
1 change: 1 addition & 0 deletions mne/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def pytest_configure(config: pytest.Config):
# pandas
ignore:\n*Pyarrow will become a required dependency of pandas.*:DeprecationWarning
ignore:np\.find_common_type is deprecated.*:DeprecationWarning
ignore:Python binding for RankQuantileOptions.*:
# pyvista <-> NumPy 2.0
ignore:__array_wrap__ must accept context and return_scalar arguments.*:DeprecationWarning
# nibabel <-> NumPy 2.0
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 is not None:
return self, events.copy()
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
10 changes: 10 additions & 0 deletions mne/io/fiff/tests/test_raw_fiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
concatenate_events,
create_info,
equalize_channels,
events_from_annotations,
find_events,
make_fixed_length_epochs,
pick_channels,
Expand Down Expand Up @@ -1318,6 +1319,15 @@ def test_crop():
assert raw.n_times - 1 == raw3.n_times


@testing.requires_testing_data
def test_resample_with_events():
"""Test resampling raws with events."""
raw = read_raw_fif(fif_fname)
raw.resample(250) # pretend raw is recorded at 250 Hz
events, _ = events_from_annotations(raw)
raw, events = raw.resample(250, events=events)


@testing.requires_testing_data
def test_resample_equiv():
"""Test resample (with I/O and multiple files)."""
Expand Down
3 changes: 0 additions & 3 deletions mne/viz/_brain/tests/test_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,6 @@ def test_single_hemi(hemi, renderer_interactive_pyvistaqt, brain_gc):
def test_brain_save_movie(tmp_path, renderer, brain_gc, interactive_state):
"""Test saving a movie of a Brain instance."""
imageio_ffmpeg = pytest.importorskip("imageio_ffmpeg")
# TODO: Figure out why this fails -- some imageio_ffmpeg error
if os.getenv("MNE_CI_KIND", "") == "conda" and platform.system() == "Linux":
pytest.skip("Test broken for unknown reason on conda linux")

brain = _create_testing_brain(
hemi="lh", time_viewer=False, cortex=["r", "b"]
Expand Down
2 changes: 1 addition & 1 deletion mne/viz/backends/_pyvista.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ def _is_osmesa(plotter):
"surface rendering, consider upgrading to 18.3.6 or "
"later."
)
is_osmesa = "via llvmpipe" in gpu_info
is_osmesa = "llvmpipe" in gpu_info
return is_osmesa


Expand Down

0 comments on commit 17e28b0

Please sign in to comment.