Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d0477e4
reduce ndarray
cmp0xff Oct 30, 2025
b88da43
py310 happiness
cmp0xff Oct 30, 2025
0023b02
https://github.com/pandas-dev/pandas-stubs/pull/1462/files#r2480913506
cmp0xff Oct 31, 2025
8c1a120
Merge branch 'main' of github.com:pandas-dev/pandas-stubs into featur…
cmp0xff Oct 31, 2025
dc85974
https://github.com/pandas-dev/pandas-stubs/pull/1462/files#r2481057032
cmp0xff Oct 31, 2025
1cfd06e
Merge branch 'main' of github.com:pandas-dev/pandas-stubs into featur…
cmp0xff Oct 31, 2025
b9af83a
https://github.com/pandas-dev/pandas-stubs/pull/1462#discussion_r2490…
cmp0xff Nov 6, 2025
1adbffc
https://github.com/pandas-dev/pandas-stubs/pull/1462#discussion_r2490…
cmp0xff Nov 6, 2025
a61b439
https://github.com/pandas-dev/pandas-stubs/pull/1462#discussion_r2490…
cmp0xff Nov 6, 2025
bc18e49
asi8
cmp0xff Nov 7, 2025
e448246
PrettyDict
cmp0xff Nov 7, 2025
688cebd
np_ndarray_bool
cmp0xff Nov 7, 2025
a38eb85
reduce np.double
cmp0xff Nov 7, 2025
cedafab
remove np.ndarray
cmp0xff Nov 7, 2025
ed1250e
replace npt.NDArray with np_ndarray
cmp0xff Nov 7, 2025
4070c2d
Merge branch 'main' of github.com:pandas-dev/pandas-stubs into featur…
cmp0xff Nov 7, 2025
d779dbe
Merge branch 'main' of github.com:pandas-dev/pandas-stubs into featur…
cmp0xff Nov 7, 2025
88b32e0
comments
cmp0xff Nov 7, 2025
b71d4cb
comments
cmp0xff Nov 7, 2025
ea8b04c
np_xdarray_intp
cmp0xff Nov 8, 2025
dd4da93
unique
cmp0xff Nov 9, 2025
6123921
Indexers
cmp0xff Nov 9, 2025
83fd4d3
remove npt.NDArray[Any]
cmp0xff Nov 9, 2025
1edf75a
reduce np_1darray stuff
cmp0xff Nov 9, 2025
2d1fd07
tighten
cmp0xff Nov 9, 2025
f46c5b1
tighten
cmp0xff Nov 9, 2025
a35c63c
matmul
cmp0xff Nov 9, 2025
7c26e8e
fixup
cmp0xff Nov 9, 2025
9c1c9a0
fixup
cmp0xff Nov 9, 2025
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
59 changes: 15 additions & 44 deletions pandas-stubs/_libs/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ from typing import (
Literal,
TypeVar,
overload,
type_check_only,
)

