Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Stricter validation of line style rcParams (and extended accepted types for grid.linestyle) #8040

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 15 commits into from
Feb 18, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Deprecate former validation schemes used by 'contour.negative_linestyle'
  • Loading branch information
afvincent committed Feb 14, 2017
commit 7ab75f5eddf02007f90ff694a94ed19a9f1630e5
19 changes: 15 additions & 4 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import warnings
import re

from matplotlib.cbook import mplDeprecation, ls_mapper
from matplotlib.cbook import mplDeprecation, deprecated, ls_mapper
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
from matplotlib.colors import is_color_like

Expand Down Expand Up @@ -530,11 +530,22 @@ def validate_ps_distiller(s):
'top', 'none'])
validate_fillstylelist = _listify_validator(validate_fillstyle)

validate_negative_linestyle = ValidateInStrings('negative_linestyle',
['solid', 'dashed'],
ignorecase=True)
_validate_negative_linestyle = ValidateInStrings('negative_linestyle',
['solid', 'dashed'],
ignorecase=True)


@deprecated('3.0.0?', pending=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we deprecate this "for sure"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, something like

@deprecated(the version number you will kindly suggest,  # :)
            addendum=(" See 'validate_negative_linestyle_legacy' " +
                      "deprecation warning for more information.")
            )

would be better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :D
I suggest deprecating this in 2.1, which means no backporting. Is that a problem?

addendum=(" See 'validate_negative_linestyle_legacy' " +
"deprecation warning for more information."))
def validate_negative_linestyle(s):
_validate_negative_linestyle(s)


@deprecated('3.0.0?', pending=True,
addendum=(" The 'contour.negative_linestyle' rcParam now " +
"follows the same validation as the other rcParams " +
"that are related to line style."))
def validate_negative_linestyle_legacy(s):
try:
res = validate_negative_linestyle(s)
Expand Down