Skip to content

Commit 52befad

Browse files
committed
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.
1 parent 2d8cba9 commit 52befad

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

doc/changes/dev/14134.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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`_.

mne/_fiff/matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def write_named_matrix(fid, kind, mat):
103103
The opened file descriptor.
104104
kind : int
105105
The kind of the matrix.
106-
matkind : int
106+
mat : int
107107
The type of matrix.
108108
"""
109109
# let's save ourselves from disaster

mne/decoding/csp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def _ajd_pham(X, eps=1e-6, max_iter=15):
613613
A set of covariance matrices to diagonalize.
614614
eps : float, default 1e-6
615615
The tolerance for stopping criterion.
616-
max_iter : int, default 1000
616+
max_iter : int, default 15
617617
The maximum number of iteration to reach convergence.
618618
619619
Returns

mne/forward/_compute_forward.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def _lin_field_coeff(surf, mult, rmags, cosmags, ws, bins, n_jobs):
6868
mult : float
6969
Multiplier for particular BEM surface (Iso Skull Approach discussed in
7070
Mosher et al., 1999 and Hämäläinen and Sarvas, 1989 Section III?)
71-
rmag : ndarray, shape (n_integration_pts, 3)
71+
rmags : ndarray, shape (n_integration_pts, 3)
7272
3D positions of MEG coil integration points (from coil['rmag'])
73-
cosmag : ndarray, shape (n_integration_pts, 3)
73+
cosmags : ndarray, shape (n_integration_pts, 3)
7474
Direction of the MEG coil integration points (from coil['cosmag'])
7575
ws : ndarray, shape (n_integration_pts,)
7676
Weights for MEG coil integration points
@@ -116,9 +116,9 @@ def _do_lin_field_coeff(bem_rr, tris, tn, ta, rmags, cosmags, ws, bins):
116116
Triangle unit normal vectors
117117
ta : ndarray, shape (n_BEM_vertices,)
118118
Triangle areas
119-
rmag : ndarray, shape (n_sensor_pts, 3)
119+
rmags : ndarray, shape (n_sensor_pts, 3)
120120
3D positions of MEG coil integration points (from coil['rmag'])
121-
cosmag : ndarray, shape (n_sensor_pts, 3)
121+
cosmags : ndarray, shape (n_sensor_pts, 3)
122122
Direction of the MEG coil integration points (from coil['cosmag'])
123123
ws : ndarray, shape (n_sensor_pts,)
124124
Weights for MEG coil integration points

mne/preprocessing/maxwell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ def _sss_basis(exp, all_coils):
17021702
ext_order : int
17031703
Order of the external multipolar moment space
17041704
1705-
coils : list
1705+
all_coils : list
17061706
List of MEG coils. Each should contain coil information dict specifying
17071707
position, normals, weights, number of integration points and channel
17081708
type. All coil geometry must be in the same coordinate frame

mne/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def _cart_to_sph(cart):
773773
774774
Parameters
775775
----------
776-
cart_pts : ndarray, shape (n_points, 3)
776+
cart : ndarray, shape (n_points, 3)
777777
Array containing points in Cartesian coordinates (x, y, z)
778778
779779
Returns

mne/viz/backends/_abstract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ def text2d(
555555
556556
Parameters
557557
----------
558-
x : float
558+
x_window : float
559559
The X component to use as position of the text in the
560560
window coordinates system (window_width, window_height).
561-
y : float
561+
y_window : float
562562
The Y component to use as position of the text in the
563563
window coordinates system (window_width, window_height).
564564
text : str

0 commit comments

Comments
 (0)