import numpy as np
from pandas import (
IntervalIndex,
Series,
Expand All @@ -17,8 +17,8 @@ from pandas import (
from pandas._typing import (
IntervalClosedType,
IntervalT,
np_1darray,
npt,
np_1darray_bool,
np_ndarray,
)

VALID_CLOSED: frozenset[str]
Expand All @@ -27,6 +27,7 @@ _OrderableScalarT = TypeVar("_OrderableScalarT", bound=int | float)
_OrderableTimesT = TypeVar("_OrderableTimesT", bound=Timestamp | Timedelta)
_OrderableT = TypeVar("_OrderableT", bound=int | float | Timestamp | Timedelta)

@type_check_only
class _LengthDescriptor:
@overload
def __get__(
Expand All @@ -37,8 +38,9 @@ class _LengthDescriptor:
self, instance: Interval[_OrderableTimesT], owner: Any
) -> Timedelta: ...
@overload
def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ...
def __get__(self, instance: IntervalMixin, owner: Any) -> np_ndarray: ...

@type_check_only
class _MidDescriptor:
@overload
def __get__(self, instance: Interval[_OrderableScalarT], owner: Any) -> float: ...
Expand All @@ -47,7 +49,7 @@ class _MidDescriptor:
self, instance: Interval[_OrderableTimesT], owner: Any
) -> _OrderableTimesT: ...
@overload
def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ...
def __get__(self, instance: IntervalMixin, owner: Any) -> np_ndarray: ...

class IntervalMixin:
@property
Expand All @@ -68,8 +70,8 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
def right(self: Interval[_OrderableT]) -> _OrderableT: ...
@property
def closed(self) -> IntervalClosedType: ...
mid: _MidDescriptor
length: _LengthDescriptor
mid = _MidDescriptor()
length = _LengthDescriptor()
def __init__(
self,
left: _OrderableT,
Expand Down Expand Up @@ -166,9 +168,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
@overload
def __gt__(self, other: Interval[_OrderableT]) -> bool: ...
@overload
def __gt__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __gt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __gt__(
self,
Expand All @@ -177,9 +177,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
@overload
def __lt__(self, other: Interval[_OrderableT]) -> bool: ...
@overload
def __lt__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __lt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __lt__(
self,
Expand All @@ -188,9 +186,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
@overload
def __ge__(self, other: Interval[_OrderableT]) -> bool: ...
@overload
def __ge__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __ge__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __ge__(
self,
Expand All @@ -199,45 +195,20 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
@overload
def __le__(self, other: Interval[_OrderableT]) -> bool: ...
@overload
def __le__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
@overload
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(
self: IntervalT, other: IntervalIndex[IntervalT]
) -> np_1darray[np.bool]: ...
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __ne__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...

class IntervalTree(IntervalMixin):
def __init__(
self,
left: np.ndarray,
right: np.ndarray,
closed: IntervalClosedType = ...,
leaf_size: int = ...,
) -> None: ...
def get_indexer(self, target) -> npt.NDArray[np.intp]: ...
def get_indexer_non_unique(
self, target
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
_na_count: int
@property
def is_overlapping(self) -> bool: ...
@property
def is_monotonic_increasing(self) -> bool: ...
def clear_mapping(self) -> None: ...
22 changes: 17 additions & 5 deletions pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ from typing import (

from dateutil.relativedelta import weekday as WeekdayClass
import numpy as np
from numpy import typing as npt
from pandas import Timestamp
from typing_extensions import Self

from pandas._typing import npt
from pandas._typing import (
ShapeT,
np_ndarray,
)

from pandas.tseries.holiday import AbstractHolidayCalendar

Expand All @@ -37,7 +41,9 @@ class BaseOffset:
@property
def base(self) -> BaseOffset: ...
@overload
def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
def __add__(
self, other: np_ndarray[ShapeT, np.object_]
) -> np_ndarray[ShapeT, np.object_]: ...
@overload
def __add__(self, other: _DatetimeT) -> _DatetimeT: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
Expand All @@ -47,7 +53,9 @@ class BaseOffset:
@overload
def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ...
@overload
def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
def __radd__(
self, other: np_ndarray[ShapeT, np.object_]
) -> np_ndarray[ShapeT, np.object_]: ...
@overload
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
Expand All @@ -68,11 +76,15 @@ class BaseOffset:
@overload
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
@overload
def __mul__(self, other: np.ndarray) -> np.ndarray: ...
def __mul__(
self, other: np_ndarray[ShapeT, np.object_]
) -> np_ndarray[ShapeT, np.object_]: ...
@overload
def __mul__(self, other: int) -> Self: ...
@overload
def __rmul__(self, other: np.ndarray) -> np.ndarray: ...
def __rmul__(
self, other: np_ndarray[ShapeT, np.object_]
) -> np_ndarray[ShapeT, np.object_]: ...
@overload
def __rmul__(self, other: int) -> Self: ...
def __neg__(self) -> Self: ...
Expand Down
14 changes: 7 additions & 7 deletions pandas-stubs/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ from pandas._libs.tslibs.timestamps import Timestamp
from pandas._typing import (
PeriodFrequency,
ShapeT,
np_1darray,
np_1darray_bool,
np_ndarray,
)

Expand Down Expand Up @@ -107,7 +107,7 @@ class Period(PeriodMixin):
@overload
def __eq__(self, other: Self) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __eq__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Series[Period]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -117,7 +117,7 @@ class Period(PeriodMixin):
@overload
def __ge__(self, other: Self) -> bool: ...
@overload
def __ge__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
def __ge__(self, other: PeriodIndex) -> np_1darray_bool: ...
@overload
def __ge__(
self, other: Series[Period] # pyrefly: ignore[bad-specialization]
Expand All @@ -129,7 +129,7 @@ class Period(PeriodMixin):
@overload
def __gt__(self, other: Self) -> bool: ...
@overload
def __gt__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
def __gt__(self, other: PeriodIndex) -> np_1darray_bool: ...
@overload
def __gt__(
self, other: Series[Period] # pyrefly: ignore[bad-specialization]
Expand All @@ -141,7 +141,7 @@ class Period(PeriodMixin):
@overload
def __le__(self, other: Self) -> bool: ...
@overload
def __le__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
def __le__(self, other: PeriodIndex) -> np_1darray_bool: ...
@overload
def __le__(
self, other: Series[Period] # pyrefly: ignore[bad-specialization]
Expand All @@ -153,7 +153,7 @@ class Period(PeriodMixin):
@overload
def __lt__(self, other: Self) -> bool: ...
@overload
def __lt__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
def __lt__(self, other: PeriodIndex) -> np_1darray_bool: ...
@overload
def __lt__(
self, other: Series[Period] # pyrefly: ignore[bad-specialization]
Expand All @@ -167,7 +167,7 @@ class Period(PeriodMixin):
@overload
def __ne__(self, other: Self) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __ne__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Series[Period]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
Expand Down
14 changes: 7 additions & 7 deletions pandas-stubs/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ from pandas._typing import (
Just,
ShapeT,
TimeUnit,
np_1darray,
np_1darray_bool,
np_ndarray,
)

Expand Down Expand Up @@ -274,7 +274,7 @@ class Timedelta(timedelta):
@overload
def __eq__(self, other: Series[Timedelta]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __eq__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__( # type: ignore[overload-overlap]
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand All @@ -287,7 +287,7 @@ class Timedelta(timedelta):
@overload
def __ne__(self, other: Series[Timedelta]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __ne__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__( # type: ignore[overload-overlap]
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand Down Expand Up @@ -316,7 +316,7 @@ class Timedelta(timedelta):
@overload # type: ignore[override]
def __le__(self, other: timedelta | np.timedelta64 | Self) -> bool: ...
@overload
def __le__(self, other: TimedeltaIndex) -> np_1darray[np.bool]: ...
def __le__(self, other: TimedeltaIndex) -> np_1darray_bool: ...
@overload
def __le__(
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand All @@ -327,7 +327,7 @@ class Timedelta(timedelta):
@overload # type: ignore[override]
def __lt__(self, other: timedelta | np.timedelta64 | Self) -> bool: ...
@overload
def __lt__(self, other: TimedeltaIndex) -> np_1darray[np.bool]: ...
def __lt__(self, other: TimedeltaIndex) -> np_1darray_bool: ...
@overload
def __lt__(
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand All @@ -338,7 +338,7 @@ class Timedelta(timedelta):
@overload # type: ignore[override]
def __ge__(self, other: timedelta | np.timedelta64 | Self) -> bool: ...
@overload
def __ge__(self, other: TimedeltaIndex) -> np_1darray[np.bool]: ...
def __ge__(self, other: TimedeltaIndex) -> np_1darray_bool: ...
@overload
def __ge__(
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand All @@ -349,7 +349,7 @@ class Timedelta(timedelta):
@overload # type: ignore[override]
def __gt__(self, other: timedelta | np.timedelta64 | Self) -> bool: ...
@overload
def __gt__(self, other: TimedeltaIndex) -> np_1darray[np.bool]: ...
def __gt__(self, other: TimedeltaIndex) -> np_1darray_bool: ...
@overload
def __gt__(
self, other: np_ndarray[ShapeT, np.timedelta64]
Expand Down
14 changes: 7 additions & 7 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from pandas._typing import (
ShapeT,
TimestampNonexistent,
TimeUnit,
np_1darray,
np_1darray_bool,
np_ndarray,
)

Expand Down Expand Up @@ -174,7 +174,7 @@ class Timestamp(datetime, SupportsIndex):
@overload # type: ignore[override]
def __le__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
def __le__(self, other: DatetimeIndex) -> np_1darray[np.bool]: ...
def __le__(self, other: DatetimeIndex) -> np_1darray_bool: ...
@overload
def __le__(
self, other: np_ndarray[ShapeT, np.datetime64]
Expand All @@ -184,7 +184,7 @@ class Timestamp(datetime, SupportsIndex):
@overload # type: ignore[override]
def __lt__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
def __lt__(self, other: DatetimeIndex) -> np_1darray[np.bool]: ...
def __lt__(self, other: DatetimeIndex) -> np_1darray_bool: ...
@overload
def __lt__(
self, other: np_ndarray[ShapeT, np.datetime64]
Expand All @@ -194,7 +194,7 @@ class Timestamp(datetime, SupportsIndex):
@overload # type: ignore[override]
def __ge__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
def __ge__(self, other: DatetimeIndex) -> np_1darray[np.bool]: ...
def __ge__(self, other: DatetimeIndex) -> np_1darray_bool: ...
@overload
def __ge__(
self, other: np_ndarray[ShapeT, np.datetime64]
Expand All @@ -204,7 +204,7 @@ class Timestamp(datetime, SupportsIndex):
@overload # type: ignore[override]
def __gt__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
def __gt__(self, other: DatetimeIndex) -> np_1darray[np.bool]: ...
def __gt__(self, other: DatetimeIndex) -> np_1darray_bool: ...
@overload
def __gt__(
self, other: np_ndarray[ShapeT, np.datetime64]
Expand Down Expand Up @@ -244,7 +244,7 @@ class Timestamp(datetime, SupportsIndex):
@overload
def __eq__(self, other: Series[Timestamp]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __eq__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: np_ndarray[ShapeT, np.datetime64]) -> np_ndarray[ShapeT, np.bool]: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -254,7 +254,7 @@ class Timestamp(datetime, SupportsIndex):
@overload
def __ne__(self, other: Series[Timestamp]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Index) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
def __ne__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: np_ndarray[ShapeT, np.datetime64]) -> np_ndarray[ShapeT, np.bool]: ... # type: ignore[overload-overlap]
@overload
Expand Down
Loading