Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions doc/changes/dev/13466.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with :func:`mne.add_reference_channels` not working correctly when passing more than one channel name, by `Michael Straube`_.
2 changes: 1 addition & 1 deletion mne/_fiff/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions mne/_fiff/tests/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions mne/datasets/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
11 changes: 3 additions & 8 deletions mne/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import json
import time
import warnings
from collections import OrderedDict
from copy import deepcopy
from functools import lru_cache, partial
Expand Down Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions tools/install_pre_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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::"

Expand Down
Loading