From a3a6e3acffa7ed480924453d5475b9155f333682 Mon Sep 17 00:00:00 2001 From: Gnefil Date: Mon, 30 Mar 2026 00:04:29 +0800 Subject: [PATCH 1/3] DOC: Remove invalid ndarray option from colormap docstrings --- mne/utils/docs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mne/utils/docs.py b/mne/utils/docs.py index fc7d33a6f4b..8d1be904fc7 100644 --- a/mne/utils/docs.py +++ b/mne/utils/docs.py @@ -835,10 +835,10 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75): """ docdict["colormap"] = """ -colormap : str | np.ndarray of float, shape(n_colors, 3 | 4) - Name of colormap to use or a custom look up table. If array, must - be (n x 3) or (n x 4) array for with RGB or RGBA values between - 0 and 255. +colormap : str | matplotlib.colors.Colormap + Name of colormap to use or a custom look up table. If passing a custom + colormap, it must be an instance of :class:`matplotlib.colors.Colormap` + (e.g., :class:`matplotlib.colors.ListedColormap`). """ _combine_template = """ From b6939da768346db974cfc6edb7675f99a51661a2 Mon Sep 17 00:00:00 2001 From: Gnefil Date: Mon, 30 Mar 2026 01:26:06 +0800 Subject: [PATCH 2/3] DOC: Add changelog for #13797 --- doc/changes/dev/13797.other.rst | 1 + doc/changes/names.inc | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/changes/dev/13797.other.rst diff --git a/doc/changes/dev/13797.other.rst b/doc/changes/dev/13797.other.rst new file mode 100644 index 00000000000..75be8cbf848 --- /dev/null +++ b/doc/changes/dev/13797.other.rst @@ -0,0 +1 @@ +Remove :class:`numpy.ndarray` from `colormap` parameter in :func:`mne.viz.plot_source_estimates` to solve documentation conflict , by :newcontrib:`Lifeng Qiu Lin`. \ No newline at end of file diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 48c3b86d2be..c42139ff57d 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -186,6 +186,7 @@ .. _Leonardo Barbosa: https://github.com/noreun .. _Leonardo Rochael Almeida: https://github.com/leorochael .. _Liberty Hamilton: https://github.com/libertyh +.. _Lifeng Qiu Lin: https://github.com/Gnefil .. _Lorenzo Desantis: https://github.com/lorenzo-desantis/ .. _Lukas Breuer: https://www.researchgate.net/profile/Lukas-Breuer-2 .. _Lukas Gemein: https://github.com/gemeinl From a2438c786eac0dd9bfb0c0772b7e31a57f6f4393 Mon Sep 17 00:00:00 2001 From: Gnefil Date: Mon, 30 Mar 2026 12:27:58 +0800 Subject: [PATCH 3/3] DOC: Update to clearer explanation and apply backticks correctly --- doc/changes/dev/13797.other.rst | 2 +- mne/utils/docs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/changes/dev/13797.other.rst b/doc/changes/dev/13797.other.rst index 75be8cbf848..6619072b1ef 100644 --- a/doc/changes/dev/13797.other.rst +++ b/doc/changes/dev/13797.other.rst @@ -1 +1 @@ -Remove :class:`numpy.ndarray` from `colormap` parameter in :func:`mne.viz.plot_source_estimates` to solve documentation conflict , by :newcontrib:`Lifeng Qiu Lin`. \ No newline at end of file +Remove :class:`numpy.ndarray` from ``colormap`` parameter in :func:`mne.viz.plot_source_estimates` to solve documentation conflict , by :newcontrib:`Lifeng Qiu Lin`. \ No newline at end of file diff --git a/mne/utils/docs.py b/mne/utils/docs.py index 8d1be904fc7..ca586068a5d 100644 --- a/mne/utils/docs.py +++ b/mne/utils/docs.py @@ -836,8 +836,8 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75): docdict["colormap"] = """ colormap : str | matplotlib.colors.Colormap - Name of colormap to use or a custom look up table. If passing a custom - colormap, it must be an instance of :class:`matplotlib.colors.Colormap` + Name of colormap to use or a custom Matplotlib colormap instance. If passing + a custom colormap, it must be an instance of :class:`matplotlib.colors.Colormap` (e.g., :class:`matplotlib.colors.ListedColormap`). """