Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: remove unnecessary overriding in subclasses #30875

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 0 additions & 13 deletions pandas/core/indexes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,6 @@ def _engine(self):
codes = self.codes
return self._engine_type(lambda: codes, len(self))

# introspection
@cache_readonly
def is_unique(self) -> bool:
return self._engine.is_unique

@property
def is_monotonic_increasing(self):
return self._engine.is_monotonic_increasing

@property
def is_monotonic_decreasing(self) -> bool:
return self._engine.is_monotonic_decreasing

@Appender(_index_shared_docs["index_unique"] % _index_doc_kwargs)
def unique(self, level=None):
if level is not None:
Expand Down
18 changes: 2 additions & 16 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,22 +437,8 @@ def memory_usage(self, deep: bool = False) -> int:
# so return the bytes here
return self.left.memory_usage(deep=deep) + self.right.memory_usage(deep=deep)

@cache_readonly
def is_monotonic(self) -> bool:
"""
Return True if the IntervalIndex is monotonic increasing (only equal or
increasing values), else False
"""
return self.is_monotonic_increasing

@cache_readonly
def is_monotonic_increasing(self) -> bool:
"""
Return True if the IntervalIndex is monotonic increasing (only equal or
increasing values), else False
"""
return self._engine.is_monotonic_increasing

# IntervalTree doesn't have a is_monotonic_decreasing, so have to override
# the Index implemenation
@cache_readonly
def is_monotonic_decreasing(self) -> bool:
"""
Expand Down