Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate many single-use rc validators.#21054

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
anntzer wants to merge1 commit intomatplotlib:mainfromanntzer:lessrc
Closed
Show file tree
Hide file tree
Changes fromall 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
6 changes: 6 additions & 0 deletionsdoc/api/next_api_changes/deprecations/21054-AL.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
Deprecation of rcParams validators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following rcParams validators defined in :mod:`.rcsetup` are
deprecated with no replacement: ``validate_any``, ``validate_anylist``,
``validate_fillstylelist``, ``validate_markeverylist``, ``validate_hatchlist``,
``validate_dashlist``.
29 changes: 18 additions & 11 deletionslib/matplotlib/rcsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,8 +84,12 @@ def __call__(self, s):

@lru_cache
def _listify_validator(scalar_validator, allow_stringlist=False, *,
n=None, doc=None):
n=None, doc=None, _deprecated=None):
def f(s):
if _deprecated:
name, = (k for k, v in globals().items() if v is f)
cbook.warn_deprecated(
_deprecated, name=name, obj_type="function")
if isinstance(s, str):
try:
val = [scalar_validator(v.strip()) for v in s.split(',')
Expand DownExpand Up@@ -123,9 +127,10 @@ def f(s):
return f


@_api.deprecated("3.8")
def validate_any(s):
return s
validate_anylist = _listify_validator(validate_any)
validate_anylist = _listify_validator(validate_any, _deprecated="3.8")


def _validate_date(s):
Expand DownExpand Up@@ -487,7 +492,8 @@ def _is_iterable_not_string_like(x):
'markers.fillstyle', ['full', 'left', 'right', 'bottom', 'top', 'none'])


validate_fillstylelist = _listify_validator(validate_fillstyle)
validate_fillstylelist = _listify_validator(
validate_fillstyle, _deprecated="3.8")


def validate_markevery(s):
Expand DownExpand Up@@ -524,7 +530,8 @@ def validate_markevery(s):
raise TypeError("'markevery' is of an invalid type")


validate_markeverylist = _listify_validator(validate_markevery)
validate_markeverylist = _listify_validator(
validate_markevery, _deprecated="3.8")


def validate_bbox(s):
Expand DownExpand Up@@ -591,8 +598,8 @@ def validate_hatch(s):
return s


validate_hatchlist = _listify_validator(validate_hatch)
validate_dashlist = _listify_validator(validate_floatlist)
validate_hatchlist = _listify_validator(validate_hatch, _deprecated="3.8")
validate_dashlist = _listify_validator(validate_floatlist, _deprecated="3.8")


def _validate_minor_tick_ndivs(n):
Expand DownExpand Up@@ -622,16 +629,16 @@ def _validate_minor_tick_ndivs(n):
'edgecolor': validate_colorlist,
'joinstyle': _listify_validator(JoinStyle),
'capstyle': _listify_validator(CapStyle),
'fillstyle':validate_fillstylelist,
'fillstyle':_listify_validator(validate_fillstyle),
'markerfacecolor': validate_colorlist,
'markersize': validate_floatlist,
'markeredgewidth': validate_floatlist,
'markeredgecolor': validate_colorlist,
'markevery':validate_markeverylist,
'markevery':_listify_validator(validate_markevery),
'alpha': validate_floatlist,
'marker': validate_stringlist,
'hatch':validate_hatchlist,
'dashes':validate_dashlist,
'hatch':_listify_validator(validate_hatch),
'dashes':_listify_validator(validate_floatlist),
}
_prop_aliases = {
'c': 'color',
Expand DownExpand Up@@ -1234,7 +1241,7 @@ def _convert_validator_spec(key, conv):
"path.simplify_threshold": _validate_greaterequal0_lessequal1,
"path.snap": validate_bool,
"path.sketch": validate_sketch,
"path.effects":validate_anylist,
"path.effects":_listify_validator(lambda s: s), # any list
"agg.path.chunksize": validate_int, # 0 to disable chunking

# key-mappings (multi-character mappings should be a list/tuple)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp