8000 ENH: Add annotations for `np.lib.histograms` by BvB93 · Pull Request #20063 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add annotations for np.lib.histograms #20063

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 2 commits into from
Oct 9, 2021
Merged
Changes from 1 commit
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
Next Next commit
ENH: Add annotations for np.lib.histograms
  • Loading branch information
Bas van Beek committed Oct 7, 2021
commit 37e8cb3a1f4dd8b3fff8aa918ce5774aa703f34b
52 changes: 48 additions & 4 deletions numpy/lib/histograms.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,51 @@
from typing import List
from typing import (
Literal as L,
List,
Tuple,
Any,
SupportsIndex,
Sequence,
)

from numpy.typing import (
NDArray,
ArrayLike,
)

_BinKind = L[
"stone",
"auto",
"doane",
"fd",
"rice",
"scott",
"sqrt",
"sturges",
]

__all__: List[str]

def histogram_bin_edges(a, bins=..., range=..., weights=...): ...
def histogram(a, bins=..., range=..., normed=..., weights=..., density=...): ...
def histogramdd(sample, bins=..., range=..., normed=..., weights=..., density=...): ...
def histogram_bin_edges(
a: ArrayLike,
bins: _BinKind | SupportsIndex | ArrayLike = ...,
range: None | Tuple[float, float] = ...,
weights: None | ArrayLike = ...,
) -> NDArray[Any]: ...

def histogram(
a: ArrayLike,
bins: _BinKind | SupportsIndex | ArrayLike = ...,
range: None | Tuple[float, float] = ...,
normed: None = ...,
weights: None | ArrayLike = ...,
density: bool = ...,
) -> Tuple[NDArray[Any], NDArray[Any]]: ...

def histogramdd(
sample: ArrayLike,
bins: SupportsIndex | ArrayLike = ...,
range: Sequence[Tuple[float, float]] = ...,
normed: None | bool = ...,
weights: None | ArrayLike = ...,
density: None | bool = ...,
) -> Tuple[NDArray[Any], List[NDArray[Any]]]: ...
0