FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ENH: Stricter validation of line style rcParams (and extended accepted types for `grid.linestyle`) by afvincent · Pull Request #8040 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
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
This file contains hidden or 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
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Back | FazBrowse Home | New Git URL