Skip to content

Commit

Permalink
TYP: Remove normed= from typing stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Jun 2, 2022
1 parent 5d3845e commit 40bd14d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions numpy/lib/histograms.pyi
Expand Up @@ -34,16 +34,14 @@ def histogram(
a: ArrayLike,
bins: _BinKind | SupportsIndex | ArrayLike = ...,
range: None | tuple[float, float] = ...,
normed: None = ...,
weights: None | ArrayLike = ...,
density: bool = ...,
weights: None | ArrayLike = ...,
) -> 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 = ...,
weights: None | ArrayLike = ...,
) -> tuple[NDArray[Any], list[NDArray[Any]]]: ...
9 changes: 3 additions & 6 deletions numpy/lib/twodim_base.pyi
Expand Up @@ -166,9 +166,8 @@ def histogram2d( # type: ignore[misc]
y: _ArrayLikeFloat_co,
bins: int | Sequence[int] = ...,
range: None | _ArrayLikeFloat_co = ...,
normed: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
density: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
) -> tuple[
NDArray[float64],
NDArray[floating[Any]],
Expand All @@ -180,9 +179,8 @@ def histogram2d(
y: _ArrayLikeComplex_co,
bins: int | Sequence[int] = ...,
range: None | _ArrayLikeFloat_co = ...,
normed: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
density: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
) -> tuple[
NDArray[float64],
NDArray[complexfloating[Any, Any]],
Expand All @@ -194,9 +192,8 @@ def histogram2d(
y: _ArrayLikeComplex_co,
bins: Sequence[_ArrayLikeInt_co],
range: None | _ArrayLikeFloat_co = ...,
normed: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
density: None | bool = ...,
weights: None | _ArrayLikeFloat_co = ...,
) -> tuple[
NDArray[float64],
NDArray[Any],
Expand Down
1 change: 0 additions & 1 deletion numpy/typing/tests/data/fail/histograms.pyi
Expand Up @@ -7,7 +7,6 @@ AR_f8: npt.NDArray[np.float64]
np.histogram_bin_edges(AR_i8, range=(0, 1, 2)) # E: incompatible type

np.histogram(AR_i8, range=(0, 1, 2)) # E: incompatible type
np.histogram(AR_i8, normed=True) # E: incompatible type

np.histogramdd(AR_i8, range=(0, 1)) # E: incompatible type
np.histogramdd(AR_i8, range=[(0, 1, 2)]) # E: incompatible type

0 comments on commit 40bd14d

Please sign in to comment.