Skip to content

CLN: move/reorg pandas.tools -> pandas.core.reshape #16032

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 2 commits into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Apr 17, 2017

xref #13634

@jreback jreback added the Clean label Apr 17, 2017
@jreback jreback added this to the 0.20.0 milestone Apr 17, 2017
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

  • The utils (to_numeric) don't really belong in reshape
  • Could we, internally, just import from pandas.core.reshape ? Instead of from pandas.core.reshape.reshape, pandas.core.reshape.pivot, ..) Makes the imports somewhat shorter, and also makes it easier to change things within the reshape submodule without having to change all imports

@@ -230,7 +230,7 @@
# the API pages as top-level functions) based on a template (GH9911)
moved_api_pages = [
'pandas.core.common.isnull', 'pandas.core.common.notnull', 'pandas.core.reshape.get_dummies',
'pandas.tools.merge.concat', 'pandas.tools.merge.merge', 'pandas.tools.pivot.pivot_table',
Copy link
Member

Choose a reason for hiding this comment

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

Those shouldn't be changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so what should these be?

Copy link
Member

Choose a reason for hiding this comment

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

just leave it as is. This is for "back compat" with existing links on the internet, as we previously included the docstring pages for concat using those paths, but now just as pandas.concat

@@ -1348,6 +1348,7 @@ If indicated, a deprecation warning will be issued if you reference theses modul
"pandas.parser", "pandas.io.libparsers", "X"
"pandas.formats", "pandas.io.formats", ""
"pandas.sparse", "pandas.core.sparse", ""
"pandas.tools", "pandas.core.tools", "pandas.tools.plotting"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will be clear. I would rather add another new line for the plotting

"pandas.tools.plotting", "pandas.plotting", "X"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah we should fix the docs on all this

@@ -47,7 +47,7 @@
def concat_wrap():

def wrapper(*args, **kwargs):
warnings.warn("pandas.tools.merge.concat is deprecated. "
Copy link
Member

Choose a reason for hiding this comment

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

We will need to keep this one as well (if we thought it was needed). In any case, deprecating the function at the new location pandas.core.reshape.merge.concat does not really make sense (no one is using that)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, this was original pandas.tools.merge.concat; I will put a deprecation there then.

@@ -9,7 +9,8 @@

from pandas.util.testing import assert_frame_equal

from pandas.core.reshape import (melt, lreshape, get_dummies, wide_to_long)
Copy link
Member

Choose a reason for hiding this comment

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

these can actually also be imported just from pandas

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure lots of things like this :>

@@ -55,7 +55,7 @@ def unpivot(frame):
# Melt

setup = common_setup + """
from pandas.core.reshape import melt
Copy link
Member

Choose a reason for hiding this comment

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

I know it was an automatic search replace, but no need to change those (we should actually just remove them)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right

@jreback
Copy link
Contributor Author

jreback commented Apr 17, 2017

Could we, internally, just import from pandas.core.reshape ? Instead of from pandas.core.reshape.reshape, pandas.core.reshape.pivot, ..) Makes the imports somewhat shorter, and also makes it easier to change things within the reshape submodule without having to change all imports

yes this is a bit tricky as I have to elevate the the (all internal) API from the sub-modules to reshape not a big deal though.

@codecov
Copy link

codecov bot commented Apr 17, 2017

Codecov Report

Merging #16032 into master will decrease coverage by 0.23%.
The diff coverage is 94.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16032      +/-   ##
==========================================
- Coverage   90.99%   90.76%   -0.24%     
==========================================
  Files         153      155       +2     
  Lines       50469    50470       +1     
==========================================
- Hits        45924    45808     -116     
- Misses       4545     4662     +117
Flag Coverage Δ
#multiple 88.52% <94.02%> (-0.24%) ⬇️
#single 40.42% <15.08%> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/tile.py 90.25% <ø> (ø)
pandas/core/reshape/concat.py 97.62% <ø> (ø)
pandas/tools/merge.py 0% <0%> (-93.69%) ⬇️
pandas/plotting/_core.py 81.87% <0%> (ø) ⬆️
pandas/core/api.py 100% <100%> (ø) ⬆️
pandas/core/reshape/pivot.py 95.08% <100%> (ø)
pandas/core/reshape/reshape.py 99.27% <100%> (ø)
pandas/__init__.py 92.3% <100%> (-0.88%) ⬇️
pandas/core/computation/expr.py 87.69% <100%> (ø) ⬆️
pandas/core/frame.py 97.65% <100%> (ø) ⬆️
... and 23 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 e0cbc37...376cef5. Read the comment docs.

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.

2 participants