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

Commit6151fbd

Browse files
anntzertacaswell
authored andcommitted
Expire deprecation of mathcircled.
Use stubs in font_test_specs to avoid having to re-name all of thelater tests.
1 parentc449ee4 commit6151fbd

File tree

48 files changed

+33
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+33
-27
lines changed

‎doc/api/next_api_changes/removals.rst

Lines changed: 5 additions & 0 deletions

‎lib/matplotlib/mathtext.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,8 +2299,7 @@ class Parser:
22992299

23002300
_dropsub_symbols=set(r'''\int \oint'''.split())
23012301

2302-
_fontnames=set(
2303-
"rm cal it tt sf bf default bb frak circled scr regular".split())
2302+
_fontnames=set("rm cal it tt sf bf default bb frak scr regular".split())
23042303

23052304
_function_names=set("""
23062305
arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim
@@ -2618,11 +2617,6 @@ def font(self):
26182617

26192618
@font.setter
26202619
deffont(self,name):
2621-
ifname=="circled":
2622-
cbook.warn_deprecated(
2623-
"3.1",name="\\mathcircled",obj_type="mathtext command",
2624-
alternative="unicode characters (e.g. '\\N{CIRCLED LATIN "
2625-
"CAPITAL LETTER A}' or '\\u24b6')")
26262620
ifnamein ('rm','it','bf'):
26272621
self.font_class=name
26282622
self._font=name
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

‎lib/matplotlib/tests/test_mathtext.py

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,19 @@
119119
"\\phi\\chi\\psi")
120120
all= [digits,uppercase,lowercase,uppergreek,lowergreek]
121121

122+
# Use stubs to reserve space if tests are removed
123+
# stub should be of the form (None, N) where is the number of
124+
# strings that used to be tested
125+
# Add new tests at the end.
122126
font_test_specs= [
123127
([],all),
124128
(['mathrm'],all),
125129
(['mathbf'],all),
126130
(['mathit'],all),
127131
(['mathtt'], [digits,uppercase,lowercase]),
128-
(['mathcircled'], [digits,uppercase,lowercase]),
129-
(['mathrm','mathcircled'], [digits,uppercase,lowercase]),
130-
(['mathbf','mathcircled'], [digits,uppercase,lowercase]),
132+
(None,3),
133+
(None,3),
134+
(None,3),
131135
(['mathbb'], [digits,uppercase,lowercase,
132136
r'\Gamma \Pi \Sigma \gamma \pi']),
133137
(['mathrm','mathbb'], [digits,uppercase,lowercase,
@@ -145,27 +149,29 @@
145149

146150
font_tests= []
147151
forfonts,charsinfont_test_specs:
148-
wrapper=''.join([
149-
' '.join(fonts),
150-
' $',
151-
*(r'\%s{'%fontforfontinfonts),
152-
'%s',
153-
*('}'forfontinfonts),
154-
'$',
155-
])
156-
forsetinchars:
157-
font_tests.append(wrapper%set)
152+
iffontsisNone:
153+
font_tests.extend([None]*chars)
154+
else:
155+
wrapper=''.join([
156+
' '.join(fonts),
157+
' $',
158+
*(r'\%s{'%fontforfontinfonts),
159+
'%s',
160+
*('}'forfontinfonts),
161+
'$',
162+
])
163+
forsetinchars:
164+
font_tests.append(wrapper%set)
165+
166+
font_tests=list(filter(lambdax:x[1]isnotNone,enumerate(font_tests)))
158167

159168

160169
@pytest.fixture
161170
defbaseline_images(request,fontset,index):
162171
return ['%s_%s_%02d'% (request.param,fontset,index)]
163172

164173

165-
# In the following two tests, use recwarn to suppress warnings regarding the
166-
# deprecation of \stackrel and \mathcircled.
167-
168-
174+
# recwarn suppresses warnings regarding the deprecation of \stackrel.
169175
@pytest.mark.parametrize('index, test',enumerate(math_tests),
170176
ids=[str(index)forindexinrange(len(math_tests))])
171177
@pytest.mark.parametrize('fontset',
@@ -180,14 +186,15 @@ def test_mathtext_rendering(baseline_images, fontset, index, test, recwarn):
180186
horizontalalignment='center',verticalalignment='center')
181187

182188

183-
@pytest.mark.parametrize('index, test',enumerate(font_tests),
184-
ids=[str(index)forindexinrange(len(font_tests))])
189+
190+
@pytest.mark.parametrize('index, test',font_tests,
191+
ids=[str(index)forindex,_infont_tests])
185192
@pytest.mark.parametrize('fontset',
186193
['cm','stix','stixsans','dejavusans',
187194
'dejavuserif'])
188195
@pytest.mark.parametrize('baseline_images', ['mathfont'],indirect=True)
189196
@image_comparison(baseline_images=None,extensions=['png'])
190-
deftest_mathfont_rendering(baseline_images,fontset,index,test,recwarn):
197+
deftest_mathfont_rendering(baseline_images,fontset,index,test):
191198
matplotlib.rcParams['mathtext.fontset']=fontset
192199
fig=plt.figure(figsize=(5.25,0.75))
193200
fig.text(0.5,0.5,test,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp