-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN/API: move plotting funcs to pandas.plotting #16005
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
jreback
merged 12 commits into
pandas-dev:master
from
jorisvandenbossche:api-move-plotting
Apr 15, 2017
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
94fe3e1
CLN: move plotting funcs to pd.plotting
sinhrks 1fba0c6
Add deprecation wrapper
sinhrks 859ad24
Move tests upder plotting and other corrections
sinhrks ea757d4
Do not import deprecate decorator on the top namespace
sinhrks b5328a2
addd whatsnew
sinhrks a1f272a
Move test to tests/plotting
jorisvandenbossche c6452b3
also move plot_params
jorisvandenbossche d4bdb0a
remaining feedback + reorg
jorisvandenbossche 72ffe97
fixups from rebase
jorisvandenbossche 09291e2
further fixups
jorisvandenbossche 468313a
fix converter import
jorisvandenbossche 7f895cb
feedback
jorisvandenbossche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
Plotting api | ||
""" | ||
|
||
# flake8: noqa | ||
|
||
try: # mpl optional | ||
from pandas.plotting import _converter | ||
_converter.register() # needs to override so set_xlim works with str/number | ||
except ImportError: | ||
pass | ||
|
||
from pandas.plotting._misc import (scatter_matrix, radviz, | ||
andrews_curves, bootstrap_plot, | ||
parallel_coordinates, lag_plot, | ||
autocorrelation_plot) | ||
from pandas.plotting._core import boxplot | ||
from pandas.plotting._style import plot_params | ||
from pandas.plotting._tools import table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# being a bit too dynamic | ||
# pylint: disable=E1101 | ||
from __future__ import division | ||
|
||
from distutils.version import LooseVersion | ||
|
||
|
||
def _mpl_le_1_2_1(): | ||
try: | ||
import matplotlib as mpl | ||
return (str(mpl.__version__) <= LooseVersion('1.2.1') and | ||
str(mpl.__version__)[0] != '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_1_3_1(): | ||
try: | ||
import matplotlib | ||
# The or v[0] == '0' is because their versioneer is | ||
# messed up on dev | ||
return (matplotlib.__version__ >= LooseVersion('1.3.1') or | ||
matplotlib.__version__[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_1_4_0(): | ||
try: | ||
import matplotlib | ||
return (matplotlib.__version__ >= LooseVersion('1.4') or | ||
matplotlib.__version__[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_1_5_0(): | ||
try: | ||
import matplotlib | ||
return (matplotlib.__version__ >= LooseVersion('1.5') or | ||
matplotlib.__version__[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_2_0_0(): | ||
try: | ||
import matplotlib | ||
return matplotlib.__version__ >= LooseVersion('2.0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_le_2_0_0(): | ||
try: | ||
import matplotlib | ||
return matplotlib.compare_versions('2.0.0', matplotlib.__version__) | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_2_0_1(): | ||
try: | ||
import matplotlib | ||
return matplotlib.__version__ >= LooseVersion('2.0.1') | ||
except ImportError: | ||
return False |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 thisThere was a problem hiding this comment.
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 doingfrom pandas.tools import plotting
as a user) for back-compat, so not related topandas.plotting
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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