Skip to content

[ENH] Move intersection functions for DatetimeIndex and TimedeltaIndex to Datetimelike and added tests #25121

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

Closed
wants to merge 10 commits into from

Conversation

fdroessler
Copy link
Contributor

Because DatetimeIndex and TimedeltaIndex intersections are similar, I have moved the intersection function of both classes up into Datetimelike after discussions with @reidy-p @jorisvandenbossche. At the same time for PeriodIndex I have used Index.intersection instead. Additionally I have added some tests to TimedeltaIndex recycling some tests from DatetimeIndex.

@fdroessler fdroessler changed the title Move intersection Move intersection functions for DatetimeIndex and TimedeltaIndex to Datetimelike and added tests Feb 3, 2019
@fdroessler fdroessler changed the title Move intersection functions for DatetimeIndex and TimedeltaIndex to Datetimelike and added tests [ENH] Move intersection functions for DatetimeIndex and TimedeltaIndex to Datetimelike and added tests Feb 3, 2019
@codecov
Copy link

codecov bot commented Feb 3, 2019

Codecov Report

Merging #25121 into master will increase coverage by <.01%.
The diff coverage is 92.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25121      +/-   ##
==========================================
+ Coverage   92.37%   92.38%   +<.01%     
==========================================
  Files         166      166              
  Lines       52415    52395      -20     
==========================================
- Hits        48418    48404      -14     
+ Misses       3997     3991       -6
Flag Coverage Δ
#multiple 90.8% <92.68%> (ø) ⬆️
#single 42.89% <36.58%> (+0.02%) ⬆️
Impacted Files Coverage Δ
pandas/core/indexes/datetimes.py 96.73% <ø> (+0.45%) ⬆️
pandas/core/indexes/timedeltas.py 90.99% <ø> (+0.76%) ⬆️
pandas/core/indexes/period.py 92.1% <100%> (+0.03%) ⬆️
pandas/core/indexes/datetimelike.py 97.88% <92.3%> (-0.65%) ⬇️

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 a814ea4...0540312. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 3, 2019

Codecov Report

Merging #25121 into master will decrease coverage by 0.2%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25121      +/-   ##
==========================================
- Coverage   92.37%   92.16%   -0.21%     
==========================================
  Files         166      166              
  Lines       52415    52279     -136     
==========================================
- Hits        48418    48184     -234     
- Misses       3997     4095      +98
Flag Coverage Δ
#multiple 90.63% <93.75%> (-0.17%) ⬇️
#single 42.29% <43.75%> (-0.58%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/period.py 92.12% <100%> (+0.05%) ⬆️
pandas/core/indexes/datetimes.py 96.74% <100%> (+0.46%) ⬆️
pandas/core/indexes/timedeltas.py 91.04% <100%> (+0.82%) ⬆️
pandas/core/indexes/datetimelike.py 97.88% <92.3%> (-0.65%) ⬇️
pandas/core/panel.py 93.87% <0%> (-4.05%) ⬇️
pandas/core/groupby/ops.py 94.15% <0%> (-2.58%) ⬇️
pandas/io/pytables.py 90.42% <0%> (-1.89%) ⬇️
pandas/core/computation/pytables.py 90.54% <0%> (-1.81%) ⬇️
pandas/core/internals/managers.py 94.83% <0%> (-1.24%) ⬇️
pandas/core/computation/expr.py 88.17% <0%> (-0.52%) ⬇️
... and 26 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 a814ea4...6c8a57d. Read the comment docs.

@jreback jreback added Datetime Datetime data dtype Timedelta Timedelta data type Clean labels Feb 6, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone Feb 6, 2019
@fdroessler
Copy link
Contributor Author

@jreback and @jorisvandenbossche Thanks for the feedback, I think that all should be addressed, locally it looks find on my side. I hope the super syntax is correct and please let me know if the parametrize line breaks are offending anyones aesthetic feelings :)

@jreback
Copy link
Contributor

jreback commented Mar 26, 2019

would love to have this. pls ping if you are interested in continuing. would need to rebase on master.

@jreback jreback closed this Mar 26, 2019
@reidy-p
Copy link
Contributor

reidy-p commented Mar 27, 2019

@fdroessler let me know if you don't have time to finish this at the moment and I can pick it up.

@fdroessler
Copy link
Contributor Author

@reidy-p No I am happy to finish it, as mentioned in the comments above I thought I addressed all points from @jreback but maybe I did not mark them appropriately or he can let me know what is missing? I'll rebase and push it.

@jorisvandenbossche
Copy link
Member

@fdroessler can you open a new PR ? (once you push to a branch after the PR has been closed, github does not let you reopen the PR ...)

@fdroessler
Copy link
Contributor Author

@jorisvandenbossche @jreback I submitted a new PR #25913 let me know if there are any missing issues you want me to resolve, happy to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimedeltaIndex.intersection has no sort option.
4 participants