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

REF: clear out a bunch of algos, de-duplicate a bunch of core.missing #24652

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

"""
Cast values to a dtype that algos.pad and algos.backfill can handle.
"""
# TODO: for int-dtypes we make a copy, but for everything else this
Copy link
Contributor

Choose a reason for hiding this comment

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

no idea why this would be. Would really try to be consistent. I think copy is more sematically correct for these types of routines, as we can't always guaranteee inplace behavior (meaning we may have to copy sometimes). So this may have some uncessary copying going on, but willing to trade that for better semantics.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yah, this came up when testing fillna from #24024. In at least a few of the places where this is used, we make a copy before calling, so we can trim some overhead by being a bit more careful.

I'm going to try to handle this more systematically at the same time I take a look at #24537. Would like to keep the comment there for the time being; I think this was just not noticed previously.

Copy link
Contributor

Choose a reason for hiding this comment

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

absolutely. I am ok with inplace too. Its just then the guarantee to the caller will have to be stronger. We probably don't have enough tests in place to make a strong statement either way, but go for it. This looks like a nice re-factor, so could address the inplace/copy question later (as long as we are pretty sure its not actualy mutating things in the caller, unless its specifically allowed).

@jreback jreback added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Clean labels Jan 6, 2019
@codecov
Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #24652 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24652      +/-   ##
==========================================
+ Coverage   92.37%   92.37%   +<.01%     
==========================================
  Files         166      166              
  Lines       52384    52317      -67     
==========================================
- Hits        48390    48330      -60     
+ Misses       3994     3987       -7
Flag Coverage Δ
#multiple 90.8% <100%> (-0.01%) ⬇️
#single 43.06% <27.77%> (+0.03%) ⬆️
Impacted Files Coverage Δ
pandas/core/missing.py 92.56% <100%> (+0.26%) ⬆️
pandas/util/testing.py 88.09% <0%> (+0.09%) ⬆️

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 393d0aa...e42bc27. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #24652 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24652      +/-   ##
==========================================
+ Coverage   92.37%   92.37%   +<.01%     
==========================================
  Files         166      166              
  Lines       52384    52317      -67     
==========================================
- Hits        48390    48330      -60     
+ Misses       3994     3987       -7
Flag Coverage Δ
#multiple 90.8% <100%> (-0.01%) ⬇️
#single 43.06% <27.77%> (+0.03%) ⬆️
Impacted Files Coverage Δ
pandas/core/missing.py 92.56% <100%> (+0.26%) ⬆️
pandas/util/testing.py 88.09% <0%> (+0.09%) ⬆️

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 393d0aa...e42bc27. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Jan 6, 2019

@jbrockmendel happy to merge

@jreback jreback added this to the 0.24.0 milestone Jan 6, 2019
@jbrockmendel
Copy link
Member Author

everyone happy here?

@jreback
Copy link
Contributor

jreback commented Jan 7, 2019

lgtm

@jbrockmendel jbrockmendel merged commit 1ae466c into pandas-dev:master Jan 7, 2019
@jbrockmendel jbrockmendel deleted the lessalgos branch January 7, 2019 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants