-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
API: Restore implicit converter registration #18307
Merged
TomAugspurger
merged 26 commits into
pandas-dev:master
from
TomAugspurger:depr-converter
Dec 7, 2017
Merged
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
220d554
API: Restore implicit converter registration
TomAugspurger fba98b1
Remove matplotlib from blacklist
TomAugspurger ba88a04
fixup! Remove matplotlib from blacklist
TomAugspurger 16c33f1
Add option for toggling formatters
TomAugspurger 3766b78
Remove move
TomAugspurger 5be9793
Handle no matplotlib
TomAugspurger 9364f60
Cleanup
TomAugspurger 39602f9
Test no register
TomAugspurger eb6388e
Restore original state
TomAugspurger 444bc4d
Added deregister
TomAugspurger ec7f7e1
Doc, naming
TomAugspurger 58bf2f6
Naming
TomAugspurger 5ee385e
Added deprecation
TomAugspurger ca6c945
PEP8
TomAugspurger 77f76d2
Fix typos
TomAugspurger ecf4154
Rename it all
TomAugspurger 61fbdbb
Missed one
TomAugspurger 5e16157
Merge remote-tracking branch 'upstream/master' into depr-converter
TomAugspurger d6798d1
Check version
TomAugspurger 576d244
Merge remote-tracking branch 'upstream/master' into depr-converter
TomAugspurger 04d8aa5
No warnings by default
TomAugspurger f061148
Update release notes
TomAugspurger 1112b28
Test fixup
TomAugspurger 897c7ea
Doc update
TomAugspurger 2cf0601
Fix deprecation message
TomAugspurger ee7b457
Test added by default
TomAugspurger 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 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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
'ipython', | ||
'jinja2' | ||
'lxml', | ||
'matplotlib', | ||
'numexpr', | ||
'openpyxl', | ||
'py', | ||
|
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
|
||
from pandas.util._decorators import cache_readonly | ||
from pandas.core.base import PandasObject | ||
from pandas.core.config import get_option | ||
from pandas.core.dtypes.missing import isna, notna, remove_na_arraylike | ||
from pandas.core.dtypes.common import ( | ||
is_list_like, | ||
|
@@ -40,16 +41,13 @@ | |
_get_xlim, _set_ticks_props, | ||
format_date_labels) | ||
|
||
_registered = False | ||
|
||
|
||
def _setup(): | ||
# delay the import of matplotlib until nescessary | ||
global _registered | ||
if not _registered: | ||
from pandas.plotting import _converter | ||
_converter.register() | ||
_registered = True | ||
try: | ||
from pandas.plotting import _converter | ||
except ImportError: | ||
pass | ||
else: | ||
if get_option('plotting.matplotlib.register_converters'): | ||
_converter.register(warn=True) | ||
|
||
|
||
def _get_standard_kind(kind): | ||
|
@@ -99,7 +97,7 @@ def __init__(self, data, kind=None, by=None, subplots=False, sharex=None, | |
secondary_y=False, colormap=None, | ||
table=False, layout=None, **kwds): | ||
|
||
_setup() | ||
_converter._WARN = False | ||
self.data = data | ||
self.by = by | ||
|
||
|
@@ -2059,7 +2057,7 @@ def boxplot_frame(self, column=None, by=None, ax=None, fontsize=None, rot=0, | |
grid=True, figsize=None, layout=None, | ||
return_type=None, **kwds): | ||
import matplotlib.pyplot as plt | ||
_setup() | ||
_converter._WARN = False | ||
ax = boxplot(self, column=column, by=by, ax=ax, fontsize=fontsize, | ||
grid=grid, rot=rot, figsize=figsize, layout=layout, | ||
return_type=return_type, **kwds) | ||
|
@@ -2155,7 +2153,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, | |
kwds : other plotting keyword arguments | ||
To be passed to hist function | ||
""" | ||
_setup() | ||
_converter._WARN = False | ||
if by is not None: | ||
axes = grouped_hist(data, column=column, by=by, ax=ax, grid=grid, | ||
figsize=figsize, sharex=sharex, sharey=sharey, | ||
|
@@ -2289,6 +2287,8 @@ def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None, | |
------- | ||
axes: collection of Matplotlib Axes | ||
""" | ||
_converter._WARN = False | ||
|
||
def plot_group(group, ax): | ||
ax.hist(group.dropna().values, bins=bins, **kwargs) | ||
|
||
|
@@ -2352,7 +2352,7 @@ def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None, | |
>>> grouped = df.unstack(level='lvl1').groupby(level=0, axis=1) | ||
>>> boxplot_frame_groupby(grouped, subplots=False) | ||
""" | ||
_setup() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one doesn't need to be replaced with _converter.WARN = False ? |
||
_converter._WARN = False | ||
if subplots is True: | ||
naxes = len(grouped) | ||
fig, axes = _subplots(naxes=naxes, squeeze=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.
I am not sure if I would show that here. Because people who glance over it might think they need to add that to their code, which is not the case.