Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 1 addition & 22 deletions src/numpy-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ from numpy.lib._function_base_impl import (
trapz,
trim_zeros,
unwrap,
vectorize,
)
from numpy.lib._histograms_impl import histogram, histogram_bin_edges, histogramdd
from numpy.lib._index_tricks_impl import (
Expand Down Expand Up @@ -5238,28 +5239,6 @@ class ndindex:
def __iter__(self) -> Self: ...
def __next__(self) -> _Shape: ...

class vectorize:
__doc__: str | None
pyfunc: Callable[..., Any]
cache: builtins.bool
signature: LiteralString | None
otypes: LiteralString | None
excluded: set[int | str]

#
def __init__(
self,
pyfunc: Callable[..., Any],
otypes: str | Iterable[DTypeLike] | None = ...,
doc: str | None = ...,
excluded: Iterable[int | str] | None = ...,
cache: builtins.bool = ...,
signature: str | None = ...,
) -> None: ...

#
def __call__(self, /, *args: Any, **kwargs: Any) -> Any: ...

class matrix(ndarray[_2DShapeT_co, _DType_co]):
__array_priority__: ClassVar[float] = ...

Expand Down
31 changes: 29 additions & 2 deletions src/numpy-stubs/lib/_function_base_impl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from collections.abc import Callable, Iterable, Sequence
from typing import (
Any,
Concatenate,
Final,
Literal as L,
Protocol,
SupportsIndex,
Expand All @@ -11,7 +12,7 @@ from typing import (
overload,
type_check_only,
)
from typing_extensions import ParamSpec, TypeIs, TypeVar, deprecated
from typing_extensions import LiteralString, ParamSpec, TypeIs, TypeVar, deprecated

import numpy as np
from _numtype import (
Expand Down Expand Up @@ -66,7 +67,7 @@ from _numtype import (
ToTimeDelta_nd,
_ToArray1_1nd,
)
from numpy import _OrderKACF, vectorize # noqa: ICN003
from numpy import _OrderKACF # noqa: ICN003
from numpy._core.multiarray import bincount
from numpy._globals import _NoValueType
from numpy._typing import (
Expand Down Expand Up @@ -166,6 +167,32 @@ class _CanLenAndGetSlice(Protocol[_T_co]):

###

class vectorize:
__doc__: str | None
pyfunc: Callable[..., Any]
cache: Final[bool]
signature: Final[LiteralString | None]
otypes: Final[LiteralString | None]
excluded: Final[set[int | str]]

#
def __init__(
self,
/,
pyfunc: Callable[..., Any] | _NoValueType = ...,
otypes: str | Iterable[DTypeLike] | None = None,
doc: str | None = None,
excluded: Iterable[int | str] | None = None,
cache: bool = False,
signature: str | None = None,
) -> None: ...

#
def __call__(self, /, *args: Any, **kwargs: Any) -> Any: ...

###

#
@overload
def rot90(m: _ArrayLike[_ScalarT], k: int = 1, axes: tuple[int, int] = (0, 1)) -> Array[_ScalarT]: ...
@overload
Expand Down
Loading