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

Commitf8bc395

Browse files
committed
Remove API deprecated in 3.1 (part 2)
1 parent0abeab1 commitf8bc395

File tree

21 files changed

+75
-982
lines changed

21 files changed

+75
-982
lines changed

‎doc/api/next_api_changes/removals.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Classes and methods
5151

5252
- ``sphinxext.plot_directive.plot_directive()``
5353
(use the class ``PlotDirective`` instead)
54+
- ``sphinxext.mathmpl.math_directive()``
55+
(use the class ``MathDirective`` instead)
5456

5557
- ``Artist.aname`` property (no replacement)
5658
- ``Axis.iter_ticks`` (no replacement)
@@ -68,3 +70,76 @@ Classes and methods
6870
- ``colorbar.ColorbarBase.get_clim`` (use ``ScalarMappable.get_clim`` instead)
6971
- ``colorbar.ColorbarBase.set_clim`` (use ``ScalarMappable.set_clim`` instead)
7072
- ``colorbar.ColorbarBase.set_norm`` (use ``ScalarMappable.set_norm`` instead)
73+
74+
- ``dates.seconds()`` (no replacement)
75+
- ``dates.minutes()`` (no replacement)
76+
- ``dates.hours()`` (no replacement)
77+
- ``dates.weeks()`` (no replacement)
78+
79+
- ``font_manager.OSXInstalledFonts()`` (no replacement)
80+
81+
- ``mlab.demean()`` (use ``mlab.detrend_mean()`` instead)
82+
- ``projections.process_projection_requirements()`` (no replacement)
83+
- ``path.get_paths_extents()``
84+
(use ``path.get_path_collection_extents()`` instead)
85+
86+
- ``docstring.Appender`` (no replacement)
87+
- ``docstring.dedent()`` (use ``inspect.getdoc()`` instead)
88+
- ``docstring.copy_dedent()``
89+
(use ``docstring.copy()`` and ``cbook.getdoc()`` instead)
90+
91+
- ``ticker.OldScalarFormatter.pprint_val()`` (no replacement)
92+
- ``ticker.ScalarFormatter.pprint_val()`` (no replacement)
93+
- ``ticker.LogFormatter.pprint_val()`` (no replacement)
94+
- ``ticker.decade_down()`` (no replacement)
95+
- ``ticker.decade_up()`` (no replacement)
96+
97+
- ``scale.LogTransformBase()`` (use ``scale.LogTransform()`` instead)
98+
- ``scale.InvertedLogTransformBase()`` (use ``scale.InvertedLogTransform()`` instead)
99+
- ``scale.Log10TransformBase()`` (use ``scale.LogTransform()`` instead)
100+
- ``scale.InvertedLog10TransformBase()`` (use ``scale.InvertedLogTransform()`` instead)
101+
- ``scale.Log2Transform()`` (use ``scale.LogTransform()`` instead)
102+
- ``scale.InvertedLog2Transform()`` (use ``scale.InvertedLogTransform()`` instead)
103+
- ``scale.NaturalLogTransform()`` (use ``scale.LogTransform()`` instead)
104+
- ``scale.InvertedNaturalLogTransform()`` (use ``scale.InvertedLogTransform()`` instead)
105+
106+
- ``spines.Spine.is_frame_like()`` (no replacement)
107+
- ``text.is_math_text()`` (no replacement)
108+
- ``text.TextWithDash()`` (use ``text.Annotation`` instead)
109+
- ``textpath.TextPath.is_math_text()`` (no replacement)
110+
- ``textpath.TextPath.text_get_vertices_codes()``
111+
(use ``textpath.text_to_path.get_text_path()`` instead)
112+
113+
- ``widgets.SpanSelector.buttonDown`` property (no replacement)
114+
115+
- ``mplot3d.proj3d.line2d()`` (no replacement)
116+
- ``mplot3d.proj3d.line2d_dist()`` (no replacement)
117+
- ``mplot3d.proj3d.line2d_seg_dist()`` (no replacement)
118+
- ``mplot3d.proj3d.mod()`` (use `numpy.linalg.norm`` instead)
119+
- ``mplot3d.proj3d.proj_transform_vec()`` (no replacement)
120+
- ``mplot3d.proj3d.proj_transform_vec_clip()`` (no replacement)
121+
- ``mplot3d.proj3d.vec_pad_ones()`` (no replacement)
122+
- ``mplot3d.proj3d.proj_trans_clip_points()`` (no replacement)
123+
124+
- ``mplot3d.art3d.norm_angle()`` (no replacement)
125+
- ``mplot3d.art3d.norm_text_angle()`` (no replacement)
126+
- ``mplot3d.art3d.path_to_3d_segment()`` (no replacement)
127+
- ``mplot3d.art3d.paths_to_3d_segments()`` (no replacement)
128+
- ``mplot3d.art3d.path_to_3d_segment_with_codes()`` (no replacement)
129+
- ``mplot3d.art3d.paths_to_3d_segments_with_codes()`` (no replacement)
130+
- ``mplot3d.art3d.get_patch_verts()`` (no replacement)
131+
- ``mplot3d.art3d.get_colors()`` (no replacement)
132+
- ``mplot3d.art3d.zalpha()`` (no replacement)
133+
134+
- ``mplot3d.axis3d.get_flip_min_max()`` (no replacement)
135+
- ``mplot3d.axis3d.Axis.get_tick_positions()`` (no replacement)
136+
137+
- ``axisartist.axis_artist.UnimplementedException`` (no replacement)
138+
- ``axisartist.axislines.SimpleChainedObjects`` (no replacement)
139+
- ``axisartist.axislines.Axes.AxisDict`` (no replacement)
140+
141+
- ``testing.decorators.switch_backend()`` (use ``pytest.mark.backend`` instead)
142+
143+
Others
144+
~~~~~~
145+
- The math text command ``\stackrel`` is removed. Use ``\genfrac`` instead.

‎lib/matplotlib/dates.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,38 +1835,6 @@ def date_ticker_factory(span, tz=None, numticks=5):
18351835
returnlocator,formatter
18361836

18371837

1838-
@cbook.deprecated("3.1")
1839-
defseconds(s):
1840-
"""
1841-
Return seconds as days.
1842-
"""
1843-
returns/SEC_PER_DAY
1844-
1845-
1846-
@cbook.deprecated("3.1")
1847-
defminutes(m):
1848-
"""
1849-
Return minutes as days.
1850-
"""
1851-
returnm/MINUTES_PER_DAY
1852-
1853-
1854-
@cbook.deprecated("3.1")
1855-
defhours(h):
1856-
"""
1857-
Return hours as days.
1858-
"""
1859-
returnh/HOURS_PER_DAY
1860-
1861-
1862-
@cbook.deprecated("3.1")
1863-
defweeks(w):
1864-
"""
1865-
Return weeks as days.
1866-
"""
1867-
returnw*DAYS_PER_WEEK
1868-
1869-
18701838
classDateConverter(units.ConversionInterface):
18711839
"""
18721840
Converter for `datetime.date` and `datetime.datetime` data, or for

‎lib/matplotlib/docstring.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -59,43 +59,6 @@ def from_params(cls, params):
5959
returnresult
6060

6161

62-
@cbook.deprecated("3.1")
63-
classAppender:
64-
r"""
65-
A function decorator that will append an addendum to the docstring
66-
of the target function.
67-
68-
This decorator should be robust even if func.__doc__ is None
69-
(for example, if -OO was passed to the interpreter).
70-
71-
Usage: construct a docstring.Appender with a string to be joined to
72-
the original docstring. An optional 'join' parameter may be supplied
73-
which will be used to join the docstring and addendum. e.g.
74-
75-
add_copyright = Appender("Copyright (c) 2009", join='\n')
76-
77-
@add_copyright
78-
def my_dog(has='fleas'):
79-
"This docstring will have a copyright below"
80-
pass
81-
"""
82-
def__init__(self,addendum,join=''):
83-
self.addendum=addendum
84-
self.join=join
85-
86-
def__call__(self,func):
87-
docitems= [func.__doc__,self.addendum]
88-
func.__doc__=func.__doc__andself.join.join(docitems)
89-
returnfunc
90-
91-
92-
@cbook.deprecated("3.1",alternative="inspect.getdoc()")
93-
defdedent(func):
94-
"Dedent a docstring (if present)"
95-
func.__doc__=func.__doc__andcbook.dedent(func.__doc__)
96-
returnfunc
97-
98-
9962
defcopy(source):
10063
"Copy a docstring from another source function (if present)"
10164
defdo_copy(target):
@@ -114,14 +77,3 @@ def dedent_interpd(func):
11477
"""Dedent *func*'s docstring, then interpolate it with ``interpd``."""
11578
func.__doc__=inspect.getdoc(func)
11679
returninterpd(func)
117-
118-
119-
@cbook.deprecated("3.1",alternative="docstring.copy() and cbook.dedent()")
120-
defcopy_dedent(source):
121-
"""A decorator that will copy the docstring from the source and
122-
then dedent it"""
123-
# note the following is ugly because "Python is not a functional
124-
# language" - GVR. Perhaps one day, functools.compose will exist.
125-
# or perhaps not.
126-
# http://mail.python.org/pipermail/patches/2007-February/021687.html
127-
returnlambdatarget:dedent(copy(source)(target))

‎lib/matplotlib/font_manager.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,6 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
253253
return [str(path)forpathinitemsifpath.suffix.lower()infontext]
254254

255255

256-
@cbook.deprecated("3.1")
257-
defOSXInstalledFonts(directories=None,fontext='ttf'):
258-
"""Get list of font files on OS X."""
259-
ifdirectoriesisNone:
260-
directories=OSXFontDirectories
261-
return [path
262-
fordirectoryindirectories
263-
forpathinlist_fonts(directory,get_fontext_synonyms(fontext))]
264-
265-
266256
@lru_cache()
267257
def_call_fc_list():
268258
"""Cache and list the font filenames known to `fc-list`.

‎lib/matplotlib/mathtext.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,16 +3169,6 @@ def dfrac(self, s, loc, toks):
31693169
returnself._genfrac('','',thickness,
31703170
self._math_style_dict['displaystyle'],num,den)
31713171

3172-
@cbook.deprecated("3.1",obj_type="mathtext command",
3173-
alternative=r"\genfrac")
3174-
defstackrel(self,s,loc,toks):
3175-
assertlen(toks)==1
3176-
assertlen(toks[0])==2
3177-
num,den=toks[0]
3178-
3179-
returnself._genfrac('','',0.0,
3180-
self._math_style_dict['textstyle'],num,den)
3181-
31823172
defbinom(self,s,loc,toks):
31833173
assertlen(toks)==1
31843174
assertlen(toks[0])==2

‎lib/matplotlib/mlab.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -190,28 +190,6 @@ def detrend(x, key=None, axis=None):
190190
f"'constant', 'mean', 'linear', or a function")
191191

192192

193-
@cbook.deprecated("3.1",alternative="detrend_mean")
194-
defdemean(x,axis=0):
195-
'''
196-
Return x minus its mean along the specified axis.
197-
198-
Parameters
199-
----------
200-
x : array or sequence
201-
Array or sequence containing the data
202-
Can have any dimensionality
203-
204-
axis : integer
205-
The axis along which to take the mean. See numpy.mean for a
206-
description of this argument.
207-
208-
See Also
209-
--------
210-
detrend_mean : Same as `demean` except for the default *axis*.
211-
'''
212-
returndetrend_mean(x,axis=axis)
213-
214-
215193
defdetrend_mean(x,axis=None):
216194
'''
217195
Return x minus the mean(x).

‎lib/matplotlib/path.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -989,23 +989,3 @@ def get_path_collection_extents(
989989
returnBbox.from_extents(*_path.get_path_collection_extents(
990990
master_transform,paths,np.atleast_3d(transforms),
991991
offsets,offset_transform))
992-
993-
994-
@cbook.deprecated("3.1",alternative="get_paths_collection_extents")
995-
defget_paths_extents(paths,transforms=[]):
996-
"""
997-
Given a sequence of :class:`Path` objects and optional
998-
:class:`~matplotlib.transforms.Transform` objects, returns the
999-
bounding box that encapsulates all of them.
1000-
1001-
*paths* is a sequence of :class:`Path` instances.
1002-
1003-
*transforms* is an optional sequence of
1004-
:class:`~matplotlib.transforms.Affine2D` instances to apply to
1005-
each path.
1006-
"""
1007-
from .transformsimportBbox,Affine2D
1008-
iflen(paths)==0:
1009-
raiseValueError("No paths provided")
1010-
returnBbox.from_extents(*_path.get_path_collection_extents(
1011-
Affine2D(),paths,transforms, [],Affine2D()))

‎lib/matplotlib/projections/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,5 @@ def get_projection_class(projection=None):
5656
raiseValueError("Unknown projection %r"%projection)
5757

5858

59-
@cbook.deprecated("3.1")
60-
defprocess_projection_requirements(figure,*args,**kwargs):
61-
returnfigure._process_projection_requirements(*args,**kwargs)
62-
63-
6459
get_projection_names=projection_registry.get_projection_names
6560
docstring.interpd.update(projection_names=get_projection_names())

‎lib/matplotlib/scale.py

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -200,81 +200,6 @@ def set_default_locators_and_formatters(self, axis):
200200
axis.set_minor_locator(NullLocator())
201201

202202

203-
@cbook.deprecated("3.1",alternative="LogTransform")
204-
classLogTransformBase(Transform):
205-
input_dims=output_dims=1
206-
207-
def__init__(self,nonpos='clip'):
208-
Transform.__init__(self)
209-
self._clip= {"clip":True,"mask":False}[nonpos]
210-
211-
deftransform_non_affine(self,a):
212-
returnLogTransform.transform_non_affine(self,a)
213-
214-
def__str__(self):
215-
return"{}({!r})".format(
216-
type(self).__name__,"clip"ifself._clipelse"mask")
217-
218-
219-
@cbook.deprecated("3.1",alternative="InvertedLogTransform")
220-
classInvertedLogTransformBase(Transform):
221-
input_dims=output_dims=1
222-
223-
deftransform_non_affine(self,a):
224-
returnma.power(self.base,a)
225-
226-
def__str__(self):
227-
return"{}()".format(type(self).__name__)
228-
229-
230-
@cbook.deprecated("3.1",alternative="LogTransform")
231-
classLog10Transform(LogTransformBase):
232-
base=10.0
233-
234-
definverted(self):
235-
returnInvertedLog10Transform()
236-
237-
238-
@cbook.deprecated("3.1",alternative="InvertedLogTransform")
239-
classInvertedLog10Transform(InvertedLogTransformBase):
240-
base=10.0
241-
242-
definverted(self):
243-
returnLog10Transform()
244-
245-
246-
@cbook.deprecated("3.1",alternative="LogTransform")
247-
classLog2Transform(LogTransformBase):
248-
base=2.0
249-
250-
definverted(self):
251-
returnInvertedLog2Transform()
252-
253-
254-
@cbook.deprecated("3.1",alternative="InvertedLogTransform")
255-
classInvertedLog2Transform(InvertedLogTransformBase):
256-
base=2.0
257-
258-
definverted(self):
259-
returnLog2Transform()
260-
261-
262-
@cbook.deprecated("3.1",alternative="LogTransform")
263-
classNaturalLogTransform(LogTransformBase):
264-
base=np.e
265-
266-
definverted(self):
267-
returnInvertedNaturalLogTransform()
268-
269-
270-
@cbook.deprecated("3.1",alternative="InvertedLogTransform")
271-
classInvertedNaturalLogTransform(InvertedLogTransformBase):
272-
base=np.e
273-
274-
definverted(self):
275-
returnNaturalLogTransform()
276-
277-
278203
classLogTransform(Transform):
279204
input_dims=output_dims=1
280205

‎lib/matplotlib/sphinxext/mathmpl.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ def math_role(role, rawtext, text, lineno, inliner,
3131
math_role.options= {'fontset':fontset_choice}
3232

3333

34-
@cbook.deprecated("3.1",alternative="MathDirective")
35-
defmath_directive(name,arguments,options,content,lineno,
36-
content_offset,block_text,state,state_machine):
37-
latex=''.join(content)
38-
node=latex_math(block_text)
39-
node['latex']=latex
40-
node['fontset']=options.get('fontset','cm')
41-
return [node]
42-
43-
4434
classMathDirective(Directive):
4535
has_content=True
4636
required_arguments=0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp