From 657f6417df20359b78d43243e78b5471a878bee1 Mon Sep 17 00:00:00 2001 From: Anton Karpov Date: Tue, 4 Aug 2026 01:38:13 +0300 Subject: [PATCH 1/3] Add changelog entry for the tube signature fix --- doc/changes/names.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 535530a61f3..c88b0fd1cb7 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -27,6 +27,7 @@ .. _Annalisa Pascarella: https://github.com/annapasca .. _Anne-Sophie Dubarry: https://github.com/annesodub .. _Antoine Collas: https://www.antoinecollas.fr +.. _Anton Karpov: https://github.com/karpovantonme .. _Antoine Gauthier: https://github.com/Okamille .. _Anton Karpov: https://github.com/karpovantonme .. _Antti Rantala: https://github.com/Odingod From 6eed5a9b9a883fa067341cb2576db66732daf66c Mon Sep 17 00:00:00 2001 From: Anton Karpov Date: Tue, 4 Aug 2026 22:30:28 +0300 Subject: [PATCH 2/3] DOC: Fix parameter names in private helper docstrings Ten docstrings name a parameter that is not in the signature, so help() and editor tooltips show an argument that raises TypeError. Renames, one to one: - _lin_field_coeff and _do_lin_field_coeff: rmag/cosmag -> rmags/cosmags. The line just below already says 'for each rmag/cosmag/w', so the singular there is the element, the parameter is the plural. - write_named_matrix: matkind -> mat. mat was undocumented. - text2d: x/y -> x_window/y_window. - _cart_to_sph: cart_pts -> cart. - _sss_basis: coils -> all_coils. And one wrong default: _ajd_pham documents max_iter=1000, the signature has 15. pyRiemann, which the comment credits as the source, uses 20. Docstrings only. --- doc/changes/dev/14134.other.rst | 1 + mne/_fiff/matrix.py | 2 +- mne/decoding/csp.py | 2 +- mne/forward/_compute_forward.py | 8 ++++---- mne/preprocessing/maxwell.py | 2 +- mne/transforms.py | 2 +- mne/viz/backends/_abstract.py | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 doc/changes/dev/14134.other.rst diff --git a/doc/changes/dev/14134.other.rst b/doc/changes/dev/14134.other.rst new file mode 100644 index 00000000000..af84737c3f3 --- /dev/null +++ b/doc/changes/dev/14134.other.rst @@ -0,0 +1 @@ +Fix ten docstrings in private helpers that named a parameter the function does not take, and one that documented ``max_iter=1000`` for :func:`mne.decoding.csp._ajd_pham` while the signature has ``15``, by `Anton Karpov`_. diff --git a/mne/_fiff/matrix.py b/mne/_fiff/matrix.py index f27d86808f6..098986e9b37 100644 --- a/mne/_fiff/matrix.py +++ b/mne/_fiff/matrix.py @@ -103,7 +103,7 @@ def write_named_matrix(fid, kind, mat): The opened file descriptor. kind : int The kind of the matrix. - matkind : int + mat : int The type of matrix. """ # let's save ourselves from disaster diff --git a/mne/decoding/csp.py b/mne/decoding/csp.py index 18d8d5e0246..c44833cbcc8 100644 --- a/mne/decoding/csp.py +++ b/mne/decoding/csp.py @@ -613,7 +613,7 @@ def _ajd_pham(X, eps=1e-6, max_iter=15): A set of covariance matrices to diagonalize. eps : float, default 1e-6 The tolerance for stopping criterion. - max_iter : int, default 1000 + max_iter : int, default 15 The maximum number of iteration to reach convergence. Returns diff --git a/mne/forward/_compute_forward.py b/mne/forward/_compute_forward.py index dfd93e46a61..aa51beeb82e 100644 --- a/mne/forward/_compute_forward.py +++ b/mne/forward/_compute_forward.py @@ -68,9 +68,9 @@ def _lin_field_coeff(surf, mult, rmags, cosmags, ws, bins, n_jobs): mult : float Multiplier for particular BEM surface (Iso Skull Approach discussed in Mosher et al., 1999 and Hämäläinen and Sarvas, 1989 Section III?) - rmag : ndarray, shape (n_integration_pts, 3) + rmags : ndarray, shape (n_integration_pts, 3) 3D positions of MEG coil integration points (from coil['rmag']) - cosmag : ndarray, shape (n_integration_pts, 3) + cosmags : ndarray, shape (n_integration_pts, 3) Direction of the MEG coil integration points (from coil['cosmag']) ws : ndarray, shape (n_integration_pts,) Weights for MEG coil integration points @@ -116,9 +116,9 @@ def _do_lin_field_coeff(bem_rr, tris, tn, ta, rmags, cosmags, ws, bins): Triangle unit normal vectors ta : ndarray, shape (n_BEM_vertices,) Triangle areas - rmag : ndarray, shape (n_sensor_pts, 3) + rmags : ndarray, shape (n_sensor_pts, 3) 3D positions of MEG coil integration points (from coil['rmag']) - cosmag : ndarray, shape (n_sensor_pts, 3) + cosmags : ndarray, shape (n_sensor_pts, 3) Direction of the MEG coil integration points (from coil['cosmag']) ws : ndarray, shape (n_sensor_pts,) Weights for MEG coil integration points diff --git a/mne/preprocessing/maxwell.py b/mne/preprocessing/maxwell.py index 2f013961293..809b7e648fe 100644 --- a/mne/preprocessing/maxwell.py +++ b/mne/preprocessing/maxwell.py @@ -1702,7 +1702,7 @@ def _sss_basis(exp, all_coils): ext_order : int Order of the external multipolar moment space - coils : list + all_coils : list List of MEG coils. Each should contain coil information dict specifying position, normals, weights, number of integration points and channel type. All coil geometry must be in the same coordinate frame diff --git a/mne/transforms.py b/mne/transforms.py index 884e118c97d..94d8f10c30a 100644 --- a/mne/transforms.py +++ b/mne/transforms.py @@ -773,7 +773,7 @@ def _cart_to_sph(cart): Parameters ---------- - cart_pts : ndarray, shape (n_points, 3) + cart : ndarray, shape (n_points, 3) Array containing points in Cartesian coordinates (x, y, z) Returns diff --git a/mne/viz/backends/_abstract.py b/mne/viz/backends/_abstract.py index 5634cd126e4..bd80f1dbc71 100644 --- a/mne/viz/backends/_abstract.py +++ b/mne/viz/backends/_abstract.py @@ -555,10 +555,10 @@ def text2d( Parameters ---------- - x : float + x_window : float The X component to use as position of the text in the window coordinates system (window_width, window_height). - y : float + y_window : float The Y component to use as position of the text in the window coordinates system (window_width, window_height). text : str From a84cfcd0b621880d9d48e3dce87938a50dd28364 Mon Sep 17 00:00:00 2001 From: Anton Karpov Date: Wed, 5 Aug 2026 15:23:35 +0300 Subject: [PATCH 3/3] Drop the duplicate names.inc entry --- doc/changes/names.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/changes/names.inc b/doc/changes/names.inc index c88b0fd1cb7..535530a61f3 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -27,7 +27,6 @@ .. _Annalisa Pascarella: https://github.com/annapasca .. _Anne-Sophie Dubarry: https://github.com/annesodub .. _Antoine Collas: https://www.antoinecollas.fr -.. _Anton Karpov: https://github.com/karpovantonme .. _Antoine Gauthier: https://github.com/Okamille .. _Anton Karpov: https://github.com/karpovantonme .. _Antti Rantala: https://github.com/Odingod