Skip to content

Commit 60d4906

Browse files
committed
Remove case-insensitivity deprecated in 3.3.
1 parent 833658b commit 60d4906

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Case-insensitive properties
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Upper or mixed-case property names are no longer normalized to lowercase in
4+
`.Artist.set` and `.Artist.update`. This allows one to pass names such as
5+
*patchA* or *UVC*.
6+
7+
Case-insensitive capstyles and joinstyles
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
Please pass capstyles ("miter", "round", "bevel") and joinstyles ("butt",
10+
"round", "projecting") as lowercase.

lib/matplotlib/_enums.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212

1313
from enum import Enum, auto
14-
from matplotlib import cbook, docstring
14+
from matplotlib import docstring
1515

1616

1717
class _AutoStringNameEnum(Enum):
@@ -24,23 +24,6 @@ def __hash__(self):
2424
return str(self).__hash__()
2525

2626

27-
def _deprecate_case_insensitive_join_cap(s):
28-
s_low = s.lower()
29-
if s != s_low:
30-
if s_low in ['miter', 'round', 'bevel']:
31-
cbook.warn_deprecated(
32-
"3.3", message="Case-insensitive capstyles are deprecated "
33-
"since %(since)s and support for them will be removed "
34-
"%(removal)s; please pass them in lowercase.")
35-
elif s_low in ['butt', 'round', 'projecting']:
36-
cbook.warn_deprecated(
37-
"3.3", message="Case-insensitive joinstyles are deprecated "
38-
"since %(since)s and support for them will be removed "
39-
"%(removal)s; please pass them in lowercase.")
40-
# Else, error out at the check_in_list stage.
41-
return s_low
42-
43-
4427
class JoinStyle(str, _AutoStringNameEnum):
4528
"""
4629
Define how the connection between two line segments is drawn.
@@ -100,10 +83,6 @@ class JoinStyle(str, _AutoStringNameEnum):
10083
round = auto()
10184
bevel = auto()
10285

103-
def __init__(self, s):
104-
s = _deprecate_case_insensitive_join_cap(s)
105-
Enum.__init__(self)
106-
10786
@staticmethod
10887
def demo():
10988
"""Demonstrate how each JoinStyle looks for various join angles."""
@@ -173,10 +152,6 @@ class CapStyle(str, _AutoStringNameEnum):
173152
projecting = 'projecting'
174153
round = 'round'
175154

176-
def __init__(self, s):
177-
s = _deprecate_case_insensitive_join_cap(s)
178-
Enum.__init__(self)
179-
180155
@staticmethod
181156
def demo():
182157
"""Demonstrate how each CapStyle looks for a thick line segment."""

lib/matplotlib/artist.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,7 @@ def update(self, props):
10411041
ret = []
10421042
with cbook._setattr_cm(self, eventson=False):
10431043
for k, v in props.items():
1044-
if k != k.lower():
1045-
_api.warn_deprecated(
1046-
"3.3", message="Case-insensitive properties were "
1047-
"deprecated in %(since)s and support will be removed "
1048-
"%(removal)s")
1049-
k = k.lower()
1050-
# White list attributes we want to be able to update through
1044+
# Allow attributes we want to be able to update through
10511045
# art.update, art.set, setp.
10521046
if k == "axes":
10531047
ret.append(setattr(self, k, v))

0 commit comments

Comments
 (0)