Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16c95a4

Browse files
committed
Remove API deprecated in 3.1 (part 2)
1 parent 59acd5c commit 16c95a4

26 files changed

+110
-643
lines changed

doc/api/next_api_changes/removals.rst

Lines changed: 76 additions & 1 deletion
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)
@@ -71,7 +73,80 @@ Classes and methods
7173

7274
- ``text.TextWithDash`` (use ``text.Annotation`` instead)
7375

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

doc/api/prev_api_changes/api_changes_1.2.x.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Changes in 1.2.x
4141

4242
* Use of ``matplotlib.projections.projection_factory`` is now deprecated
4343
in favour of axes class identification using
44-
:func:`~matplotlib.projections.process_projection_requirements` followed by
44+
``matplotlib.projections.process_projection_requirements`` followed by
4545
direct axes class invocation (at the time of writing, functions which do this
4646
are: :meth:`~matplotlib.figure.Figure.add_axes`,
4747
:meth:`~matplotlib.figure.Figure.add_subplot` and

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ required methods.
824824

825825
This has not been used in the codebase since its addition in 2009.
826826

827-
- `.axis3d.Axis.get_tick_positions`
827+
- ``axis3d.Axis.get_tick_positions``
828828

829829
This has never been used internally, there is no equivalent method exists on
830830
the 2D Axis classes, and despite the similar name, it has a completely
@@ -863,7 +863,7 @@ Use the standard library's docstring manipulation tools instead, such as
863863
These are considered internal and will be removed from the public API in a
864864
future version.
865865

866-
- `.projections.process_projection_requirements`
866+
- ``projections.process_projection_requirements``
867867

868868
- ``backend_ps.PsBackendHelper``
869869
- ``backend_ps.ps_backend_helper``,
@@ -883,26 +883,26 @@ of `.mpl_toolkits.mplot3d` are deprecated,
883883

884884
**mpl_toolkits.mplot3d.art3d**
885885

886-
- :func:`mpl_toolkits.mplot3d.art3d.norm_angle`
887-
- :func:`mpl_toolkits.mplot3d.art3d.norm_text_angle`
888-
- :func:`mpl_toolkits.mplot3d.art3d.path_to_3d_segment`
889-
- :func:`mpl_toolkits.mplot3d.art3d.paths_to_3d_segments`
890-
- :func:`mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes`
891-
- :func:`mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes`
892-
- :func:`mpl_toolkits.mplot3d.art3d.get_patch_verts`
893-
- :func:`mpl_toolkits.mplot3d.art3d.get_colors`
894-
- :func:`mpl_toolkits.mplot3d.art3d.zalpha`
886+
- ``mpl_toolkits.mplot3d.art3d.norm_angle``
887+
- ``mpl_toolkits.mplot3d.art3d.norm_text_angle``
888+
- ``mpl_toolkits.mplot3d.art3d.path_to_3d_segment``
889+
- ``mpl_toolkits.mplot3d.art3d.paths_to_3d_segments``
890+
- ``mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes``
891+
- ``mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes``
892+
- ``mpl_toolkits.mplot3d.art3d.get_patch_verts``
893+
- ``mpl_toolkits.mplot3d.art3d.get_colors``
894+
- ``mpl_toolkits.mplot3d.art3d.zalpha``
895895

896896
**mpl_toolkits.mplot3d.proj3d**
897897

898-
- :func:`mpl_toolkits.mplot3d.proj3d.line2d`
899-
- :func:`mpl_toolkits.mplot3d.proj3d.line2d_dist`
900-
- :func:`mpl_toolkits.mplot3d.proj3d.line2d_seg_dist`
901-
- :func:`mpl_toolkits.mplot3d.proj3d.mod`
902-
- :func:`mpl_toolkits.mplot3d.proj3d.proj_transform_vec`
903-
- :func:`mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip`
904-
- :func:`mpl_toolkits.mplot3d.proj3d.vec_pad_ones`
905-
- :func:`mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points`
898+
- ``mpl_toolkits.mplot3d.proj3d.line2d``
899+
- ``mpl_toolkits.mplot3d.proj3d.line2d_dist``
900+
- ``mpl_toolkits.mplot3d.proj3d.line2d_seg_dist``
901+
- ``mpl_toolkits.mplot3d.proj3d.mod``
902+
- ``mpl_toolkits.mplot3d.proj3d.proj_transform_vec``
903+
- ``mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip``
904+
- ``mpl_toolkits.mplot3d.proj3d.vec_pad_ones``
905+
- ``mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points``
906906

907907
If your project relies on these functions, consider vendoring them.
908908

@@ -944,7 +944,7 @@ instead.
944944
Testing
945945
~~~~~~~
946946

947-
- `matplotlib.testing.decorators.switch_backend` decorator
947+
- ``matplotlib.testing.decorators.switch_backend`` decorator
948948

949949
Test functions should use `pytest.mark.backend(...)`, and the mark will be
950950
picked up by the `matplotlib.testing.conftest.mpl_test_settings` fixture.
@@ -971,7 +971,7 @@ GUI / backend details
971971
This is unused and only relevant to the now removed wx "idling" code (note that
972972
as it is a module-level global, no deprecation warning is emitted when
973973
accessing it).
974-
- `.mlab.demean`
974+
- ``mlab.demean``
975975
- ``backend_gtk3cairo.FigureCanvasGTK3Cairo``,
976976
- ``backend_wx.debug_on_error``, ``backend_wx.fake_stderr``,
977977
``backend_wx.raise_msg_to_str``, ``backend_wx.MenuButtonWx``,
@@ -1015,7 +1015,7 @@ formatter classes.
10151015
Path tools
10161016
~~~~~~~~~~
10171017

1018-
- `.path.get_paths_extents`
1018+
- ``path.get_paths_extents``
10191019

10201020
Use `~.path.get_path_collection_extents` instead.
10211021

@@ -1031,8 +1031,8 @@ Text
10311031
~~~~
10321032

10331033
- ``text.TextWithDash``
1034-
- `.Text.is_math_text`
1035-
- `.TextPath.is_math_text`
1034+
- ``Text.is_math_text``
1035+
- ``TextPath.is_math_text``
10361036
- `.TextPath.text_get_vertices_codes` (As an alternative, construct a new ``TextPath`` object.)
10371037

10381038
Unused attributes

doc/api/toolkits/mplot3d.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,16 @@ Art3D Utility Functions
7979
:toctree: ../_as_gen
8080
:template: autosummary.rst
8181

82-
art3d.get_colors
8382
art3d.get_dir_vector
84-
art3d.get_patch_verts
8583
art3d.juggle_axes
8684
art3d.line_2d_to_3d
8785
art3d.line_collection_2d_to_3d
88-
art3d.norm_angle
89-
art3d.norm_text_angle
9086
art3d.patch_2d_to_3d
9187
art3d.patch_collection_2d_to_3d
92-
art3d.path_to_3d_segment
93-
art3d.path_to_3d_segment_with_codes
9488
art3d.pathpatch_2d_to_3d
95-
art3d.paths_to_3d_segments
96-
art3d.paths_to_3d_segments_with_codes
9789
art3d.poly_collection_2d_to_3d
9890
art3d.rotate_axes
9991
art3d.text_2d_to_3d
100-
art3d.zalpha
10192

10293
.. _toolkit_mplot3d-projapi:
10394

@@ -109,20 +100,12 @@ Art3D Utility Functions
109100
:template: autosummary.rst
110101

111102
proj3d.inv_transform
112-
proj3d.line2d
113-
proj3d.line2d_dist
114-
proj3d.line2d_seg_dist
115-
proj3d.mod
116103
proj3d.persp_transformation
117104
proj3d.proj_points
118-
proj3d.proj_trans_clip_points
119105
proj3d.proj_trans_points
120106
proj3d.proj_transform
121107
proj3d.proj_transform_clip
122-
proj3d.proj_transform_vec
123-
proj3d.proj_transform_vec_clip
124108
proj3d.rot_x
125109
proj3d.transform
126-
proj3d.vec_pad_ones
127110
proj3d.view_transformation
128111
proj3d.world_transformation

lib/matplotlib/dates.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@
162162
'SecondLocator', 'MicrosecondLocator',
163163
'rrule', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
164164
'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY',
165-
'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta',
166-
'seconds', 'minutes', 'hours', 'weeks')
165+
'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta')
167166

