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/API: move plotting funcs to pandas.plotting #16005

Merged
merged 12 commits into from
Apr 15, 2017

Conversation

jorisvandenbossche
Copy link
Member

closes #12548, rebase of #13579

return lines


def _maybe_resample(series, ax, kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

side issue since this entire module is private, the functions themselves don't need to be (but can fix later)

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, indeed!

@@ -649,6 +649,7 @@ def pxd(name):
'pandas.io.msgpack',
'pandas._libs',
'pandas.formats',
'pandas.plotting',
Copy link
Contributor

Choose a reason for hiding this comment

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

did the test module change as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

the test module was already moved to pandas/tests/plotting before, so no layout changes there I think

from pandas.tools.plotting import scatter_matrix, plot_params

# deprecate tools.plotting, plot_params and scatter_matrix on the top namespace
import pandas.tools.plotting
Copy link
Contributor

Choose a reason for hiding this comment

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

ideally this could actually be done in pandas.plotting.api, so main is not crowded like this

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this line is just to make sure pd.tools.plotting is tab-completable/directly usable (without doing from pandas.tools import plotting as a user) for back-compat, so not related to pandas.plotting

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah its probably fine. also need to move these in the test_api to the deprecated section. (also add on to the deprecated issue tracker)

Copy link
Member Author

Choose a reason for hiding this comment

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

there are test for that in pandas/tests/plotting/test_deprecated.py (the top-evel deprecations of plot_params are in test_api.py as well)

added to #6581

@codecov
Copy link

codecov bot commented Apr 15, 2017

Codecov Report

Merging #16005 into master will decrease coverage by 0.02%.
The diff coverage is 71.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16005      +/-   ##
==========================================
- Coverage   91.02%   90.99%   -0.03%     
==========================================
  Files         145      154       +9     
  Lines       50391    50474      +83     
==========================================
+ Hits        45870    45931      +61     
- Misses       4521     4543      +22
Flag Coverage Δ
#multiple 88.8% <71.16%> (-0.03%) ⬇️
#single 40.36% <14.82%> (+0.02%) ⬆️
Impacted Files Coverage Δ
pandas/tools/plotting.py 100% <ø> (+25.38%) ⬆️
pandas/tseries/plotting.py 0% <0%> (-61.79%) ⬇️
pandas/util/doctools.py 0% <0%> (ø) ⬆️
pandas/tseries/converter.py 0% <0%> (-62.96%) ⬇️
pandas/__init__.py 93.02% <100%> (+0.34%) ⬆️
pandas/core/config_init.py 95.34% <100%> (ø) ⬆️
pandas/core/groupby.py 92.03% <100%> (ø) ⬆️
pandas/core/frame.py 97.65% <100%> (ø) ⬆️
pandas/core/series.py 95.09% <100%> (+0.01%) ⬆️
pandas/plotting/_misc.py 38.98% <38.98%> (ø)
... and 20 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 9c56098...7f895cb. Read the comment docs.

@@ -21,6 +21,7 @@ Highlights include:
- Support for S3 handling now uses ``s3fs``, see :ref:`here <whatsnew_0200.api_breaking.s3>`
- Google BigQuery support now uses the ``pandas-gbq`` library, see :ref:`here <whatsnew_0200.api_breaking.gbq>`
- Switched the test framework to use `pytest <http://doc.pytest.org/en/latest>`__ (:issue:`13097`)
- The ``pandas.tools.plotting`` module has been deprecated, moved to ``pandas.plotting``. See :ref:`here <whatsnew_0200.api_breaking.plotting>` (:issue:`12548`)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put the issue number in the sub-section

The ``pandas.tools.plotting`` module has been deprecated, in favor of the top level ``pandas.plotting`` module. All the public plotting functions are now available
from ``pandas.plotting``.

Further, the top-level ``pandas.scatter_matrix`` and ``pandas.plot_params`` are also deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Furthermore

Copy link
Contributor

Choose a reason for hiding this comment

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

are deprecated (also is redundant)

from pandas.compat import lrange
import pandas.compat as compat
import pandas._libs.lib as lib
import pandas.core.common as com
Copy link
Contributor

Choose a reason for hiding this comment

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

side issue: these are pretty verbose imports, usually can just do from pandas import INdex, Series, date_range etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed (but will leave that for other PR)

MUSEC_PER_DAY = 1e6 * SEC_PER_DAY


def _mpl_le_2_0_0():
Copy link
Contributor

Choose a reason for hiding this comment

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

should be in _compat

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, probably left-over from rebase

@@ -69,7 +69,7 @@ class TestPDApi(Base, tm.TestCase):
'melt', 'notnull', 'offsets',
'merge', 'merge_ordered', 'merge_asof',
'period_range',
'pivot', 'pivot_table', 'plot_params', 'qcut',
'pivot', 'pivot_table', 'qcut',
Copy link
Contributor

Choose a reason for hiding this comment

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

scatter_matrix too

TimeSeries_TimedeltaFormatter())
else:
raise TypeError('index type not supported')

Copy link
Contributor

Choose a reason for hiding this comment

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

is this file staying for a reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not fully sure, I suppose the idea was back compat? (@sinhrks ?)

But this one only imports tsplot, I don't think we should regard that as public, so can just as well remove this file then.

@jreback
Copy link
Contributor

jreback commented Apr 15, 2017

@jorisvandenbossche I am fine with merging this before #15998 (or after). lmk.

@jorisvandenbossche
Copy link
Member Author

Fixed the comments (apart from import clean-up, can do later a PR)

Would like to get this in before I have to rebase again (it was a rather painful rebase :-))

the tseries.plotting (also tseries.converter is kept as a shim) question, can maybe deal with that when moving/reorganizing the tseries module.

@jreback
Copy link
Contributor

jreback commented Apr 15, 2017

Would like to get this in before I have to rebase again (it was a rather painful rebase :-))

merge as soon as you are ready.

the tseries.plotting (also tseries.converter is kept as a shim) question, can maybe deal with that when moving/reorganizing the tseries module.

sure (though I would deprecate those modules as you moved them). can do as a followup though.

@jreback
Copy link
Contributor

jreback commented Apr 15, 2017

ready to merge?

@jorisvandenbossche
Copy link
Member Author

When it is green, yes

@jreback jreback merged commit 7993fc8 into pandas-dev:master Apr 15, 2017
@jreback
Copy link
Contributor

jreback commented Apr 15, 2017

thanks!

@jorisvandenbossche jorisvandenbossche deleted the api-move-plotting branch April 15, 2017 22:11
@jorisvandenbossche
Copy link
Member Author

and thanks @sinhrks for the original work!

gfyoung added a commit to forking-repos/pandas that referenced this pull request Oct 27, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Oct 27, 2018
gfyoung added a commit to forking-repos/pandas that referenced this pull request Oct 28, 2018
jreback pushed a commit that referenced this pull request Oct 28, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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.

CLN: Cleanup plotting submodule
3 participants