Skip to content

Commit 9d364be

Browse files
committed
feat(test): floordiv
1 parent a916a31 commit 9d364be

File tree

4 files changed

+829
-39
lines changed

4 files changed

+829
-39
lines changed

pandas-stubs/core/series.pyi

Lines changed: 179 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ from pandas._typing import (
189189
WriteBuffer,
190190
_T_co,
191191
np_1darray,
192+
np_ndarray,
192193
np_ndarray_anyint,
193194
np_ndarray_bool,
194195
np_ndarray_complex,
@@ -2274,42 +2275,83 @@ class Series(IndexOpsMixin[S1], NDFrame):
22742275
def __floordiv__(self, other: Index[Never] | Series[Never]) -> Series: ...
22752276
@overload
22762277
def __floordiv__(
2277-
self: Series[bool] | Series[int] | Series[float],
2278+
self: Series[int] | Series[float],
2279+
other: np_ndarray_bool | np_ndarray_complex | np_ndarray_dt | np_ndarray_td,
2280+
) -> Never: ...
2281+
@overload
2282+
def __floordiv__(
2283+
self: Series[bool] | Series[complex], other: np_ndarray
2284+
) -> Never: ...
2285+
@overload
2286+
def __floordiv__(
2287+
self: Series[int],
22782288
other: (
2279-
float
2280-
| Sequence[float]
2281-
| np_ndarray_bool
2289+
Just[int]
2290+
| Sequence[Just[int]]
2291+
| np_ndarray_anyint
2292+
| Index[int]
2293+
| Series[int]
2294+
),
2295+
) -> Series[int]: ...
2296+
@overload
2297+
def __floordiv__(
2298+
self: Series[int],
2299+
other: (
2300+
Just[float]
2301+
| Sequence[Just[float]]
2302+
| np_ndarray_float
2303+
| Index[float]
2304+
| Series[float]
2305+
),
2306+
) -> Series[float]: ...
2307+
@overload
2308+
def __floordiv__(
2309+
self: Series[float],
2310+
other: (
2311+
Just[int]
2312+
| Just[float]
2313+
| Sequence[Just[int]]
2314+
| Sequence[Just[float]]
22822315
| np_ndarray_anyint
22832316
| np_ndarray_float
2284-
| Index[bool]
22852317
| Index[int]
22862318
| Index[float]
2287-
| Series[bool]
22882319
| Series[int]
22892320
| Series[float]
22902321
),
2291-
) -> Series[int]: ...
2322+
) -> Series[float]: ...
2323+
@overload
2324+
def __floordiv__(
2325+
self: Series[Timedelta],
2326+
other: np_ndarray_bool | np_ndarray_complex | np_ndarray_dt,
2327+
) -> Never: ...
22922328
@overload
22932329
def __floordiv__(
22942330
self: Series[Timedelta],
22952331
other: (
2296-
float
2297-
| Sequence[float]
2298-
| np_ndarray_bool
2332+
Just[int]
2333+
| Just[float]
2334+
| Sequence[Just[int]]
2335+
| Sequence[Just[float]]
22992336
| np_ndarray_anyint
23002337
| np_ndarray_float
2301-
| Index[bool]
23022338
| Index[int]
23032339
| Index[float]
2304-
| Series[bool]
23052340
| Series[int]
23062341
| Series[float]
23072342
),
23082343
) -> Series[Timedelta]: ...
23092344
@overload
23102345
def __floordiv__(
23112346
self: Series[Timedelta],
2312-
other: timedelta | Sequence[timedelta] | np.timedelta64 | Series[Timedelta],
2347+
other: (
2348+
timedelta
2349+
| Sequence[timedelta]
2350+
| np.timedelta64
2351+
| np_ndarray_td
2352+
| TimedeltaIndex
2353+
| Series[Timedelta]
2354+
),
23132355
) -> Series[int]: ...
23142356
@overload
23152357
def floordiv(
@@ -2321,37 +2363,63 @@ class Series(IndexOpsMixin[S1], NDFrame):
23212363
) -> Series: ...
23222364
@overload
23232365
def floordiv(
2324-
self: Series[bool] | Series[int] | Series[float],
2366+
self: Series[int],
23252367
other: (
2326-
float
2327-
| Sequence[float]
2328-
| np_ndarray_bool
2368+
Just[int]
2369+
| Sequence[Just[int]]
2370+
| np_ndarray_anyint
2371+
| Index[int]
2372+
| Series[int]
2373+
),
2374+
level: Level | None = ...,
2375+
fill_value: float | None = None,
2376+
axis: AxisIndex | None = 0,
2377+
) -> Series[int]: ...
2378+
@overload
2379+
def floordiv(
2380+
self: Series[int],
2381+
other: (
2382+
Just[float]
2383+
| Sequence[Just[float]]
2384+
| np_ndarray_float
2385+
| Index[float]
2386+
| Series[float]
2387+
),
2388+
level: Level | None = ...,
2389+
fill_value: float | None = None,
2390+
axis: AxisIndex | None = 0,
2391+
) -> Series[float]: ...
2392+
@overload
2393+
def floordiv(
2394+
self: Series[float],
2395+
other: (
2396+
Just[int]
2397+
| Just[float]
2398+
| Sequence[Just[int]]
2399+
| Sequence[Just[float]]
23292400
| np_ndarray_anyint
23302401
| np_ndarray_float
2331-
| Index[bool]
23322402
| Index[int]
23332403
| Index[float]
2334-
| Series[bool]
23352404
| Series[int]
23362405
| Series[float]
23372406
),
23382407
level: Level | None = ...,
23392408
fill_value: float | None = None,
23402409
axis: AxisIndex | None = 0,
2341-
) -> Series[int]: ...
2410+
) -> Series[float]: ...
23422411
@overload
23432412
def floordiv(
23442413
self: Series[Timedelta],
23452414
other: (
2346-
float
2347-
| Sequence[float]
2348-
| np_ndarray_bool
2415+
Just[int]
2416+
| Just[float]
2417+
| Sequence[Just[int]]
2418+
| Sequence[Just[float]]
23492419
| np_ndarray_anyint
23502420
| np_ndarray_float
2351-
| Index[bool]
23522421
| Index[int]
23532422
| Index[float]
2354-
| Series[bool]
23552423
| Series[int]
23562424
| Series[float]
23572425
),
@@ -2366,6 +2434,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
23662434
timedelta
23672435
| Sequence[timedelta]
23682436
| np.timedelta64
2437+
| np_ndarray_td
23692438
| TimedeltaIndex
23702439
| Series[Timedelta]
23712440
),
@@ -2377,28 +2446,70 @@ class Series(IndexOpsMixin[S1], NDFrame):
23772446
def __rfloordiv__(self, other: Index[Never] | Series[Never]) -> Series: ...
23782447
@overload
23792448
def __rfloordiv__(
2380-
self: Series[bool] | Series[int] | Series[float],
2449+
self: Series[int] | Series[float],
2450+
other: np_ndarray_bool | np_ndarray_complex | np_ndarray_dt | np_ndarray_td,
2451+
) -> Never: ...
2452+
@overload
2453+
def __rfloordiv__(
2454+
self: Series[bool] | Series[complex], other: np_ndarray
2455+
) -> Never: ...
2456+
@overload
2457+
def __rfloordiv__(
2458+
self: Series[int],
23812459
other: (
2382-
float
2383-
| Sequence[float]
2384-
| np_ndarray_bool
2460+
Just[int]
2461+
| Sequence[Just[int]]
2462+
| np_ndarray_anyint
2463+
| Index[int]
2464+
| Series[int]
2465+
),
2466+
) -> Series[int]: ...
2467+
@overload
2468+
def __rfloordiv__(
2469+
self: Series[int],
2470+
other: (
2471+
Just[float]
2472+
| Sequence[Just[float]]
2473+
| np_ndarray_float
2474+
| Index[float]
2475+
| Series[float]
2476+
),
2477+
) -> Series[float]: ...
2478+
@overload
2479+
def __rfloordiv__(
2480+
self: Series[float],
2481+
other: (
2482+
Just[int]
2483+
| Just[float]
2484+
| Sequence[Just[int]]
2485+
| Sequence[Just[float]]
23852486
| np_ndarray_anyint
23862487
| np_ndarray_float
2387-
| Index[bool]
23882488
| Index[int]
23892489
| Index[float]
2390-
| Series[bool]
23912490
| Series[int]
23922491
| Series[float]
23932492
),
2394-
) -> Series[int]: ...
2493+
) -> Series[float]: ...
2494+
@overload
2495+
def __rfloordiv__(
2496+
self: Series[Timedelta],
2497+
other: (
2498+
np_ndarray_bool
2499+
| np_ndarray_anyint
2500+
| np_ndarray_float
2501+
| np_ndarray_complex
2502+
| np_ndarray_dt
2503+
),
2504+
) -> Never: ...
23952505
@overload
23962506
def __rfloordiv__(
23972507
self: Series[Timedelta],
23982508
other: (
23992509
timedelta
24002510
| Sequence[timedelta]
24012511
| np.timedelta64
2512+
| np_ndarray_td
24022513
| TimedeltaIndex
24032514
| Series[Timedelta]
24042515
),
@@ -2413,30 +2524,59 @@ class Series(IndexOpsMixin[S1], NDFrame):
24132524
) -> Series: ...
24142525
@overload
24152526
def rfloordiv(
2416-
self: Series[bool] | Series[int] | Series[float],
2527+
self: Series[int],
24172528
other: (
2418-
float
2419-
| Sequence[float]
2420-
| np_ndarray_bool
2529+
Just[int]
2530+
| Sequence[Just[int]]
2531+
| np_ndarray_anyint
2532+
| Index[int]
2533+
| Series[int]
2534+
),
2535+
level: Level | None = ...,
2536+
fill_value: float | None = None,
2537+
axis: AxisIndex = ...,
2538+
) -> Series[int]: ...
2539+
@overload
2540+
def rfloordiv(
2541+
self: Series[int],
2542+
other: (
2543+
Just[float]
2544+
| Sequence[Just[float]]
2545+
| np_ndarray_float
2546+
| Index[float]
2547+
| Series[float]
2548+
),
2549+
level: Level | None = ...,
2550+
fill_value: float | None = None,
2551+
axis: AxisIndex = ...,
2552+
) -> Series[float]: ...
2553+
@overload
2554+
def rfloordiv(
2555+
self: Series[float],
2556+
other: (
2557+
Just[int]
2558+
| Just[float]
2559+
| Sequence[Just[int]]
2560+
| Sequence[Just[float]]
24212561
| np_ndarray_anyint
24222562
| np_ndarray_float
2423-
| Index[bool]
24242563
| Index[int]
24252564
| Index[float]
2426-
| Series[bool]
2565+
| Series[int]
24272566
| Series[float]
24282567
),
24292568
level: Level | None = ...,
24302569
fill_value: float | None = None,
24312570
axis: AxisIndex = ...,
2432-
) -> Series[int]: ...
2571+
) -> Series[float]: ...
24332572
@overload
24342573
def rfloordiv(
24352574
self: Series[Timedelta],
24362575
other: (
24372576
timedelta
24382577
| Sequence[timedelta]
24392578
| np.timedelta64
2579+
| np_ndarray_td
24402580
| TimedeltaIndex
24412581
| Series[Timedelta]
24422582
),

0 commit comments

Comments
 (0)