Skip to content

Commit 48f1588

Browse files
authored
MAINT: Stabilize MxNE tests (#13321)
1 parent ed26706 commit 48f1588

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on: # yamllint disable-line rule:truthy
77
branches: ["main", "maint/*"]
88
pull_request:
99
branches: ["main", "maint/*"]
10+
# adapted from spyder-ide/spyder
11+
workflow_dispatch:
12+
inputs:
13+
ssh:
14+
description: 'Enable ssh debugging'
15+
required: false
16+
default: false
17+
type: boolean
1018

1119
permissions:
1220
contents: read
@@ -87,6 +95,21 @@ jobs:
8795
with:
8896
fetch-depth: 0
8997
persist-credentials: false
98+
- name: Get commit message
99+
run: echo "COMMIT_MESSAGE=$(git show -s --format=%s ${{ github.event.pull_request.head.sha || github.sha }})" | tee -a ${GITHUB_ENV}
100+
- name: Triage SSH
101+
run: |
102+
if [[ "${{ inputs.ssh }}" == "true" ]] || [[ "$COMMIT_MESSAGE" == *"[actions ssh]"* ]]; then
103+
echo "ENABLE_SSH=true" | tee -a $GITHUB_ENV
104+
else
105+
echo "ENABLE_SSH=false" | tee -a $GITHUB_ENV
106+
fi
107+
- name: Setup Remote SSH Connection
108+
if: env.ENABLE_SSH == 'true'
109+
uses: mxschmitt/action-tmate@v3
110+
timeout-minutes: 80
111+
with:
112+
detached: true
90113
- run: ./tools/github_actions_env_vars.sh
91114
# Xvfb/OpenGL
92115
- uses: pyvista/setup-headless-display-action@v4

mne/inverse_sparse/tests/test_mxne_inverse.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,13 @@ def test_mxne_vol_sphere():
364364
tstep=stc.tstep,
365365
)
366366
evoked_dip = mne.simulation.simulate_evoked(
367-
fwd, stc, info, cov, nave=1e9, use_cps=True
367+
fwd,
368+
stc,
369+
info,
370+
cov,
371+
nave=1e9,
372+
use_cps=True,
373+
random_state=0,
368374
)
369375

370376
dip_mxne = mixed_norm(
@@ -587,7 +593,14 @@ def data_fun(times):
587593
assert_array_equal(stc.vertices[1], [70279])
588594
nave = 30
589595
evoked = simulate_evoked(
590-
forward, stc, info, noise_cov, nave=nave, use_cps=False, iir_filter=None
596+
forward,
597+
stc,
598+
info,
599+
noise_cov,
600+
nave=nave,
601+
use_cps=False,
602+
iir_filter=None,
603+
random_state=0,
591604
)
592605
evoked = evoked.crop(tmin=0, tmax=10e-3)
593606
stc_ = mixed_norm(

tools/github_actions_dependencies.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ if [ ! -z "$CONDA_ENV" ]; then
2121
STD_ARGS="--progress-bar off"
2222
fi
2323
elif [[ "${MNE_CI_KIND}" == "pip" ]]; then
24-
# Only used for 3.13 at the moment, just get test deps plus a few extras
25-
# that we know are available
26-
INSTALL_ARGS="nibabel scikit-learn numpydoc PySide6!=6.9.1 mne-qt-browser pandas h5io mffpy defusedxml numba pyvistaqt"
27-
INSTALL_KIND="test"
24+
INSTALL_KIND="full-pyside6,$INSTALL_KIND"
2825
else
2926
test "${MNE_CI_KIND}" == "pip-pre"
3027
STD_ARGS="$STD_ARGS --pre"

0 commit comments

Comments
 (0)