|
33 | 33 | from pandas._typing import (
|
34 | 34 | ArrayLike,
|
35 | 35 | Dtype,
|
36 |
| - IntervalInclusiveType, |
| 36 | + IntervalClosedType, |
37 | 37 | NpDtype,
|
38 | 38 | PositionalIndexer,
|
39 | 39 | ScalarIndexer,
|
@@ -231,7 +231,7 @@ def ndim(self) -> Literal[1]:
|
231 | 231 | def __new__(
|
232 | 232 | cls: type[IntervalArrayT],
|
233 | 233 | data,
|
234 |
| - inclusive: IntervalInclusiveType | None = None, |
| 234 | + inclusive: str | None = None, |
235 | 235 | dtype: Dtype | None = None,
|
236 | 236 | copy: bool = False,
|
237 | 237 | verify_integrity: bool = True,
|
@@ -278,7 +278,7 @@ def _simple_new(
|
278 | 278 | cls: type[IntervalArrayT],
|
279 | 279 | left,
|
280 | 280 | right,
|
281 |
| - inclusive: IntervalInclusiveType | None = None, |
| 281 | + inclusive=None, |
282 | 282 | copy: bool = False,
|
283 | 283 | dtype: Dtype | None = None,
|
284 | 284 | verify_integrity: bool = True,
|
@@ -432,7 +432,7 @@ def _from_factorized(
|
432 | 432 | def from_breaks(
|
433 | 433 | cls: type[IntervalArrayT],
|
434 | 434 | breaks,
|
435 |
| - inclusive: IntervalInclusiveType | None = None, |
| 435 | + inclusive: IntervalClosedType | None = None, |
436 | 436 | copy: bool = False,
|
437 | 437 | dtype: Dtype | None = None,
|
438 | 438 | ) -> IntervalArrayT:
|
@@ -514,7 +514,7 @@ def from_arrays(
|
514 | 514 | cls: type[IntervalArrayT],
|
515 | 515 | left,
|
516 | 516 | right,
|
517 |
| - inclusive: IntervalInclusiveType | None = None, |
| 517 | + inclusive: IntervalClosedType | None = None, |
518 | 518 | copy: bool = False,
|
519 | 519 | dtype: Dtype | None = None,
|
520 | 520 | ) -> IntervalArrayT:
|
@@ -587,7 +587,7 @@ def from_arrays(
|
587 | 587 | def from_tuples(
|
588 | 588 | cls: type[IntervalArrayT],
|
589 | 589 | data,
|
590 |
| - inclusive: IntervalInclusiveType | None = None, |
| 590 | + inclusive=None, |
591 | 591 | copy: bool = False,
|
592 | 592 | dtype: Dtype | None = None,
|
593 | 593 | ) -> IntervalArrayT:
|
@@ -1362,15 +1362,15 @@ def overlaps(self, other):
|
1362 | 1362 | # ---------------------------------------------------------------------
|
1363 | 1363 |
|
1364 | 1364 | @property
|
1365 |
| - def inclusive(self) -> IntervalInclusiveType: |
| 1365 | + def inclusive(self) -> IntervalClosedType: |
1366 | 1366 | """
|
1367 | 1367 | Whether the intervals are closed on the left-side, right-side, both or
|
1368 | 1368 | neither.
|
1369 | 1369 | """
|
1370 | 1370 | return self.dtype.inclusive
|
1371 | 1371 |
|
1372 | 1372 | @property
|
1373 |
| - def closed(self) -> IntervalInclusiveType: |
| 1373 | + def closed(self) -> IntervalClosedType: |
1374 | 1374 | """
|
1375 | 1375 | String describing the inclusive side the intervals.
|
1376 | 1376 |
|
@@ -1424,9 +1424,7 @@ def closed(self) -> IntervalInclusiveType:
|
1424 | 1424 | ),
|
1425 | 1425 | }
|
1426 | 1426 | )
|
1427 |
| - def set_closed( |
1428 |
| - self: IntervalArrayT, closed: IntervalInclusiveType |
1429 |
| - ) -> IntervalArrayT: |
| 1427 | + def set_closed(self: IntervalArrayT, closed: IntervalClosedType) -> IntervalArrayT: |
1430 | 1428 | warnings.warn(
|
1431 | 1429 | "set_closed is deprecated and will be removed in a future version. "
|
1432 | 1430 | "Use set_inclusive instead.",
|
@@ -1477,7 +1475,7 @@ def set_closed(
|
1477 | 1475 | }
|
1478 | 1476 | )
|
1479 | 1477 | def set_inclusive(
|
1480 |
| - self: IntervalArrayT, inclusive: IntervalInclusiveType |
| 1478 | + self: IntervalArrayT, inclusive: IntervalClosedType |
1481 | 1479 | ) -> IntervalArrayT:
|
1482 | 1480 | if inclusive not in VALID_CLOSED:
|
1483 | 1481 | msg = f"invalid option for 'inclusive': {inclusive}"
|
|
0 commit comments