Skip to content

Commit

Permalink
FIX: Notes
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 6, 2023
1 parent c93165f commit 5ebd9a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
2 changes: 0 additions & 2 deletions mne/time_frequency/multitaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,7 @@ def tfr_array_multitaper(
Notes
-----
%(temporal_window_tfr_intro)s
%(temporal_window_tfr_multitaper_notes)s
%(time_bandwidth_tfr_notes)s
.. versionadded:: 0.14.0
Expand Down
5 changes: 0 additions & 5 deletions mne/time_frequency/tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,6 @@ def tfr_morlet(
Notes
-----
%(morlet_notes)s
%(temporal_window_tfr_morlet_notes)s
See :func:`mne.time_frequency.morlet` for more information about the
Expand Down Expand Up @@ -1040,9 +1039,7 @@ def tfr_array_morlet(
Notes
-----
%(morlet_notes)s
%(temporal_window_tfr_intro)s
%(temporal_window_tfr_morlet_notes)s
.. versionadded:: 0.14.0
Expand Down Expand Up @@ -1125,9 +1122,7 @@ def tfr_multitaper(
Notes
-----
%(temporal_window_tfr_intro)s
%(temporal_window_tfr_multitaper_notes)s
%(time_bandwidth_tfr_notes)s
.. versionadded:: 0.9.0
Expand Down
33 changes: 21 additions & 12 deletions mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
frequency in ``freqs``. If you want different FWHM values at each frequency,
do the same computation with ``desired_fwhm`` as an array of the same shape as
``freqs``.
""" # noqa E501
"""

# %%
# G
Expand Down Expand Up @@ -2344,7 +2344,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
] = """
label_tc : array | list (or generator) of array, shape (n_labels[, n_orient], n_times)
Extracted time course for each label and source estimate.
""" # noqa: E501
"""

docdict[
"labels_eltc"
Expand Down Expand Up @@ -2669,8 +2669,10 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):

docdict[
"morlet_notes"
] = """The Morlet wavelets follow the formulation in
:footcite:`Tallon-BaudryEtAl1997`."""
] = """
The Morlet wavelets follow the formulation in
:footcite:`Tallon-BaudryEtAl1997`.
"""

docdict[
"moving"
Expand Down Expand Up @@ -4150,7 +4152,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
.. versionadded:: 0.20
.. versionchanged:: 1.1 Added ``'eeglab'`` option.
""" # noqa E501
"""

docdict[
"split_naming"
Expand Down Expand Up @@ -4411,7 +4413,8 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):

docdict[
"temporal_window_tfr_intro"
] = """In spectrotemporal analysis (as with traditional fourier methods),
] = """
In spectrotemporal analysis (as with traditional fourier methods),
the temporal and spectral resolution are interrelated: longer temporal windows
allow more precise frequency estimates; shorter temporal windows "smear"
frequency estimates while providing more precise timing information.
Expand All @@ -4427,11 +4430,13 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
decrease with frequency, the temporal smoothing decreases and the frequency
smoothing increases with frequency.*
Source: `FieldTrip tutorial: Time-frequency analysis using Hanning window,
multitapers and wavelets <https://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis>`_."""
multitapers and wavelets <https://www.fieldtriptoolbox.org/tutorial/timefrequencyanalysis>`_.
""" # noqa: E501

docdict[
"temporal_window_tfr_morlet_notes"
] = r"""In MNE-Python, the length of the Morlet wavelet is affected by the arguments
] = r"""
In MNE-Python, the length of the Morlet wavelet is affected by the arguments
``freqs`` and ``n_cycles``, which define the frequencies of interest
and the number of cycles, respectively. For the time-frequency representation,
the length of the wavelet is defined such that both tails of
Expand All @@ -4445,11 +4450,13 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
deviation of the wavelet's Gaussian envelope. Note that the length of the
wavelet must not exceed the length of your signal.
For more information on the Morlet wavelet, see :func:`mne.time_frequency.morlet`."""
For more information on the Morlet wavelet, see :func:`mne.time_frequency.morlet`.
"""

docdict[
"temporal_window_tfr_multitaper_notes"
] = r"""In MNE-Python, the multitaper temporal window length is defined by the arguments
] = r"""
In MNE-Python, the multitaper temporal window length is defined by the arguments
``freqs`` and ``n_cycles``, respectively defining the frequencies of interest
and the number of cycles: :math:`T = \frac{\mathtt{n\_cycles}}{\mathtt{freqs}}`
Expand All @@ -4459,7 +4466,8 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
To use a temporal window with fixed length, the number of cycles has to be
defined based on the frequency. For example, ``freqs=np.arange(1, 6, 2)`` and
``n_cycles=freqs / 2`` yields ``T=array([0.5, 0.5, 0.5])``."""
``n_cycles=freqs / 2`` yields ``T=array([0.5, 0.5, 0.5])``.
"""

_theme = """\
theme : str | path-like
Expand Down Expand Up @@ -4556,7 +4564,8 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):

docdict[
"time_bandwidth_tfr_notes"
] = r"""In MNE-Python's multitaper functions, the frequency bandwidth is
] = r"""
In MNE-Python's multitaper functions, the frequency bandwidth is
additionally affected by the parameter ``time_bandwidth``.
The ``n_cycles`` parameter determines the temporal window length based on the
frequencies of interest: :math:`T = \frac{\mathtt{n\_cycles}}{\mathtt{freqs}}`.
Expand Down

0 comments on commit 5ebd9a1

Please sign in to comment.