Skip to content

Commit 6a0ffdf

Browse files
dependabot[bot]mne-botlarsoner
authored
[dependabot]: Bump github/codeql-action from 4.35.2 to 4.35.3 in the actions group (#13897)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mne[bot] <50266005+mne-bot@users.noreply.github.com> Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent 03dd68a commit 6a0ffdf

7 files changed

Lines changed: 29 additions & 18 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v4.35.2
47+
uses: github/codeql-action/init@v4.35.3
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v4.35.2
61+
uses: github/codeql-action/autobuild@v4.35.3
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,4 +71,4 @@ jobs:
7171
# ./location_of_script_within_repo/buildscript.sh
7272

7373
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v4.35.2
74+
uses: github/codeql-action/analyze@v4.35.3

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ dependencies:
6262
- tqdm >=4.66
6363
- traitlets
6464
- trame
65+
- trame-pyvista
6566
- trame-vtk
6667
- trame-vuetify
6768
- vtk ==9.6.0

mne/beamformer/tests/test_lcmv.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,20 @@ def test_make_lcmv_bem(tmp_path, reg, proj, kind):
564564
make_lcmv(epochs.info, forward_fixed, data_cov_grad, reg=0.01, noise_cov=noise_cov)
565565

566566

567+
@pytest.fixture(scope="module")
568+
def evoked_fwd_noise_data():
569+
"""Fixture to supply reusable data."""
570+
_, _, evoked, data_cov, noise_cov, _, _, _, _, _ = _get_data(proj=True)
571+
assert "eeg" not in evoked
572+
assert "meg" in evoked
573+
sphere = mne.make_sphere_model(r0=(0.0, 0.0, 0.0), head_radius=0.080)
574+
src = mne.setup_volume_source_space(
575+
pos=25.0, sphere=sphere, mindist=5.0, exclude=2.0
576+
)
577+
fwd_sphere = mne.make_forward_solution(evoked.info, None, src, sphere)
578+
return evoked, fwd_sphere, noise_cov, data_cov
579+
580+
567581
@testing.requires_testing_data
568582
@pytest.mark.slowtest
569583
@pytest.mark.parametrize(
@@ -576,24 +590,16 @@ def test_make_lcmv_bem(tmp_path, reg, proj, kind):
576590
(None, "max-power"),
577591
],
578592
)
579-
def test_make_lcmv_sphere(pick_ori, weight_norm):
593+
def test_make_lcmv_sphere(pick_ori, weight_norm, evoked_fwd_noise_data):
580594
"""Test LCMV with sphere head model."""
581595
# unit-noise gain beamformer and orientation
582596
# selection and rank reduction of the leadfield
583-
_, _, evoked, data_cov, noise_cov, _, _, _, _, _ = _get_data(proj=True)
584-
assert "eeg" not in evoked
585-
assert "meg" in evoked
586-
sphere = mne.make_sphere_model(r0=(0.0, 0.0, 0.0), head_radius=0.080)
587-
src = mne.setup_volume_source_space(
588-
pos=25.0, sphere=sphere, mindist=5.0, exclude=2.0
589-
)
590-
fwd_sphere = mne.make_forward_solution(evoked.info, None, src, sphere)
591-
597+
evoked, fwd_sphere, noise_cov, data_cov = evoked_fwd_noise_data
592598
# Test that we get an error if not reducing rank
593599
with (
594600
pytest.raises(ValueError, match="Singular matrix detected"),
595601
_record_warnings(),
596-
pytest.warns(RuntimeWarning, match="positive semidefinite"),
602+
pytest.warns(RuntimeWarning, match="(positive semidefinite|largest eigenvalu)"),
597603
):
598604
make_lcmv(
599605
evoked.info,

mne/source_estimate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,18 +3219,21 @@ def spatio_temporal_dist_adjacency(src, n_times, dist, verbose=None):
32193219
vertices are time 1, the nodes from 2 to 2N are the vertices
32203220
during time 2, etc.
32213221
"""
3222+
from scipy import sparse
3223+
32223224
if src[0]["dist"] is None:
32233225
raise RuntimeError(
32243226
"src must have distances included, consider using "
32253227
"setup_source_space with add_dist=True"
32263228
)
32273229
blocks = [s["dist"][s["vertno"], :][:, s["vertno"]] for s in src]
32283230
# Ensure we keep explicit zeros; deal with changes in SciPy
3229-
for block in blocks:
3231+
for bi, block in enumerate(blocks):
32303232
if isinstance(block, np.ndarray):
32313233
block[block == 0] = -np.inf
32323234
else:
32333235
block.data[block.data == 0] == -1
3236+
blocks[bi] = sparse.csr_array(block) # avoid SciPy dep warning about mat->arr
32343237
edges = sparse.block_diag(blocks)
32353238
edges.data[:] = np.less_equal(edges.data, dist)
32363239
# clean it up and put it in coo format

mne/utils/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ def sys_info(
823823
# "trame", # no version, see https://github.com/Kitware/trame/issues/183
824824
"trame_client",
825825
"trame_server",
826+
"trame_pyvista",
826827
"trame_vtk",
827828
"trame_vuetify",
828829
"",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ full-no-qt = [
185185
"threadpoolctl",
186186
"traitlets",
187187
"trame",
188+
"trame-pyvista",
188189
"trame-vtk",
189190
"trame-vuetify",
190191
"vtk >= 9.2",

tools/install_pre_requirements.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ python -m pip install $STD_ARGS \
6161
git+https://github.com/BUNPC/pysnirf2 \
6262
git+https://github.com/the-siesta-group/edfio \
6363
git+https://github.com/python-quantities/python-quantities \
64-
trame trame-vtk trame-vuetify nest-asyncio2 jupyter ipyevents ipympl openmeeg \
65-
imageio-ffmpeg xlrd mffpy traitlets pybv eeglabio defusedxml \
66-
antio curryreader
64+
trame trame-vtk trame-vuetify trame-pyvista nest-asyncio2 jupyter ipyevents ipympl \
65+
openmeeg imageio-ffmpeg xlrd mffpy traitlets pybv eeglabio defusedxml antio curryreader
6766
echo "::endgroup::"
6867

6968
echo "::group::Make sure we're on a NumPy 2.0 variant"

0 commit comments

Comments
 (0)