Skip to content

CLN: remove unused _max_fitting_element #41639

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

Merged
merged 1 commit into from
May 24, 2021
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
5 changes: 0 additions & 5 deletions pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,6 @@ def _min_fitting_element(self, lower_limit: int) -> int:
no_steps = -(-(lower_limit - self.start) // abs(self.step))
return self.start + abs(self.step) * no_steps

def _max_fitting_element(self, upper_limit: int) -> int:
"""Returns the largest element smaller than or equal to the limit"""
no_steps = (upper_limit - self.start) // abs(self.step)
return self.start + abs(self.step) * no_steps

def _extended_gcd(self, a: int, b: int) -> tuple[int, int, int]:
"""
Extended Euclidean algorithms to solve Bezout's identity:
Expand Down
18 changes: 0 additions & 18 deletions pandas/tests/indexes/ranges/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,24 +369,6 @@ def test_min_fitting_element(self):
result = RangeIndex(5, big_num * 2, 1)._min_fitting_element(big_num)
assert big_num == result

def test_max_fitting_element(self):
result = RangeIndex(0, 20, 2)._max_fitting_element(17)
assert 16 == result

result = RangeIndex(1, 6)._max_fitting_element(4)
assert 4 == result

result = RangeIndex(18, -2, -2)._max_fitting_element(17)
assert 16 == result

result = RangeIndex(5, 0, -1)._max_fitting_element(4)
assert 4 == result

big_num = 500000000000000000000000

result = RangeIndex(5, big_num * 2, 1)._max_fitting_element(big_num)
assert big_num == result

def test_pickle_compat_construction(self):
# RangeIndex() is a valid constructor
pass
Expand Down