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 uses of compat.lrange, part I #26281

Merged
merged 3 commits into from
May 5, 2019

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented May 4, 2019

This PR starts the removal of compat.lrange from the code base. This removal requires some attention, as in most cases a plain range(...) should be used, but in some cases a list(range(...)) needs to be used.

lrange is used quite a lot, so there will be 1 or 2 more PRs, before this is removal is completed.

@topper-123 topper-123 force-pushed the clean_lrange_part_I branch from 1d5e451 to 0b0642c Compare May 4, 2019 07:40
T = [1.0 * x for x in lrange(1, 10) * 10][:1095]
result = Series(T, lrange(0, len(T)))
T = [1.0 * x for x in list(range(1, 10)) * 10][:1095]
result = Series(T)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small cleanup: Setting the index to lrange(0, len(T)) is not needed as it's just the length of the series.

@codecov
Copy link

codecov bot commented May 4, 2019

Codecov Report

Merging #26281 into master will decrease coverage by <.01%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26281      +/-   ##
==========================================
- Coverage   91.98%   91.98%   -0.01%     
==========================================
  Files         175      175              
  Lines       52379    52376       -3     
==========================================
- Hits        48183    48176       -7     
- Misses       4196     4200       +4
Flag Coverage Δ
#multiple 90.53% <90.9%> (-0.01%) ⬇️
#single 40.72% <36.36%> (-0.15%) ⬇️
Impacted Files Coverage Δ
pandas/io/pytables.py 90.22% <0%> (-0.01%) ⬇️
pandas/core/reshape/pivot.py 96.52% <100%> (-0.02%) ⬇️
pandas/core/indexes/multi.py 95.62% <100%> (ø) ⬆️
pandas/core/generic.py 93.54% <100%> (ø) ⬆️
pandas/core/reshape/concat.py 97.2% <100%> (ø) ⬆️
pandas/core/internals/construction.py 95.88% <100%> (ø) ⬆️
pandas/core/indexes/range.py 97.96% <100%> (-0.01%) ⬇️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.9% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f46ab96...0b0642c. Read the comment docs.

@codecov
Copy link

codecov bot commented May 4, 2019

Codecov Report

Merging #26281 into master will decrease coverage by <.01%.
The diff coverage is 95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26281      +/-   ##
==========================================
- Coverage   91.98%   91.98%   -0.01%     
==========================================
  Files         175      175              
  Lines       52377    52374       -3     
==========================================
- Hits        48181    48174       -7     
- Misses       4196     4200       +4
Flag Coverage Δ
#multiple 90.53% <95%> (-0.01%) ⬇️
#single 40.72% <45%> (-0.16%) ⬇️
Impacted Files Coverage Δ
pandas/io/pytables.py 90.22% <0%> (-0.01%) ⬇️
pandas/core/reshape/pivot.py 96.52% <100%> (-0.02%) ⬇️
pandas/util/testing.py 90.61% <100%> (ø) ⬆️
pandas/core/indexes/multi.py 95.62% <100%> (ø) ⬆️
pandas/io/excel/_util.py 87.32% <100%> (-0.18%) ⬇️
pandas/io/html.py 92.66% <100%> (+0.02%) ⬆️
pandas/core/generic.py 93.54% <100%> (ø) ⬆️
pandas/core/reshape/concat.py 97.2% <100%> (ø) ⬆️
pandas/core/internals/construction.py 95.88% <100%> (ø) ⬆️
pandas/core/indexes/range.py 97.96% <100%> (-0.01%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 560ad35...b64656d. Read the comment docs.

@topper-123 topper-123 force-pushed the clean_lrange_part_I branch from 390cd56 to 6926029 Compare May 4, 2019 13:35
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lgtm - nice job!

@WillAyd WillAyd added this to the 0.25.0 milestone May 5, 2019
Copy link
Member

@jschendel jschendel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm overall, just a couple small comments

@pep8speaks
Copy link

pep8speaks commented May 5, 2019

Hello @topper-123! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-05-05 07:16:35 UTC

@topper-123 topper-123 force-pushed the clean_lrange_part_I branch from 973cf72 to b64656d Compare May 5, 2019 07:16
@topper-123
Copy link
Contributor Author

I've adjusted for the comments. Thanks.

@jschendel jschendel merged commit 8ac3123 into pandas-dev:master May 5, 2019
@jschendel
Copy link
Member

thanks @topper-123

@topper-123 topper-123 deleted the clean_lrange_part_I branch May 5, 2019 18:30
@topper-123 topper-123 mentioned this pull request May 14, 2019
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants