Skip to content

Commit bcb7949

Browse files
committed
DOC: improve docstring style
1 parent 41cc925 commit bcb7949

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

pywt/_dwt.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,33 +404,37 @@ def upcoef(part, coeffs, wavelet, level=1, take=0):
404404
def pad(x, pad_widths, mode):
405405
"""Extend a 1D signal using a given boundary mode.
406406
407-
This function operates like ``numpy.pad`` but supports all signal extension
408-
modes that can be used by PyWavelets discrete wavelet transforms.
407+
This function operates like :func:`numpy.pad` but supports all signal
408+
extension modes that can be used by PyWavelets discrete wavelet transforms.
409409
410410
Parameters
411411
----------
412412
x : ndarray
413413
The array to pad
414414
pad_widths : {sequence, array_like, int}
415415
Number of values padded to the edges of each axis.
416-
((before_1, after_1), … (before_N, after_N)) unique pad widths for each
417-
axis. ((before, after),) yields same before and after pad for each
418-
axis. (pad,) or int is a shortcut for before = after = pad width for
419-
all axes.
416+
``((before_1, after_1), … (before_N, after_N))`` unique pad widths for
417+
each axis. ``((before, after),)`` yields same before and after pad for
418+
each axis. ``(pad,)`` or int is a shortcut for
419+
``before = after = pad width`` for all axes.
420420
mode : str, optional
421421
Signal extension mode, see :ref:`Modes <ref-modes>`.
422422
423423
Returns
424424
-------
425425
pad : ndarray
426426
Padded array of rank equal to array with shape increased according to
427-
`pad_width`.
427+
``pad_widths``.
428428
429429
Notes
430430
-----
431431
The performance of padding in dimensions > 1 may be substantially slower
432-
for modes ``smooth`` and ``antisymmetric`` as these modes are not supported
433-
efficiently by the underlying ``numpy.pad`` function.
432+
for modes ``'smooth'`` and ``'antisymmetric'`` as these modes are not
433+
supported efficiently by the underlying :func:`numpy.pad` function.
434+
435+
Note that the behavior of the ``'constant'`` mode here follows the
436+
PyWavelets convention which is different from NumPy (it is equivalent to
437+
``mode='edge'`` in :func:`numpy.pad`).
434438
"""
435439
x = np.asanyarray(x)
436440

0 commit comments

Comments
 (0)