Skip to content

Commit

Permalink
MAINT: Rename interpolation to method in percentile stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Nov 12, 2021
1 parent 8cfb6b5 commit 8437663
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions numpy/lib/function_base.pyi
Expand Up @@ -500,7 +500,7 @@ def median(
keepdims: bool = ...,
) -> _ArrayType: ...

_InterpolationKind = L[
_MethodKind = L[
"inverted_cdf",
"averaged_inverted_cdf",
"closest_observation",
Expand All @@ -523,7 +523,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> floating[Any]: ...
@overload
Expand All @@ -533,7 +533,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> complexfloating[Any, Any]: ...
@overload
Expand All @@ -543,7 +543,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> timedelta64: ...
@overload
Expand All @@ -553,7 +553,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> datetime64: ...
@overload
Expand All @@ -563,7 +563,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> Any: ...
@overload
Expand All @@ -573,7 +573,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[floating[Any]]: ...
@overload
Expand All @@ -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
Expand All @@ -593,7 +593,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[timedelta64]: ...
@overload
Expand All @@ -603,7 +603,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[datetime64]: ...
@overload
Expand All @@ -613,7 +613,7 @@ def percentile(
axis: None = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: L[False] = ...,
) -> NDArray[object_]: ...
@overload
Expand All @@ -623,7 +623,7 @@ def percentile(
axis: None | _ShapeLike = ...,
out: None = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: bool = ...,
) -> Any: ...
@overload
Expand All @@ -633,7 +633,7 @@ def percentile(
axis: None | _ShapeLike = ...,
out: _ArrayType = ...,
overwrite_input: bool = ...,
interpolation: _InterpolationKind = ...,
method: _MethodKind = ...,
keepdims: bool = ...,
) -> _ArrayType: ...

Expand Down
4 changes: 2 additions & 2 deletions numpy/typing/tests/data/reveal/lib_function_base.pyi
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8437663

Please sign in to comment.