diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 136b033f6c8..7f8c0d28d7f 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -13,7 +13,10 @@ jobs: name: Check towncrier entry in doc/changes/dev/ runs-on: ubuntu-latest steps: - - uses: scientific-python/action-towncrier-changelog@v1 + - uses: actions/checkout@v5 + with: + persist-credentials: false + - uses: scientific-python/action-towncrier-changelog@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BOT_USERNAME: changelog-bot diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7277065b704..04b22145319 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # Ruff mne - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.1 + rev: v0.14.2 hooks: - id: ruff-check name: ruff lint mne @@ -82,7 +82,7 @@ repos: # zizmor - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.15.2 + rev: v1.16.0 hooks: - id: zizmor diff --git a/doc/changes/dev/13466.bugfix.rst b/doc/changes/dev/13466.bugfix.rst new file mode 100644 index 00000000000..6255c69b1a4 --- /dev/null +++ b/doc/changes/dev/13466.bugfix.rst @@ -0,0 +1 @@ +Fix bug with :func:`mne.add_reference_channels` not working correctly when passing more than one channel name, by `Michael Straube`_. diff --git a/mne/_fiff/reference.py b/mne/_fiff/reference.py index b4c050c096d..13fed0eebd2 100644 --- a/mne/_fiff/reference.py +++ b/mne/_fiff/reference.py @@ -316,7 +316,7 @@ def add_reference_channels(inst, ref_channels, copy=True): "unit_mul": FIFF.FIFF_UNITM_NONE, "unit": FIFF.FIFF_UNIT_V, "coord_frame": FIFF.FIFFV_COORD_HEAD, - "loc": ref_dig_array, + "loc": ref_dig_array.copy(), } inst.info["chs"].append(chan_info) inst.info._update_redundant() diff --git a/mne/_fiff/tests/test_reference.py b/mne/_fiff/tests/test_reference.py index 9df4783e293..085f34e1bcb 100644 --- a/mne/_fiff/tests/test_reference.py +++ b/mne/_fiff/tests/test_reference.py @@ -744,6 +744,10 @@ def test_add_reference(): ref_data, _ = raw[[ref_idx, ref_idy]] assert_array_equal(ref_data, 0) + loc1 = raw.info["chs"][ref_idx]["loc"] + loc2 = raw.info["chs"][ref_idy]["loc"] + assert loc1 is not loc2 + # add reference channel to epochs raw = read_raw_fif(fif_fname, preload=True) events = read_events(eve_fname) diff --git a/mne/datasets/tests/test_datasets.py b/mne/datasets/tests/test_datasets.py index 36ff5f36095..a7f985392e7 100644 --- a/mne/datasets/tests/test_datasets.py +++ b/mne/datasets/tests/test_datasets.py @@ -10,7 +10,6 @@ import pooch import pytest -from flaky import flaky import mne.datasets._fsaverage.base from mne import datasets, read_labels_from_annot, write_labels_to_annot @@ -174,10 +173,11 @@ def _error_download_2(self, fname, downloader, processor): datasets._fake.data_path(download=True, force_update=True, **kwargs) -@flaky(max_runs=3) +# Okay to xfail this one because CircleCI downloads + uses the parcellations, +# so we'll know if they break +@pytest.mark.xfail(reason="Figshare blocks access from CIs sometimes") @pytest.mark.ultraslowtest # not really ultraslow, but flakes out a lot @testing.requires_testing_data -@requires_good_network def test_fetch_parcellations(tmp_path): """Test fetching parcellations.""" pytest.importorskip("nibabel") diff --git a/mne/surface.py b/mne/surface.py index 34977954cbc..a84ae5e043b 100644 --- a/mne/surface.py +++ b/mne/surface.py @@ -7,7 +7,6 @@ import json import time -import warnings from collections import OrderedDict from copy import deepcopy from functools import lru_cache, partial @@ -1472,16 +1471,12 @@ def _decimate_surface_vtk(points, triangles, n_triangles): ) src = vtkPolyData() vtkpoints = vtkPoints() - with warnings.catch_warnings(record=True): - warnings.simplefilter("ignore") - vtkpoints.SetData(numpy_to_vtk(points.astype(np.float64))) + vtkpoints.SetData(numpy_to_vtk(points.astype(np.float64))) src.SetPoints(vtkpoints) vtkcells = vtkCellArray() triangles_ = np.pad(triangles, ((0, 0), (1, 0)), "constant", constant_values=3) - with warnings.catch_warnings(record=True): - warnings.simplefilter("ignore") - idarr = numpy_to_vtkIdTypeArray(triangles_.ravel().astype(np.int64)) - vtkcells.SetCells(triangles.shape[0], idarr) + idarr = numpy_to_vtkIdTypeArray(triangles_.ravel().astype(np.int64)) + vtkcells.ImportLegacyFormat(idarr) src.SetPolys(vtkcells) # vtkDecimatePro was not very good, even with SplittingOff and # PreserveTopologyOn diff --git a/tools/install_pre_requirements.sh b/tools/install_pre_requirements.sh index 84f4e27316f..2e13a6b2dfe 100755 --- a/tools/install_pre_requirements.sh +++ b/tools/install_pre_requirements.sh @@ -38,13 +38,7 @@ echo "::endgroup::" # No Numba because it forces an old NumPy version echo "::group::VTK" -if [[ "$PLATFORM" == "Linux" ]]; then - # Segfault trying to load libx11.so.6 - VTK_ARGS="" -else - VTK_ARGS="--extra-index-url \"https://wheels.vtk.org\"" -fi -python -m pip install $STD_ARGS --only-binary ":all:" vtk $VTK_ARGS +python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://wheels.vtk.org" vtk python -c "import vtk" echo "::endgroup::"