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

Skip to content

Commit b8fdef7

Browse files
committed
Remove miscellaneous deprecations.
1 parent 2e71fa1 commit b8fdef7

File tree

7 files changed

+16
-88
lines changed

7 files changed

+16
-88
lines changed

doc/api/figure_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Classes
1616
:template: autosummary.rst
1717
:nosignatures:
1818

19-
AxesStack
2019
Figure
2120
SubplotParams
2221

doc/api/next_api_changes/removals/18522-ES.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ Formatters) is no longer supported. Pass a factor equal to 1 instead.
2121

2222
Misc
2323
~~~~
24+
``matplotlib.get_home`` has been removed; use standard library instead.
25+
26+
``matplotlib.compare_versions`` has been removed; use comparison of
27+
``distutils.version.LooseVersion``\s instead.
28+
29+
``matplotlib.checkdep_ps_distiller`` has been removed.
30+
31+
``matplotlib.figure.AxesStack`` has been removed.
32+
2433
``BboxBase.is_unit`` has been removed; check the `.Bbox` extents if needed.
34+
35+
``Affine2DBase.matrix_from_values(...)`` has been removed; use (for example)
36+
``Affine2D.from_values(...).get_matrix()`` instead.
37+
38+
``style.core.is_style_file`` and ``style.core.iter_style_files`` have been
39+
removed.

doc/api/prev_api_changes/api_changes_2.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ a previous axes instance currently reuses the earlier instance. This
329329
behavior has been deprecated in Matplotlib 2.1. In a future version, a
330330
*new* instance will always be created and returned. Meanwhile, in such
331331
a situation, a deprecation warning is raised by
332-
:class:`~matplotlib.figure.AxesStack`.
332+
``matplotlib.figure.AxesStack``.
333333

334334
This warning can be suppressed, and the future behavior ensured, by passing
335335
a *unique* label to each axes instance. See the docstring of

lib/matplotlib/__init__.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,6 @@
135135
}"""
136136

137137

138-
@cbook.deprecated("3.2")
139-
def compare_versions(a, b):
140-
"""Return whether version *a* is greater than or equal to version *b*."""
141-
if isinstance(a, bytes):
142-
cbook.warn_deprecated(
143-
"3.0", message="compare_versions arguments should be strs.")
144-
a = a.decode('ascii')
145-
if isinstance(b, bytes):
146-
cbook.warn_deprecated(
147-
"3.0", message="compare_versions arguments should be strs.")
148-
b = b.decode('ascii')
149-
if a:
150-
return LooseVersion(a) >= LooseVersion(b)
151-
else:
152-
return False
153-
154-
155138
def _check_versions():
156139

157140
# Quickfix to ensure Microsoft Visual C++ redistributable
@@ -382,26 +365,6 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
382365
raise ValueError("Unknown executable: {!r}".format(name))
383366

384367

385-
@cbook.deprecated("3.2")
386-
def checkdep_ps_distiller(s):
387-
if not s:
388-
return False
389-
try:
390-
_get_executable_info("gs")
391-
except ExecutableNotFoundError:
392-
_log.warning(
393-
"Setting rcParams['ps.usedistiller'] requires ghostscript.")
394-
return False
395-
if s == "xpdf":
396-
try:
397-
_get_executable_info("pdftops")
398-
except ExecutableNotFoundError:
399-
_log.warning(
400-
"Setting rcParams['ps.usedistiller'] to 'xpdf' requires xpdf.")
401-
return False
402-
return s
403-
404-
405368
def checkdep_usetex(s):
406369
if not s:
407370
return False
@@ -421,20 +384,6 @@ def checkdep_usetex(s):
421384
return True
422385

423386

424-
@cbook.deprecated("3.2", alternative="os.path.expanduser('~')")
425-
@_logged_cached('$HOME=%s')
426-
def get_home():
427-
"""
428-
Return the user's home directory.
429-
430-
If the user's home directory cannot be found, return None.
431-
"""
432-
try:
433-
return str(Path.home())
434-
except Exception:
435-
return None
436-
437-
438387
def _get_xdg_config_dir():
439388
"""
440389
Return the XDG configuration directory, according to the XDG base

lib/matplotlib/figure.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ def __contains__(self, a):
152152
return a in self.as_list()
153153

154154

155-
@cbook.deprecated("3.2")
156-
class AxesStack(_AxesStack):
157-
pass
158-
159-
160155
class SubplotParams:
161156
"""
162157
A class to hold the parameters for a subplot.

lib/matplotlib/style/core.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ def _remove_blacklisted_style_params(d, warn=True):
5555
return o
5656

5757

58-
@cbook.deprecated("3.2")
59-
def is_style_file(filename):
60-
"""Return True if the filename looks like a style file."""
61-
return STYLE_FILE_PATTERN.match(filename) is not None
62-
63-
6458
def _apply_style(d, warn=True):
6559
mpl.rcParams.update(_remove_blacklisted_style_params(d, warn=warn))
6660

@@ -182,17 +176,6 @@ def update_user_library(library):
182176
return library
183177

184178

185-
@cbook.deprecated("3.2")
186-
def iter_style_files(style_dir):
187-
"""Yield file path and name of styles in the given directory."""
188-
for path in os.listdir(style_dir):
189-
filename = os.path.basename(path)
190-
if is_style_file(filename):
191-
match = STYLE_FILE_PATTERN.match(filename)
192-
path = os.path.abspath(os.path.join(style_dir, path))
193-
yield path, match.group(1)
194-
195-
196179
def read_style_directory(style_dir):
197180
"""Return dictionary of styles defined in *style_dir*."""
198181
styles = dict()

lib/matplotlib/transforms.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,19 +1773,6 @@ def to_values(self):
17731773
mtx = self.get_matrix()
17741774
return tuple(mtx[:2].swapaxes(0, 1).flat)
17751775

1776-
@staticmethod
1777-
@cbook.deprecated(
1778-
"3.2", alternative="Affine2D.from_values(...).get_matrix()")
1779-
def matrix_from_values(a, b, c, d, e, f):
1780-
"""
1781-
Create a new transformation matrix as a 3x3 numpy array of the form::
1782-
1783-
a c e
1784-
b d f
1785-
0 0 1
1786-
"""
1787-
return np.array([[a, c, e], [b, d, f], [0.0, 0.0, 1.0]], float)
1788-
17891776
def transform_affine(self, points):
17901777
mtx = self.get_matrix()
17911778
if isinstance(points, np.ma.MaskedArray):

0 commit comments

Comments
 (0)