168167

169168
_log = logging.getLogger(__name__)
@@ -1836,38 +1835,6 @@ def date_ticker_factory(span, tz=None, numticks=5):
18361835
return locator, formatter
18371836

18381837

1839-
@cbook.deprecated("3.1")
1840-
def seconds(s):
1841-
"""
1842-
Return seconds as days.
1843-
"""
1844-
return s / SEC_PER_DAY
1845-
1846-
1847-
@cbook.deprecated("3.1")
1848-
def minutes(m):
1849-
"""
1850-
Return minutes as days.
1851-
"""
1852-
return m / MINUTES_PER_DAY
1853-
1854-
1855-
@cbook.deprecated("3.1")
1856-
def hours(h):
1857-
"""
1858-
Return hours as days.
1859-
"""
1860-
return h / HOURS_PER_DAY
1861-
1862-
1863-
@cbook.deprecated("3.1")
1864-
def weeks(w):
1865-
"""
1866-
Return weeks as days.
1867-
"""
1868-
return w * DAYS_PER_WEEK
1869-
1870-
18711838
class DateConverter(units.ConversionInterface):
18721839
"""
18731840
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
return result
6060

6161

62-
@cbook.deprecated("3.1")
63-
class Appender:
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__ and self.join.join(docitems)
89-
return func
90-
91-
92-
@cbook.deprecated("3.1", alternative="inspect.getdoc()")
93-
def dedent(func):
94-
"Dedent a docstring (if present)"
95-
func.__doc__ = func.__doc__ and cbook.dedent(func.__doc__)
96-
return func
97-
98-
9962
def copy(source):
10063
"Copy a docstring from another source function (if present)"
10164
def do_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
return interpd(func)
117-
118-
119-
@cbook.deprecated("3.1", alternative="docstring.copy() and cbook.dedent()")
120-
def copy_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-
return lambda target: dedent(copy(source)(target))

lib/matplotlib/figure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from matplotlib.gridspec import GridSpec
3333
import matplotlib.legend as mlegend
3434
from matplotlib.patches import Rectangle
35-
from matplotlib.projections import process_projection_requirements
3635
from matplotlib.text import Text
3736
from matplotlib.transforms import (Affine2D, Bbox, BboxTransformTo,
3837
TransformedBbox)

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) for path in items if path.suffix.lower() in fontext]
254254

255255

256-
@cbook.deprecated("3.1")
257-
def OSXInstalledFonts(directories=None, fontext='ttf'):
258-
"""Get list of font files on OS X."""
259-
if directories is None:
260-
directories = OSXFontDirectories
261-
return [path
262-
for directory in directories
263-
for path in list_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
return self._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-
def stackrel(self, s, loc, toks):
3175-
assert len(toks) == 1
3176-
assert len(toks[0]) == 2
3177-
num, den = toks[0]
3178-
3179-
return self._genfrac('', '', 0.0,
3180-
self._math_style_dict['textstyle'], num, den)
3181-
31823172
def binom(self, s, loc, toks):
31833173
assert len(toks) == 1
31843174
assert len(toks[0]) == 2

0 commit comments

Comments
 (0)