Skip to content

templatize timedelta arith ops #19871

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 2 commits into from
Feb 24, 2018
Merged

Conversation

jbrockmendel
Copy link
Member

Some Timedelta operations are constructed using _binary_op_method_timedeltalike, while a bunch of others re-implement shared logic. This PR is an attempt to get rid of the small differences in this shared logic so they can eventually use a single template.

@codecov
Copy link

codecov bot commented Feb 24, 2018

Codecov Report

Merging #19871 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #19871   +/-   ##
=======================================
  Coverage   91.64%   91.64%           
=======================================
  Files         150      150           
  Lines       48946    48946           
=======================================
  Hits        44858    44858           
  Misses       4088     4088
Flag Coverage Δ
#multiple 90.02% <ø> (ø) ⬆️
#single 41.81% <ø> (ø) ⬆️

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 ce77b79...6225653. Read the comment docs.

if hasattr(other, 'delta') and not PyDelta_Check(other):
# offsets.Tick
return op(self, other.delta)
if hasattr(other, '_typ'):
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than repeating this code can you make a function?

Copy link
Member Author

Choose a reason for hiding this comment

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

thats exactly what this PR is preliminary to, but with more than just these 3 lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok

@jreback jreback added the Timedelta Timedelta data type label Feb 24, 2018
@jreback jreback added this to the 0.23.0 milestone Feb 24, 2018
@jreback jreback added the Clean label Feb 24, 2018
@jreback jreback merged commit feedf66 into pandas-dev:master Feb 24, 2018
@jreback
Copy link
Contributor

jreback commented Feb 24, 2018

thanks

harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
@jbrockmendel jbrockmendel deleted the tdfixes8 branch June 22, 2018 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants