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

Projects
None yet
3 participants
@jorisvandenbossche
Copy link
Member

commented Apr 14, 2017

closes #12548, rebase of #13579

@jorisvandenbossche jorisvandenbossche force-pushed the jorisvandenbossche:api-move-plotting branch from 8393e55 to 72ffe97 Apr 15, 2017

return lines


def _maybe_resample(series, ax, kwargs):

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

yep, indeed!

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

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

did the test module change as well?

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

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

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

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

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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)

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

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

@jsexauer jsexauer referenced this pull request Apr 15, 2017

Open

DEPR: deprecations from prior versions #6581

0 of 94 tasks complete
@codecov

This comment has been minimized.

Copy link

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.

@jorisvandenbossche jorisvandenbossche force-pushed the jorisvandenbossche:api-move-plotting branch from 3d7663e to 468313a Apr 15, 2017

@@ -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`)

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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.

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

Furthermore

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

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

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

indeed (but will leave that for other PR)

MUSEC_PER_DAY = 1e6 * SEC_PER_DAY


def _mpl_le_2_0_0():

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

should be in _compat

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

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',

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

scatter_matrix too

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

This comment has been minimized.

Copy link
@jreback

jreback Apr 15, 2017

Contributor

is this file staying for a reason?

This comment has been minimized.

Copy link
@jorisvandenbossche

jorisvandenbossche Apr 15, 2017

Author Member

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

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2017

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

@jorisvandenbossche

This comment has been minimized.

Copy link
Member Author

commented Apr 15, 2017

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2017

ready to merge?

@jorisvandenbossche

This comment has been minimized.

Copy link
Member Author

commented Apr 15, 2017

When it is green, yes

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

2 of 3 checks passed

ci/circleci CircleCI is running your tests
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2017

thanks!

@jorisvandenbossche jorisvandenbossche deleted the jorisvandenbossche:api-move-plotting branch Apr 15, 2017

@jorisvandenbossche

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2017

and thanks @sinhrks for the original work!

linebp added a commit to linebp/pandas that referenced this pull request Apr 17, 2017

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

@jreback jreback referenced this pull request Oct 27, 2018

Open

DEPR: deprecations log for removed issues #13777

135 of 135 tasks complete

gfyoung added a commit to forking-repos/pandas that referenced this pull request Oct 28, 2018

jreback added a commit that referenced this pull request Oct 28, 2018

brute4s99 added a commit to brute4s99/pandas that referenced this pull request Nov 19, 2018

Pingviinituutti added a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019

Pingviinituutti added 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
You can’t perform that action at this time.