ENH: Stricter validation of line style rcParams (and extended accepted types for `grid.linestyle`) #8040
Merged
NelleV
merged 15 commits into
matplotlib:master
from
afvincent:wip_relax_grid_ls_validation
Feb 18, 2017
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
061061b
extend 'grid.linestyle' valid types to on-off ink sequences
afvincent 5be29b5
extend 'add test for the new function 'validate_grid_linestyle'
afvincent 25efd07
fix a small typo
afvincent 5cb183c
Relax validation for all ls-related rcParams but contour.negative_lin…
afvincent d9ff6a8
Check that strings are valid line styles
afvincent 44c3fde
fix PEP8
afvincent e8032df
use validate_linestyle even for rcParam 'contour.negative_linestyle'
afvincent 2673585
Reintroduce former public validators for negative contours (but they …
afvincent 7bd9bfe
make validate_linestyle private and case insensitive (+ adapt relevan…
afvincent ad21964
Remove deprecation warning in 'validate_negative_linestyle_legacy'
afvincent 7ab75f5
Deprecate former validation schemes used by 'contour.negative_linestyle'
afvincent 59328e6
Fix typo (a forgotten 'return' statement...)
afvincent 70e87c8
Fix the deprecation decorators
afvincent c060842
Add a what's new entry
afvincent aabf385
Fix a typo with the example in the what's new entry
afvincent | @@ -0,0 +1,31 @@ | ||
| +Validation of line style rcParams | ||
| +--------------------------------- | ||
| + | ||
| +Stricter validation | ||
| +``````````````````` | ||
| +The validation of rcParams that are related to line styles | ||
| +(``lines.linestyle``, ``boxplot.*.linestyle``, ``grid.linestyle`` and | ||
| +``contour.negative_linestyle``) now effectively checks that the values | ||
| +are valid line styles. Strings like ``dashed`` or ``--`` are accepted, | ||
| +as well as even-length sequences of on-off ink like ``[1, 1.65]``. In | ||
| +this latter case, the offset value is handled internally and should *not* | ||
| +be provided by the user. | ||
| + | ||
| +The validation is case-insensitive. | ||
| + | ||
| +Deprecation of the former validators for ``contour.negative_linestyle`` | ||
| +``````````````````````````````````````````````````````````````````````` | ||
| +The new validation scheme replaces the former one used for the | ||
| +``contour.negative_linestyle`` rcParams, that was limited to ``solid`` | ||
| +and ``dashed`` line styles. | ||
| + | ||
| +The former public validation functions ``validate_negative_linestyle`` | ||
| +and ``validate_negative_linestyle_legacy`` will be deprecated in 2.1 and | ||
| +may be removed in 2.3. There are no public functions to replace them. | ||
| + | ||
| +Examples of use | ||
| +``````````````` | ||
| +:: | ||
| + | ||
| + grid.linestyle : (1, 3) # loosely dotted grid lines | ||
| + contour.negative_linestyle : dashdot # previously only solid or dashed |