summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-11-08 18:25:37 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2021-11-12 12:12:00 -0600
commit8437663e851d358cac74d346d3f3dbb3ad0d52ed (patch)
treeb611cd028a7de63d3fdda797d83936fcb7e7db73
parent8cfb6b5b29a23c627d0f806441726c4470de777f (diff)
downloadnumpy-8437663e851d358cac74d346d3f3dbb3ad0d52ed.tar.gz
MAINT: Rename interpolation to method in percentile stubs
-rw-r--r--numpy/lib/function_base.pyi26
-rw-r--r--numpy/typing/tests/data/reveal/lib_function_base.pyi4
2 files changed, 15 insertions, 15 deletions
diff --git a/numpy/lib/function_base.pyi b/numpy/lib/function_base.pyi
index 82c625fed..7e227f9da 100644
--- a/numpy/lib/function_base.pyi
+++ b/numpy/lib/function_base.pyi
@@ -500,7 +500,7 @@ def median(
keepdims: bool = ...,
) -> _ArrayType: ...
-_InterpolationKind = L[
+_MethodKind = L[
"inverted_cdf",
"averaged_inverted_cdf",
"closest_observation",
@@ -523,7 +523,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> floating[Any]: ...
@overload
@@ -533,7 +533,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> complexfloating[Any, Any]: ...
@overload
@@ -543,7 +543,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> timedelta64: ...
@overload
@@ -553,7 +553,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> datetime64: ...
@overload
@@ -563,7 +563,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> Any: ...
@overload
@@ -573,7 +573,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[floating[Any]]: ...
@overload
@@ -583,7 +583,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[complexfloating[Any, Any]]: ...
@overload
@@ -593,7 +593,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[timedelta64]: ...
@overload
@@ -603,7 +603,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[datetime64]: ...
@overload
@@ -613,7 +613,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[object_]: ...
@overload
@@ -623,7 +623,7 @@ def percentile(
axis: None | _ShapeLike = ...,
out: None = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: bool = ...,
) -> Any: ...
@overload
@@ -633,7 +633,7 @@ def percentile(
axis: None | _ShapeLike = ...,
out: _ArrayType = ...,
overwrite_input: bool = ...,
- interpolation: _InterpolationKind = ...,
+ method: _MethodKind = ...,
keepdims: bool = ...,
) -> _ArrayType: ...
diff --git a/numpy/typing/tests/data/reveal/lib_function_base.pyi b/numpy/typing/tests/data/reveal/lib_function_base.pyi
index 854b955b4..c559eb295 100644
--- a/numpy/typing/tests/data/reveal/lib_function_base.pyi
+++ b/numpy/typing/tests/data/reveal/lib_function_base.pyi
@@ -144,7 +144,7 @@ reveal_type(np.percentile(AR_O, 50)) # E: Any
reveal_type(np.percentile(AR_f8, [50])) # E: ndarray[Any, dtype[floating[Any]]]
reveal_type(np.percentile(AR_c16, [50])) # E: ndarray[Any, dtype[complexfloating[Any, Any]]]
reveal_type(np.percentile(AR_m, [50])) # E: ndarray[Any, dtype[timedelta64]]
-reveal_type(np.percentile(AR_M, [50], interpolation="nearest")) # E: ndarray[Any, dtype[datetime64]]
+reveal_type(np.percentile(AR_M, [50], method="nearest")) # E: ndarray[Any, dtype[datetime64]]
reveal_type(np.percentile(AR_O, [50])) # E: ndarray[Any, dtype[object_]]
reveal_type(np.percentile(AR_f8, [50], keepdims=True)) # E: Any
reveal_type(np.percentile(AR_f8, [50], axis=[1])) # E: Any
@@ -158,7 +158,7 @@ reveal_type(np.quantile(AR_O, 0.5)) # E: Any
reveal_type(np.quantile(AR_f8, [0.5])) # E: ndarray[Any, dtype[floating[Any]]]
reveal_type(np.quantile(AR_c16, [0.5])) # E: ndarray[Any, dtype[complexfloating[Any, Any]]]
reveal_type(np.quantile(AR_m, [0.5])) # E: ndarray[Any, dtype[timedelta64]]
-reveal_type(np.quantile(AR_M, [0.5], interpolation="nearest")) # E: ndarray[Any, dtype[datetime64]]
+reveal_type(np.quantile(AR_M, [0.5], method="nearest")) # E: ndarray[Any, dtype[datetime64]]
reveal_type(np.quantile(AR_O, [0.5])) # E: ndarray[Any, dtype[object_]]
reveal_type(np.quantile(AR_f8, [0.5], keepdims=True)) # E: Any
reveal_type(np.quantile(AR_f8, [0.5], axis=[1])) # E: Any