10000 Fix, per comments in PR · matplotlib/matplotlib@22f99bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 22f99bb

Browse files
committed
Fix, per comments in PR
1 parent c90bcfb commit 22f99bb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/matplotlib/style/core.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import contextlib
21+
import warnings
2122

2223
import matplotlib as mpl
2324
from matplotlib import cbook
@@ -42,8 +43,16 @@
4243
'savefig.directory', 'tk.window_focus', 'hardcopy.docstring'])
4344

4445

45-
def _blacklist_style_params(d):
46-
return dict((k, v) for (k, v) in d.items() if k not in STYLE_BLACKLIST)
46+
def _remove_blacklisted_style_params(d):
47+
o = {}
48+
for key, val in d.items():
49+
if key in STYLE_BLACKLIST:
50+
warnings.warn(
51+
"Style includes a parameter, '{0}', that is not related to "
52+
"style. Ignoring".format(key))
53+
else:
54+
o[key] = val
55+
return o
4756

4857

4958
def is_style_file(filename):
@@ -52,7 +61,7 @@ def is_style_file(filename):
5261

5362

5463
def _apply_style(d):
55-
mpl.rcParams.use(blacklist_style_params(d))
64+
mpl.rcParams.use(_remove_blacklisted_style_params(d))
5665

5766

5867
def use(style):

0 commit comments

Comments
 (0)
0