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

Expire deprecation of \mathcircled#16204

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

Merged
tacaswell merged 1 commit intomatplotlib:masterfromanntzer:unmathcircled
Feb 10, 2020
Merged
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
2 changes: 2 additions & 0 deletionsdoc/api/next_api_changes/removals.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,3 +140,5 @@ mathtext
~~~~~~~~
- The ``\stackrel`` command (which behaved differently from its LaTeX version)
has been removed. Use ``\genfrac`` instead.
- The ``\mathcircled`` command has been removed. Directly use Unicode
characters, such as ``'\N{CIRCLED LATIN CAPITAL LETTER A}``, instead.
24 changes: 0 additions & 24 deletionslib/matplotlib/_mathtext_data.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2406,30 +2406,6 @@
[
(0x0041, 0x005a, 'it', 0xe22d), # A-Z
],
'circled':
{
'rm':
[
(0x0030, 0x0030, 'rm', 0x24ea), # 0
(0x0031, 0x0039, 'rm', 0x2460), # 1-9
(0x0041, 0x005a, 'rm', 0x24b6), # A-Z
(0x0061, 0x007a, 'rm', 0x24d0) # a-z
],
'it':
[
(0x0030, 0x0030, 'rm', 0x24ea), # 0
(0x0031, 0x0039, 'rm', 0x2460), # 1-9
(0x0041, 0x005a, 'it', 0x24b6), # A-Z
(0x0061, 0x007a, 'it', 0x24d0) # a-z
],
'bf':
[
(0x0030, 0x0030, 'bf', 0x24ea), # 0
(0x0031, 0x0039, 'bf', 0x2460), # 1-9
(0x0041, 0x005a, 'bf', 0x24b6), # A-Z
(0x0061, 0x007a, 'bf', 0x24d0) # a-z
],
},
'frak':
{
'rm':
Expand Down
8 changes: 1 addition & 7 deletionslib/matplotlib/mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2299,8 +2299,7 @@ class Parser:

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

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

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

@font.setter
def font(self, name):
if name == "circled":
cbook.warn_deprecated(
"3.1", name="\\mathcircled", obj_type="mathtext command",
alternative="unicode characters (e.g. '\\N{CIRCLED LATIN "
"CAPITAL LETTER A}' or '\\u24b6')")
if name in ('rm', 'it', 'bf'):
self.font_class = name
self._font = name
Expand Down
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
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.
Diff not rendered.
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
View file
Open in desktop
Diff not rendered.
46 changes: 26 additions & 20 deletionslib/matplotlib/tests/test_mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,15 +120,19 @@
"\\phi \\chi \\psi")
all = [digits, uppercase, lowercase, uppergreek, lowergreek]

# Use stubs to reserve space if tests are removed
# stub should be of the form (None, N) where is the number of
# strings that used to be tested
# Add new tests at the end.
font_test_specs = [
([], all),
(['mathrm'], all),
(['mathbf'], all),
(['mathit'], all),
(['mathtt'], [digits, uppercase, lowercase]),
(['mathcircled'], [digits, uppercase, lowercase]),
(['mathrm', 'mathcircled'], [digits, uppercase, lowercase]),
(['mathbf', 'mathcircled'], [digits, uppercase, lowercase]),
(None, 3),
(None, 3),
(None, 3),
(['mathbb'], [digits, uppercase, lowercase,
r'\Gamma \Pi \Sigma \gamma \pi']),
(['mathrm', 'mathbb'], [digits, uppercase, lowercase,
Expand All@@ -146,27 +150,29 @@

font_tests = []
for fonts, chars in font_test_specs:
wrapper = ''.join([
' '.join(fonts),
' $',
*(r'\%s{' % font for font in fonts),
'%s',
*('}' for font in fonts),
'$',
])
for set in chars:
font_tests.append(wrapper % set)
if fonts is None:
font_tests.extend([None] * chars)
else:
wrapper = ''.join([
' '.join(fonts),
' $',
*(r'\%s{' % font for font in fonts),
'%s',
*('}' for font in fonts),
'$',
])
for set in chars:
font_tests.append(wrapper % set)

font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests)))


@pytest.fixture
def baseline_images(request, fontset, index):
return ['%s_%s_%02d' % (request.param, fontset, index)]


# In the following two tests, use recwarn to suppress warnings regarding the
# deprecation of \stackrel and \mathcircled.


# recwarn suppresses warnings regarding the deprecation of \stackrel.
@pytest.mark.parametrize('index, test', enumerate(math_tests),
ids=[str(index) for index in range(len(math_tests))])
@pytest.mark.parametrize('fontset',
Expand All@@ -181,14 +187,14 @@ def test_mathtext_rendering(baseline_images, fontset, index, test, recwarn):
horizontalalignment='center', verticalalignment='center')


@pytest.mark.parametrize('index, test',enumerate(font_tests),
ids=[str(index) for indexinrange(len(font_tests))])
@pytest.mark.parametrize('index, test', font_tests,
ids=[str(index) for index, _in font_tests])
@pytest.mark.parametrize('fontset',
['cm', 'stix', 'stixsans', 'dejavusans',
'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
@image_comparison(baseline_images=None, extensions=['png'])
def test_mathfont_rendering(baseline_images, fontset, index, test, recwarn):
def test_mathfont_rendering(baseline_images, fontset, index, test):
matplotlib.rcParams['mathtext.fontset'] = fontset
fig = plt.figure(figsize=(5.25, 0.75))
fig.text(0.5, 0.5, test,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp