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
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
1 change: 1 addition & 0 deletions doc/changes/dev/13445.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve precision of fiducial clicking in ``mne coreg``, by `Eric Larson`_.
14 changes: 7 additions & 7 deletions doc/install/installers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Platform-specific installers
:class-content: text-center
:name: install-linux

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.1/MNE-Python-1.10.1_0-Linux.sh
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.2/MNE-Python-1.10.2_0-Linux.sh
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -31,14 +31,14 @@ Platform-specific installers

.. code-block:: console

$ sh ./MNE-Python-1.10.1_0-Linux.sh
$ sh ./MNE-Python-1.10.2_0-Linux.sh


.. tab-item:: macOS (Intel)
:class-content: text-center
:name: install-macos-intel

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.1/MNE-Python-1.10.1_0-macOS_Intel.pkg
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.2/MNE-Python-1.10.2_0-macOS_Intel.pkg
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -54,7 +54,7 @@ Platform-specific installers
:class-content: text-center
:name: install-macos-apple

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.1/MNE-Python-1.10.1_0-macOS_M1.pkg
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.2/MNE-Python-1.10.2_0-macOS_M1.pkg
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -70,7 +70,7 @@ Platform-specific installers
:class-content: text-center
:name: install-windows

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.1/MNE-Python-1.10.1_0-Windows.exe
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.10.2/MNE-Python-1.10.2_0-Windows.exe
:ref-type: ref
:color: primary
:shadow:
Expand Down Expand Up @@ -156,7 +156,7 @@ To remove the MNE-Python distribution provided by our installers above:
.. code-block:: bash

$ which python
/home/username/mne-python/1.10.1_0/bin/python
/home/username/mne-python/1.10.2_0/bin/python
$ rm -Rf /home/$USER/mne-python
$ rm /home/$USER/.local/share/applications/mne-python-*.desktop

Expand All @@ -170,7 +170,7 @@ To remove the MNE-Python distribution provided by our installers above:
.. code-block:: bash

$ which python
/Users/username/Applications/MNE-Python/1.10.1_0/.mne-python/bin/python
/Users/username/Applications/MNE-Python/1.10.2_0/.mne-python/bin/python
$ rm -Rf /Users/$USER/Applications/MNE-Python # if user-specific
$ rm -Rf /Applications/MNE-Python # if system-wide

Expand Down
2 changes: 2 additions & 0 deletions mne/beamformer/tests/test_dics.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ def test_apply_dics_timeseries(_load_forward, idx):
apply_dics_epochs(epochs, filters_vol)


@pytest.mark.slowtest
@testing.requires_testing_data
@pytest.mark.parametrize("return_generator", (True, False))
def test_apply_dics_tfr(return_generator):
Expand Down Expand Up @@ -849,6 +850,7 @@ def test_localization_bias_free(
assert lower <= perc <= upper


@pytest.mark.slowtest
@pytest.mark.parametrize(
"weight_norm, lower, upper, lower_ori, upper_ori, real_filter",
[
Expand Down
4 changes: 3 additions & 1 deletion mne/beamformer/tests/test_lcmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ def test_lcmv_reg_proj(proj, weight_norm):
assert_allclose(stc_cov.data.std(), 0.187, rtol=0.2)


@pytest.mark.slowtest
@pytest.mark.parametrize(
"reg, weight_norm, use_cov, depth, lower, upper",
[
Expand Down Expand Up @@ -851,6 +852,7 @@ def test_localization_bias_fixed(


# Changes here should be synced with test_dics.py
@pytest.mark.slowtest
@pytest.mark.parametrize(
"reg, pick_ori, weight_norm, use_cov, depth, lower, upper, lower_ori, upper_ori",
[
Expand Down Expand Up @@ -1044,7 +1046,7 @@ def test_orientation_max_power(
"weight_norm, pick_ori",
[
pytest.param("nai", "max-power", marks=pytest.mark.slowtest),
("unit-noise-gain", "vector"),
pytest.param("unit-noise-gain", "vector", marks=pytest.mark.slowtest),
("unit-noise-gain", "max-power"),
pytest.param("unit-noise-gain", None, marks=pytest.mark.slowtest),
],
Expand Down
11 changes: 1 addition & 10 deletions mne/gui/_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,19 +918,10 @@ def _on_pick(self, vtk_picker, event):
if not any(mesh is target() for target in self._picking_targets):
return
pos = np.array(vtk_picker.GetPickPosition())
vtk_cell = mesh.GetCell(cell_id)
cell = [
vtk_cell.GetPointId(point_id)
for point_id in range(vtk_cell.GetNumberOfPoints())
]
vertices = mesh.points[cell]
idx = np.argmin(abs(vertices - pos), axis=0)
vertex_id = cell[idx[0]]

fiducials = [s.lower() for s in self._defaults["fiducials"]]
idx = fiducials.index(self._current_fiducial.lower())
# XXX: add coreg.set_fids
self.coreg._fid_points[idx] = self._surfaces["head"].points[vertex_id]
self.coreg._fid_points[idx] = pos
self.coreg._reset_fiducials()
self._update_fiducials()
self._update_plot("mri_fids")
Expand Down
8 changes: 1 addition & 7 deletions mne/gui/tests/test_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class TstVTKPicker:
def __init__(self, mesh, cell_id, event_pos):
self.mesh = mesh
self.cell_id = cell_id
self.point_id = None
self.event_pos = event_pos

def GetCellId(self):
Expand All @@ -59,12 +58,7 @@ def GetDataSet(self):
def GetPickPosition(self):
"""Return the picked position."""
vtk_cell = self.mesh.GetCell(self.cell_id)
cell = [
vtk_cell.GetPointId(point_id)
for point_id in range(vtk_cell.GetNumberOfPoints())
]
self.point_id = cell[0]
return self.mesh.points[self.point_id]
return self.mesh.points[vtk_cell.GetPointId(0)]

def GetEventPosition(self):
"""Return event position."""
Expand Down
58 changes: 46 additions & 12 deletions mne/minimum_norm/tests/test_inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def _compare_io(inv_op, *, out_file_ext=".fif", tmp_path):
_compare(inv_init, inv_op)


@pytest.mark.slowtest
def test_warn_inverse_operator(evoked, noise_cov):
"""Test MNE inverse warning without average EEG projection."""
bad_info = evoked.info
Expand Down Expand Up @@ -390,12 +391,22 @@ def test_inverse_operator_channel_ordering(evoked, noise_cov):
@pytest.mark.parametrize(
"method, lower, upper, depth",
[
("MNE", 54, 57, dict(limit=None, combine_xyz=False, exp=1.0)), # DICS def
("MNE", 75, 80, dict(limit_depth_chs=False)), # ancient MNE default
pytest.param(
"MNE",
54,
57,
dict(limit=None, combine_xyz=False, exp=1.0),
marks=pytest.mark.slowtest,
), # DICS default
pytest.param(
"MNE", 75, 80, dict(limit_depth_chs=False), marks=pytest.mark.slowtest
), # ancient MNE default
("MNE", 83, 87, 0.8), # MNE default
("MNE", 89, 92, dict(limit_depth_chs="whiten")), # sparse default
("dSPM", 96, 98, 0.8),
("sLORETA", 100, 100, 0.8),
pytest.param(
"MNE", 89, 92, dict(limit_depth_chs="whiten"), marks=pytest.mark.slowtest
), # sparse default
pytest.param("dSPM", 96, 98, 0.8, marks=pytest.mark.slowtest),
pytest.param("sLORETA", 100, 100, 0.8, marks=pytest.mark.slowtest),
pytest.param("eLORETA", 100, 100, None, marks=pytest.mark.slowtest),
pytest.param("eLORETA", 100, 100, 0.8, marks=pytest.mark.slowtest),
],
Expand All @@ -418,11 +429,25 @@ def test_localization_bias_fixed(bias_params_fixed, method, lower, upper, depth)
@pytest.mark.parametrize(
"method, lower, upper, depth, loose",
[
("MNE", 32, 37, dict(limit=None, combine_xyz=False, exp=1.0), 0.2), # DICS
pytest.param(
"MNE",
32,
37,
dict(limit=None, combine_xyz=False, exp=1.0),
0.2,
marks=pytest.mark.slowtest,
), # DICS
("MNE", 78, 81, 0.8, 0.2), # MNE default
("MNE", 89, 92, dict(limit_depth_chs="whiten"), 0.2), # sparse default
("dSPM", 85, 87, 0.8, 0.2),
("sLORETA", 100, 100, 0.8, 0.2),
pytest.param(
"MNE",
89,
92,
dict(limit_depth_chs="whiten"),
0.2,
marks=pytest.mark.slowtest,
), # sparse default
pytest.param("dSPM", 85, 87, 0.8, 0.2, marks=pytest.mark.slowtest),
pytest.param("sLORETA", 100, 100, 0.8, 0.2, marks=pytest.mark.slowtest),
pytest.param("eLORETA", 99, 100, None, 0.2, marks=pytest.mark.slowtest),
pytest.param("eLORETA", 99, 100, 0.8, 0.2, marks=pytest.mark.slowtest),
pytest.param("eLORETA", 99, 100, 0.8, 0.001, marks=pytest.mark.slowtest),
Expand Down Expand Up @@ -461,7 +486,7 @@ def test_localization_bias_loose(
@pytest.mark.parametrize(
"method, lower, upper, lower_ori, upper_ori, kwargs, depth, loose",
[
(
pytest.param(
"MNE",
21,
24,
Expand All @@ -470,8 +495,9 @@ def test_localization_bias_loose(
{},
dict(limit=None, combine_xyz=False, exp=1.0),
1,
marks=pytest.mark.slowtest,
),
(
pytest.param(
"MNE",
35,
40,
Expand All @@ -480,6 +506,7 @@ def test_localization_bias_loose(
{},
dict(limit_depth_chs=False),
1,
marks=pytest.mark.slowtest,
), # ancient default
("MNE", 45, 55, 0.94, 0.95, {}, 0.8, 1), # MNE default
(
Expand All @@ -493,7 +520,9 @@ def test_localization_bias_loose(
1,
), # sparse default
("dSPM", 40, 45, 0.96, 0.97, {}, 0.8, 1),
("sLORETA", 93, 95, 0.95, 0.96, {}, 0.8, 1),
pytest.param(
"sLORETA", 93, 95, 0.95, 0.96, {}, 0.8, 1, marks=pytest.mark.slowtest
),
pytest.param(
"eLORETA",
93,
Expand Down Expand Up @@ -567,6 +596,7 @@ def test_apply_inverse_sphere(evoked, tmp_path):
assert_array_equal(np.argmax(stc.data, axis=0), np.repeat(np.arange(101), 3))


@pytest.mark.slowtest
@pytest.mark.parametrize("loose", [0.0, 0.2, 1.0])
@pytest.mark.parametrize("lambda2", [1.0 / 9.0, 0.0])
def test_apply_inverse_eLORETA_MNE_equiv(bias_params_free, loose, lambda2):
Expand Down Expand Up @@ -764,6 +794,7 @@ def assert_var_exp_log(log, lower, upper):
return exp_var


@pytest.mark.slowtest
@pytest.mark.parametrize("method", INVERSE_METHODS)
@pytest.mark.parametrize("pick_ori", (None, "vector"))
def test_inverse_residual(evoked, method, pick_ori):
Expand Down Expand Up @@ -936,6 +967,7 @@ def test_make_inverse_operator_vector(evoked, noise_cov):
assert_allclose(stc_diff.data, (stc_vec0 - stc_vec1).magnitude().data, atol=1e-20)


@pytest.mark.slowtest
def test_make_inverse_operator_diag(evoked, noise_cov, tmp_path, azure_windows):
"""Test MNE inverse computation with diagonal noise cov."""
noise_cov = noise_cov.as_diag()
Expand Down Expand Up @@ -1056,6 +1088,7 @@ def test_io_inverse_operator(tmp_path):
_fast_methods.pop(_fast_methods.index("eLORETA"))


@pytest.mark.slowtest
@testing.requires_testing_data
@pytest.mark.parametrize("method", _fast_methods)
@pytest.mark.parametrize("pick_ori", ["normal", None])
Expand Down Expand Up @@ -1118,6 +1151,7 @@ def test_apply_inverse_cov(method, pick_ori):
)


@pytest.mark.slowtest
@testing.requires_testing_data
def test_apply_mne_inverse_raw():
"""Test MNE with precomputed inverse operator on Raw."""
Expand Down
2 changes: 2 additions & 0 deletions mne/minimum_norm/tests/test_resolution_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
fname_label = data_path / "subjects" / "sample" / "label" / "lh.V1.label"


@pytest.mark.slowtest
@testing.requires_testing_data
@pytest.mark.parametrize("src_type", ("surface", "volume"))
def test_resolution_matrix_free(src_type, fwd_volume_small):
Expand Down Expand Up @@ -131,6 +132,7 @@ def test_resolution_matrix_free(src_type, fwd_volume_small):
assert_array_almost_equal(stc_psf_label_free.data, stc_ctf_label_free.data)


@pytest.mark.slowtest
@testing.requires_testing_data
def test_resolution_matrix_fixed():
"""Test resolution matrices with fixed orientations."""
Expand Down
1 change: 1 addition & 0 deletions mne/minimum_norm/tests/test_time_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def test_tfr_multi_label():
assert multi_lab_pow.shape == (2, n_freqs, n_times)


@pytest.mark.slowtest
@testing.requires_testing_data
@pytest.mark.parametrize("method", INVERSE_METHODS)
@pytest.mark.parametrize("pick_ori", (None, "normal")) # XXX vector someday?
Expand Down
1 change: 1 addition & 0 deletions mne/tests/test_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def test_voxel_neighbors():
assert true_volume.difference(volume) == set()


@pytest.mark.slowtest
@testing.requires_testing_data
@pytest.mark.parametrize("ret_nn", (False, True))
@pytest.mark.parametrize("method", ("accurate", "nearest"))
Expand Down
Loading