From 3db12ff5357d4d6666f3d2257e91cee877e83234 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 24 Jan 2025 14:16:21 -0500 Subject: [PATCH] BUG: Fix bug with Mesa 3D detection (#13082) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- doc/changes/devel/13082.bugfix.rst | 1 + examples/preprocessing/movement_detection.py | 1 + mne/conftest.py | 1 + mne/viz/_brain/tests/test_brain.py | 3 --- mne/viz/backends/_pyvista.py | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 doc/changes/devel/13082.bugfix.rst diff --git a/doc/changes/devel/13082.bugfix.rst b/doc/changes/devel/13082.bugfix.rst new file mode 100644 index 00000000000..0f5cad3d0af --- /dev/null +++ b/doc/changes/devel/13082.bugfix.rst @@ -0,0 +1 @@ +Fix bug with automated Mesa 3D detection for proper 3D option setting on systems with software rendering, by `Eric Larson`_. \ No newline at end of file diff --git a/examples/preprocessing/movement_detection.py b/examples/preprocessing/movement_detection.py index 9bcac562588..dd468feb464 100644 --- a/examples/preprocessing/movement_detection.py +++ b/examples/preprocessing/movement_detection.py @@ -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( diff --git a/mne/conftest.py b/mne/conftest.py index 8a4586067b3..2a73c7a1b8e 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -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 diff --git a/mne/viz/_brain/tests/test_brain.py b/mne/viz/_brain/tests/test_brain.py index 5d092c21713..46406542b5c 100644 --- a/mne/viz/_brain/tests/test_brain.py +++ b/mne/viz/_brain/tests/test_brain.py @@ -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"] diff --git a/mne/viz/backends/_pyvista.py b/mne/viz/backends/_pyvista.py index ee5b62404d3..0bd1ae1d3ca 100644 --- a/mne/viz/backends/_pyvista.py +++ b/mne/viz/backends/_pyvista.py @@ -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