Skip to content

Deprecate verbose-related rcParams. #13761

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
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/api/next_api_changes/2019-03-26-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Deprecations
````````````

The ``verbose.fileo`` and ``verbose.level`` rcParams, which have had no effect
ever since the switch from Matplotlib's old custom Verbose logging to the
stdlib's `logging` module, are deprecated.

The ``rcsetup.validate_verbose`` function is deprecated.
15 changes: 2 additions & 13 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ def gen_candidates():
_deprecated_remain_as_none = {
'text.latex.unicode': ('3.0',),
'savefig.frameon': ('3.1',),
'verbose.fileo': ('3.1',),
'verbose.level': ('3.1',),
}


Expand Down Expand Up @@ -928,19 +930,6 @@ def _rc_params_in_file(fname, fail_on_error=False):

config = RcParams()

for key in ('verbose.level', 'verbose.fileo'):
if key in rc_temp:
val, line, cnt = rc_temp.pop(key)
if fail_on_error:
config[key] = val # try to convert to proper type or raise
else:
try:
config[key] = val # try to convert to proper type or skip
except Exception as msg:
error_details = _error_details_fmt % (cnt, line, fname)
_log.warning('Bad val %r on %s\n\t%s',
val, error_details, msg)

for key, (val, line, cnt) in rc_temp.items():
if key in defaultParams:
if fail_on_error:
Expand Down
21 changes: 0 additions & 21 deletions lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -448,27 +448,6 @@ svg.fonttype : path # How to handle SVG fonts:
# 'none': Assume fonts are installed on the machine where the SVG will be viewed.
# 'path': Embed characters as paths -- supported by most SVG renderers


# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
# levels are: silent, helpful, debug, debug-annoying. Any level is
# inclusive of all the levels below it. If your setting is "debug",
# you'll get all the debug and helpful messages. When submitting
# problems to the mailing-list, please set verbose to "helpful" or "debug"
# and paste the output into your report.
#
# The "fileo" gives the destination for any calls to verbose.report.
# These objects can a filename, or a filehandle like sys.stdout.
#
# You can override the rc default verbosity from the command line by
# giving the flags --verbose-LEVEL where LEVEL is one of the legal
# levels, e.g., --verbose-helpful.
#
# You can access the verbose instance in your code
# from matplotlib import verbose.
verbose.level : silent # one of silent, helpful, debug, debug-annoying
verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr

# Event keys to interact with figures/plots via keyboard.
# Customize these settings according to your needs.
# Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '')
Expand Down
21 changes: 0 additions & 21 deletions lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -452,27 +452,6 @@ svg.fonttype : path # How to handle SVG fonts:
# 'none': Assume fonts are installed on the machine where the SVG will be viewed.
# 'path': Embed characters as paths -- supported by most SVG renderers


# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
# levels are: silent, helpful, debug, debug-annoying. Any level is
# inclusive of all the levels below it. If your setting is "debug",
# you'll get all the debug and helpful messages. When submitting
# problems to the mailing-list, please set verbose to "helpful" or "debug"
# and paste the output into your report.
#
# The "fileo" gives the destination for any calls to verbose.report.
# These objects can a filename, or a filehandle like sys.stdout.
#
# You can override the rc default verbosity from the command line by
# giving the flags --verbose-LEVEL where LEVEL is one of the legal
# levels, e.g., --verbose-helpful.
#
# You can access the verbose instance in your code
# from matplotlib import verbose.
verbose.level : silent # one of silent, helpful, debug, debug-annoying
verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr

# Event keys to interact with figures/plots via keyboard.
# Customize these settings according to your needs.
# Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '')
Expand Down
15 changes: 11 additions & 4 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,22 @@ def validate_font_properties(s):
validate_mathtext_default = ValidateInStrings(
'default',
"rm cal it tt sf bf default bb frak circled scr regular".split())
validate_verbose = ValidateInStrings(
'verbose',
['silent', 'helpful', 'debug', 'debug-annoying'])
_validate_alignment = ValidateInStrings(
'alignment',
['center', 'top', 'bottom', 'baseline',
'center_baseline'])


_validate_verbose = ValidateInStrings(
'verbose',
['silent', 'helpful', 'debug', 'debug-annoying'])


@cbook.deprecated("3.1")
def validate_verbose(s):
return _validate_verbose(s)


def validate_whiskers(s):
if s == 'range':
return 'range'
Expand Down Expand Up @@ -1006,7 +1013,7 @@ def _validate_linestyle(ls):
'timezone': ['UTC', validate_string],

# the verbosity setting
'verbose.level': ['silent', validate_verbose],
'verbose.level': ['silent', _validate_verbose],
'verbose.fileo': ['sys.stdout', validate_string],

# line props
Expand Down