Skip to content

Commit 0167cf6

Browse files
committedJun 24, 2017
MAINT: Drop pd.options.display.mpl_style
Deprecated in 0.18.0 xref pandas-devgh-12190
1 parent 1265c27 commit 0167cf6

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed
 

‎doc/source/whatsnew/v0.21.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Removal of prior version deprecations/changes
7575
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7676

7777
- :func:`read_excel()` has dropped the ``has_index_names`` parameter (:issue:`10967`)
78+
- The ``pd.options.display.mpl_style`` configuration has been dropped (:issue:`12190`)
7879
- ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`)
7980

8081

‎pandas/core/config_init.py

-32
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
module is imported, register them here rather then in the module.
1010
1111
"""
12-
import warnings
13-
1412
import pandas.core.config as cf
1513
from pandas.core.config import (is_int, is_bool, is_text, is_instance_factory,
1614
is_one_of_factory, get_default_val,
@@ -313,33 +311,6 @@ def use_numexpr_cb(key):
313311
style_backup = dict()
314312

315313

316-
def mpl_style_cb(key):
317-
warnings.warn(pc_mpl_style_deprecation_warning, FutureWarning,
318-
stacklevel=5)
319-
320-
import sys
321-
from pandas.plotting._style import mpl_stylesheet
322-
global style_backup
323-
324-
val = cf.get_option(key)
325-
326-
if 'matplotlib' not in sys.modules.keys():
327-
if not val: # starting up, we get reset to None
328-
return val
329-
raise Exception("matplotlib has not been imported. aborting")
330-
331-
import matplotlib.pyplot as plt
332-
333-
if val == 'default':
334-
style_backup = dict([(k, plt.rcParams[k]) for k in mpl_stylesheet])
335-
plt.rcParams.update(mpl_stylesheet)
336-
elif not val:
337-
if style_backup:
338-
plt.rcParams.update(style_backup)
339-
340-
return val
341-
342-
343314
def table_schema_cb(key):
344315
from pandas.io.formats.printing import _enable_data_resource_formatter
345316
_enable_data_resource_formatter(cf.get_option(key))
@@ -382,9 +353,6 @@ def table_schema_cb(key):
382353
validator=is_one_of_factory([True, False, 'truncate']))
383354
cf.register_option('chop_threshold', None, pc_chop_threshold_doc)
384355
cf.register_option('max_seq_items', 100, pc_max_seq_items)
385-
cf.register_option('mpl_style', None, pc_mpl_style_doc,
386-
validator=is_one_of_factory([None, False, 'default']),
387-
cb=mpl_style_cb)
388356
cf.register_option('height', 60, pc_height_doc,
389357
validator=is_instance_factory([type(None), int]))
390358
cf.register_option('width', 80, pc_width_doc,

‎pandas/tests/plotting/test_frame.py

-16
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import pandas.util.testing as tm
1818
from pandas.util.testing import slow
1919

20-
from pandas.core.config import set_option
21-
2220
import numpy as np
2321
from numpy.random import rand, randn
2422

@@ -2682,20 +2680,6 @@ def test_df_grid_settings(self):
26822680
DataFrame({'a': [1, 2, 3], 'b': [2, 3, 4]}),
26832681
plotting._core._dataframe_kinds, kws={'x': 'a', 'y': 'b'})
26842682

2685-
def test_option_mpl_style(self):
2686-
with tm.assert_produces_warning(FutureWarning,
2687-
check_stacklevel=False):
2688-
set_option('display.mpl_style', 'default')
2689-
with tm.assert_produces_warning(FutureWarning,
2690-
check_stacklevel=False):
2691-
set_option('display.mpl_style', None)
2692-
with tm.assert_produces_warning(FutureWarning,
2693-
check_stacklevel=False):
2694-
set_option('display.mpl_style', False)
2695-
2696-
with pytest.raises(ValueError):
2697-
set_option('display.mpl_style', 'default2')
2698-
26992683
def test_invalid_colormap(self):
27002684
df = DataFrame(randn(3, 2), columns=['A', 'B'])
27012685

0 commit comments

Comments
 (0)