Skip to content

Commit

Permalink
signal: Add types to savgol_filter for untyped parameters
Browse files Browse the repository at this point in the history
For the file `_savitzy_golay.pyi`.

Additionally write a mode type alias for mode to specify the actually
allowed strings.
  • Loading branch information
pavyamsiri committed Oct 21, 2024
1 parent 0be31f3 commit d25d475
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scipy-stubs/signal/_savitzky_golay.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ from typing import Literal, TypeAlias

import numpy as np
import numpy.typing as npt
from scipy._typing import Untyped, UntypedArray

_Array_fc_1d: TypeAlias = np.ndarray[tuple[int], np.dtype[np.inexact[npt.NBitBase]]]
_Mode: TypeAlias = Literal["mirror", "constant", "nearest", "wrap", "interp"]

def savgol_coeffs(
window_length: int,
Expand All @@ -15,12 +15,12 @@ def savgol_coeffs(
use: Literal["conv", "dot"] = "conv",
) -> _Array_fc_1d: ...
def savgol_filter(
x: Untyped,
x: npt.ArrayLike,
window_length: int,
polyorder: int,
deriv: int = 0,
delta: float = 1.0,
axis: int = -1,
mode: str = "interp",
mode: _Mode = "interp",
cval: float = 0.0,
) -> UntypedArray: ...
) -> npt.NDArray[np.float32 | np.float64]: ...

0 comments on commit d25d475

Please sign in to comment.