Skip to content

Commit b7fcb54

Browse files
jbrockmendelWillAyd
authored andcommitted
CLN: remove unnecessary overriding in subclasses (#30875)
1 parent d3f0856 commit b7fcb54

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

pandas/core/indexes/category.py

-13
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,6 @@ def _engine(self):
428428
codes = self.codes
429429
return self._engine_type(lambda: codes, len(self))
430430

431-
# introspection
432-
@cache_readonly
433-
def is_unique(self) -> bool:
434-
return self._engine.is_unique
435-
436-
@property
437-
def is_monotonic_increasing(self):
438-
return self._engine.is_monotonic_increasing
439-
440-
@property
441-
def is_monotonic_decreasing(self) -> bool:
442-
return self._engine.is_monotonic_decreasing
443-
444431
@Appender(_index_shared_docs["index_unique"] % _index_doc_kwargs)
445432
def unique(self, level=None):
446433
if level is not None:

pandas/core/indexes/interval.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -437,22 +437,8 @@ def memory_usage(self, deep: bool = False) -> int:
437437
# so return the bytes here
438438
return self.left.memory_usage(deep=deep) + self.right.memory_usage(deep=deep)
439439

440-
@cache_readonly
441-
def is_monotonic(self) -> bool:
442-
"""
443-
Return True if the IntervalIndex is monotonic increasing (only equal or
444-
increasing values), else False
445-
"""
446-
return self.is_monotonic_increasing
447-
448-
@cache_readonly
449-
def is_monotonic_increasing(self) -> bool:
450-
"""
451-
Return True if the IntervalIndex is monotonic increasing (only equal or
452-
increasing values), else False
453-
"""
454-
return self._engine.is_monotonic_increasing
455-
440+
# IntervalTree doesn't have a is_monotonic_decreasing, so have to override
441+
# the Index implemenation
456442
@cache_readonly
457443
def is_monotonic_decreasing(self) -> bool:
458444
"""

0 commit comments

Comments
 (0)