Skip to content

TYP: Fix invalid inline annotations in lib._function_base_impl #29175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions numpy/lib/_function_base_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4711,14 +4711,14 @@ def _inverted_cdf(n, quantiles):


def _quantile_ureduce_func(
a: np.array,
q: np.array,
weights: np.array,
axis: int | None = None,
out=None,
overwrite_input: bool = False,
method="linear",
) -> np.array:
a: np.ndarray,
q: np.ndarray,
weights: np.ndarray,
axis: int | None = None,
out: np.ndarray | None = None,
overwrite_input: bool = False,
method: str = "linear",
) -> np.ndarray:
if q.ndim > 2:
# The code below works fine for nd, but it might not have useful
# semantics. For now, keep the supported dimensions the same as it was
Expand Down Expand Up @@ -4784,13 +4784,13 @@ def _get_indexes(arr, virtual_indexes, valid_values_count):


def _quantile(
arr: np.array,
quantiles: np.array,
axis: int = -1,
method="linear",
out=None,
weights=None,
):
arr: "np.typing.ArrayLike",
quantiles: np.ndarray,
axis: int = -1,
method: str = "linear",
out: np.ndarray | None = None,
weights: "np.typing.ArrayLike | None" = None,
) -> np.ndarray:
"""
Private function that doesn't support extended axis or keepdims.
These methods are extended to this function using _ureduce
Expand Down
Loading