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

Commit3fc0448

Browse files
authored
Merge pull request#20944 from anntzer/mtd
Switch documented deprecations in mathtext by `__getattr__` deprecations
2 parents47077d1 +d1689df commit3fc0448

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

‎lib/matplotlib/mathtext.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,27 @@
2424
importnumpyasnp
2525
fromPILimportImage
2626

27-
frommatplotlibimport_api,colorsasmcolors,rcParams,_mathtext
27+
frommatplotlibimport (
28+
_api,colorsasmcolors,rcParams,_mathtext,_mathtext_data)
2829
frommatplotlib.ft2fontimportFT2Image,LOAD_NO_HINTING
2930
frommatplotlib.font_managerimportFontProperties
30-
# Backcompat imports, all are deprecated as of 3.4.
31-
frommatplotlib._mathtextimport (# noqa: F401
32-
SHRINK_FACTOR,GROW_FACTOR,NUM_SIZE_LEVELS)
33-
frommatplotlib._mathtext_dataimport (# noqa: F401
34-
latex_to_bakoma,latex_to_cmex,latex_to_standard,stix_virtual_fonts,
35-
tex2uni)
3631

3732
_log=logging.getLogger(__name__)
3833

3934

35+
@_api.caching_module_getattr
36+
class__getattr__:
37+
locals().update({
38+
name:_api.deprecated("3.4")(
39+
property(lambdaself,_mod=mod,_name=name:getattr(_mod,_name)))
40+
formod,namesin [
41+
(_mathtext, ["SHRINK_FACTOR","GROW_FACTOR","NUM_SIZE_LEVELS"]),
42+
(_mathtext_data, [
43+
"latex_to_bakoma","latex_to_cmex","latex_to_standard",
44+
"stix_virtual_fonts","tex2uni"])]
45+
fornameinnames})
46+
47+
4048
get_unicode_index=_mathtext.get_unicode_index
4149
get_unicode_index.__module__=__name__
4250

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp