Skip to content

Commit 37b39af

Browse files
pavelkomarovclaude
andcommitted
docs: uniformly note multidimensional support in x param docstrings
All non-legacy methods with an `axis` parameter now say "May be multidimensional; see `axis`." in their x param description. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 431ff17 commit 37b39af

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

pynumdiff/basis_fit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def spectraldiff(x, dt, params=None, options=None, high_freq_cutoff=None, even_e
99
pad_to_zero_dxdt=True, axis=0):
1010
"""Take a derivative in the Fourier domain, with high frequency attentuation.
1111
12-
:param np.array[float] x: data to differentiate
12+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
1313
:param float dt: step size
1414
:param list[float] or float params: (**deprecated**, prefer :code:`high_freq_cutoff`)
1515
:param dict options: (**deprecated**, prefer :code:`even_extension`
@@ -82,7 +82,7 @@ def rbfdiff(x, dt_or_t, sigma=1, lmbd=0.01, axis=0):
8282
values to make columns sparse. Each basis function "hill" is topped with a "tower" of height :code:`lmbd` to reach
8383
noisy data samples, and the final smoothed reconstruction is found by razing these and only keeping the hills.
8484
85-
:param np.array[float] x: data to differentiate
85+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
8686
:param float or array[float] dt_or_t: This function supports variable step size. This parameter is either the constant
8787
:math:`\\Delta t` if given as a single float, or data locations if given as an array of same length as :code:`x`.
8888
:param float sigma: controls width of radial basis functions

pynumdiff/finite_difference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
def finitediff(x, dt, num_iterations=1, order=2, axis=0):
99
"""Perform iterated finite difference of a given order. This serves as the common backing function for
1010
all other methods in this module.
11-
12-
:param np.array[float] x: data to differentiate
11+
12+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
1313
:param float dt: step size
1414
:param int num_iterations: number of iterations. If >1, the derivative is integrated with trapezoidal
1515
rule, that result is finite-differenced again, and the cycle is repeated num_iterations-1 times

pynumdiff/kalman_smooth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def robustdiff(x, dt_or_t, order, log_q, log_r, proc_huberM=6, meas_huberM=0, ax
279279
:code:`log_qr_ratio` as in RTS smoothing without the addition of a new absolute scale parameter, becausee :math:`q` and
280280
:math:`r` interact with the distinct Huber :math:`M` parameters.
281281
282-
:param np.array[float] x: data series to differentiate
282+
:param np.array[float] x: data series to differentiate. May be multidimensional; see :code:`axis`.
283283
:param float or array[float] dt_or_t: This function supports variable step size. This parameter is either the constant
284284
:math:`\\Delta t` if given as a single float, or data locations if given as an array of same length as :code:`x`.
285285
:param int order: which derivative to stabilize in the constant-derivative model (1=velocity, 2=acceleration, 3=jerk)

pynumdiff/polynomial_fit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def splinediff(x, dt_or_t, params=None, options=None, degree=3, s=None, num_iter
1111
scipy.interpolate.UnivariateSpline. Variable step size is supported with equal ease as uniform step size.
1212
1313
:param np.array[float] x: data to differentiate. May contain NaN values (missing data); NaNs are excluded from
14-
fitting and imputed by spline interpolation.
14+
fitting and imputed by spline interpolation. May be multidimensional; see :code:`axis`.
1515
:param float or array[float] dt_or_t: This function supports variable step size. This parameter is either the constant
1616
:math:`\\Delta t` if given as a single float, or data locations if given as an array of same length as :code:`x`.
1717
:param list params: (**deprecated**, prefer :code:`degree`, :code:`cutoff_freq`, and :code:`num_iterations`)
@@ -60,7 +60,7 @@ def polydiff(x, dt_or_t, params=None, options=None, degree=None, window_size=Non
6060
"""Fit polynomials to the data, and differentiate the polynomials.
6161
6262
:param np.array[float] x: data to differentiate. May contain NaN values (missing data); NaNs are excluded from
63-
fitting and imputed by polynomial interpolation.
63+
fitting and imputed by polynomial interpolation. May be multidimensional; see :code:`axis`.
6464
:param float or array[float] dt_or_t: This function supports variable step size. This parameter is either the constant
6565
:math:`\\Delta t` if given as a single float, or data locations if given as an array of same length as :code:`x`.
6666
:param list[int] params: (**deprecated**, prefer :code:`degree` and :code:`window_size`)
@@ -123,7 +123,7 @@ def savgoldiff(x, dt, params=None, options=None, degree=None, window_size=None,
123123
scipy.signal.savgol_filter. The Savitzky-Golay is very similar to the sliding polynomial fit,
124124
but slightly noisier and much faster.
125125
126-
:param np.array[float] x: data to differentiate
126+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
127127
:param float dt: step size
128128
:param list params: (**deprecated**, prefer :code:`degree`, :code:`window_size`, and :code:`smoothing_win`)
129129
:param dict options: (**deprecated**)

pynumdiff/smooth_finite_difference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def kerneldiff(x, dt, kernel='friedrichs', window_size=5, num_iterations=1, axis
1212
"""Differentiate by applying a smoothing kernel to the signal, then performing 2nd-order finite difference.
1313
:code:`meandiff`, :code:`mediandiff`, :code:`gaussiandiff`, and :code:`friedrichsdiff` call this function.
1414
15-
:param np.array[float] x: data to differentiate
15+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
1616
:param float dt: step size
1717
:param str kernel: prefilter data, {:code:`'mean'`, :code:`'median'`, :code:`'gaussian'`,
1818
:code:`'friedrichs'`}
@@ -145,7 +145,7 @@ def friedrichsdiff(x, dt, params=None, options={}, window_size=5, num_iterations
145145
def butterdiff(x, dt, params=None, options={}, filter_order=2, cutoff_freq=0.5, num_iterations=1, axis=0):
146146
"""Perform butterworth smoothing on x with scipy.signal.filtfilt followed by second order finite difference
147147
148-
:param np.array[float] x: data to differentiate
148+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
149149
:param float dt: step size
150150
:param list[int] params: (**deprecated**, prefer :code:`filter_order`, :code:`cutoff_freq`,
151151
and :code:`num_iterations`)

pynumdiff/total_variation_regularization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def tvrdiff(x, dt, order, gamma, huberM=float('inf'), solver=None, axis=0):
5757
"""Generalized total variation regularized derivatives. Use convex optimization (cvxpy) to solve for a
5858
total variation regularized derivative. Other convex-solver-based methods in this module call this function.
5959
60-
:param np.array[float] x: data to differentiate
60+
:param np.array[float] x: data to differentiate. May be multidimensional; see :code:`axis`.
6161
:param float dt: step size
6262
:param int order: 1, 2, or 3, the derivative to regularize
6363
:param float gamma: regularization parameter

0 commit comments

Comments
 (0)