8000 TYP: Use _Array1D alias in ``numpy.ma.core.pyi`` by MarcoGorelli · Pull Request #28847 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: Use _Array1D alias in numpy.ma.core.pyi #28847

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
Apr 29, 2025
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
TYP: Use _Array1D alias in numpy.ma.core.pyi
  • Loading branch information
MarcoGorelli committed Apr 28, 2025
commit 0c5e31b754563a3027f2acaf7466cbdc96f9ee35
6 changes: 4 additions & 2 deletions numpy/ma/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ from numpy import (
intp,
ndarray,
)
from numpy._core.fromnumeric import _Array1D
from numpy._globals import _NoValueType
from numpy._typing import (
ArrayLike,
Expand Down Expand Up @@ -229,6 +230,7 @@ _ScalarT = TypeVar("_ScalarT", bound=generic)
_ScalarT_co = TypeVar("_ScalarT_co", bound=generic)
# A subset of `MaskedArray` that can be parametrized w.r.t. `np.generic`
_MaskedArray: TypeAlias = MaskedArray[_Shape, dtype[_ScalarT]]
_MaskedArray1D: TypeAlias = MaskedArray[tuple[int], dtype[_ScalarT]]

MaskType = bool_
nomask: bool_[Literal[False]]
Expand Down Expand Up @@ -1166,9 +1168,9 @@ def sort(
stable: Literal[False] | None = False,
) -> NDArray[Any]: ...
@overload
def compressed(x: _ArrayLike[_ScalarT_co]) -> ndarray[tuple[int], dtype[_ScalarT_co]]: ...
def compressed(x: _ArrayLike[_ScalarT_co]) -> _Array1D[_ScalarT_co]: ...
@overload
def compressed(x: ArrayLike) -> ndarray[tuple[int], dtype]: ...
def compressed(x: ArrayLike) -> _Array1D[Any]: ...
def concatenate(arrays, axis=...): ...
def diag(v, k=...): ...
def left_shift(a, n): ...
Expand Down
Loading
0