Skip to content

Commit

Permalink
signal_(interpolate|detrend): added missing spaces
Browse files Browse the repository at this point in the history
- interpolate: missing space before quadratic to make the highlighting
  work
- interpolate: added more precise linking
- detrend: entire docstring was misaligned by missing some empty lines
  • Loading branch information
DerAndereJohannes committed Jul 21, 2024
1 parent 97437ae commit 5b667ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions neurokit2/signal/signal_detrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ def signal_detrend(
sampling_rate=1000,
):
"""**Signal Detrending**
Apply a baseline (order = 0), linear (order = 1), or polynomial (order > 1) detrending to the
signal (i.e., removing a general trend). One can also use other methods, such as smoothness
priors approach described by Tarvainen (2002) or LOESS regression, but these scale badly for
long signals.
Parameters
----------
signal : Union[list, np.array, pd.Series]
Expand Down
7 changes: 4 additions & 3 deletions neurokit2/signal/signal_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def signal_interpolate(
method : str
Method of interpolation. Can be ``"linear"``, ``"nearest"``, ``"zero"``, ``"slinear"``,
``"quadratic"``, ``"cubic"``, ``"previous"``, ``"next"``, ``"monotone_cubic"``, or ``"akima"``.
The methods ``"zero"``, ``"slinear"``,``"quadratic"`` and ``"cubic"`` refer to a spline
The methods ``"zero"``, ``"slinear"``, ``"quadratic"`` and ``"cubic"`` refer to a spline
interpolation of zeroth, first, second or third order; whereas ``"previous"`` and
``"next"`` simply return the previous or next value of the point. An integer specifying the
order of the spline interpolator to use.
See `here <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
See `monotone cubic method <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
PchipInterpolator.html>`_ for details on the ``"monotone_cubic"`` method.
See `here <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
See `akima method <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
Akima1DInterpolator.html>`_ for details on the ``"akima"`` method.
fill_value : float or tuple or str
If a ndarray (or float), this value will be used to fill in for
Expand Down Expand Up @@ -87,6 +87,7 @@ def signal_interpolate(
plt.scatter(x_values, signal, label="original datapoints", zorder=3)
@suppress
plt.close()
"""
# Sanity checks
if x_values is None:
Expand Down

0 comments on commit 5b667ee

Please sign in to comment.