45
45
)
46
46
47
47
if TYPE_CHECKING :
48
+ from typing import TypeAlias
49
+
48
50
from pandas import Index
49
51
52
+ _CubicBC : TypeAlias = Literal ["not-a-knot" , "clamped" , "natural" , "periodic" ]
53
+
50
54
51
55
def check_value_size (value , mask : npt .NDArray [np .bool_ ], length : int ):
52
56
"""
@@ -652,7 +656,7 @@ def _akima_interpolate(
652
656
xi : np .ndarray ,
653
657
yi : np .ndarray ,
654
658
x : np .ndarray ,
655
- der : int | list [ int ] | None = 0 ,
659
+ der : int = 0 ,
656
660
axis : AxisInt = 0 ,
657
661
):
658
662
"""
@@ -673,10 +677,8 @@ def _akima_interpolate(
673
677
x : np.ndarray
674
678
Of length M.
675
679
der : int, optional
676
- How many derivatives to extract; None for all potentially
677
- nonzero derivatives (that is a number equal to the number
678
- of points), or a list of derivatives to extract. This number
679
- includes the function value as 0th derivative.
680
+ How many derivatives to extract. This number includes the function
681
+ value as 0th derivative.
680
682
axis : int, optional
681
683
Axis in the yi array corresponding to the x-coordinate values.
682
684
@@ -702,9 +704,9 @@ def _cubicspline_interpolate(
702
704
yi : np .ndarray ,
703
705
x : np .ndarray ,
704
706
axis : AxisInt = 0 ,
705
- bc_type : str | tuple [Any , Any ] = "not-a-knot" ,
706
- extrapolate = None ,
707
- ):
707
+ bc_type : _CubicBC | tuple [Any , Any ] = "not-a-knot" ,
708
+ extrapolate : Literal [ "periodic" ] | bool | None = None ,
709
+ ) -> np . ndarray :
708
710
"""
709
711
Convenience function for cubic spline data interpolator.
710
712
0 commit comments