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