8000 Remove miscellaneous deprecations from 3.5 · matplotlib/matplotlib@6b1dc5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b1dc5c

Browse files
committed
Remove miscellaneous deprecations from 3.5
1 parent 493d608 commit 6b1dc5c
8000

39 files changed

+110
-1005
lines changed

doc/api/blocking_input_api.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

doc/api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ Alphabetical list of modules:
105105
backend_tools_api.rst
106106
index_backend_api.rst
107107
bezier_api.rst
108-
blocking_input_api.rst
109108
category_api.rst
110109
cbook_api.rst
111110
cm_api.rst
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Miscellaneous removals
2+
~~~~~~~~~~~~~~~~~~~~~~
3+
4+
- ``is_url`` and ``URL_REGEX`` are removed. (They were previously defined in
5+
the toplevel :mod:`matplotlib` module.)
6+
- The ``ArrowStyle.beginarrow`` and ``ArrowStyle.endarrow`` attributes are
7+
removed; use the ``arrow`` attribute to define the desired heads and tails
8+
of the arrow.
9+
- ``backend_pgf.LatexManager.str_cache`` is removed.
10+
- ``backends.qt_compat.ETS`` and ``backends.qt_compat.QT_RC_MAJOR_VERSION`` are
11+
removed, with no replacement.
12+
- The ``blocking_input`` module is removed. Instead, use
13+
``canvas.start_event_loop()`` and ``canvas.stop_event_loop()`` while
14+
connecting event callbacks as needed.
15+
- ``cbook.report_memory`` is removed; use ``psutil.virtual_memory`` instead.
16+
- ``cm.LUTSIZE`` is removed. Use :rc:`image.lut` instead. This value only
17+
affects colormap quantization levels for default colormaps generated at
18+
module import time.
19+
- ``Colorbar.patch`` is removed; this attribute was not correctly updated
20+
anymore.
21+
- ``ContourLabeler.get_label_width`` is removed.
22+
- ``Dvi.baseline`` is removed (with no replacement).
23+
- The *format* parameter of ``dviread.find_tex_file`` is removed (with no
24+
replacement).
25+
- ``FancyArrowPatch.get_path_in_displaycoord`` and
26+
``ConnectionPath.get_path_in_displaycoord`` are removed. The path in
27+
display coordinates can still be obtained, as for other patches, using
28+
``patch.get_transform().transform_path(patch.get_path())``.
29+
- The ``font_manager.win32InstalledFonts`` and
30+
``font_manager.get_fontconfig_fonts`` helper functions are removed.
31+
- All parameters of ``imshow`` starting from *aspect* are keyword-only.
32+
- ``QuadMesh.convert_mesh_to_paths`` and ``QuadMesh.convert_mesh_to_triangles``
33+
are removed. ``QuadMesh.get_paths()`` can be used as an alternative for the
34+
former; there is no replacement for the latter.
35+
- ``ScalarMappable.callbacksSM`` is removed. Use
36+
``ScalarMappable.callbacks`` instead.
37+
- ``streamplot.get_integrator`` is removed.
38+
- ``style.core.STYLE_FILE_PATTERN``, ``style.core.load_base_library``, and
39+
``style.core.iter_user_libraries`` are removed.
40+
- ``SubplotParams.validate`` is removed. Use `.SubplotParams.update` to
41+
change `.SubplotParams` while always keeping it in a valid state.
42+
- The ``grey_arrayd``, ``font_family``, ``font_families``, and ``font_info``
43+
attributes of `.TexManager` are removed.
44+
- ``Text.get_prop_tup`` is removed with no replacements (because the `.Text`
45+
class cannot know whether a backend needs to update cache e.g. when the
46+
text's color changes).
47+
- ``Tick.apply_tickdir`` didn't actually update the tick markers on the
48+
existing Line2D objects used to draw the ticks and is removed; use
49+
`.Axis.set_tick_params` instead.
50+
- ``tight_layout.auto_adjust_subplotpars`` is removed.
51+
- The ``grid_info`` attribute of ``axisartist`` classes has been removed.
52+
- ``axes_grid1.axes_grid.CbarAxes`` and ``axisartist.axes_grid.CbarAxes`` are
53+
removed (they are now dynamically generated based on the owning axes
54+
class).
55+
- The ``axes_grid1.Divider.get_vsize_hsize`` and
56+
``axes_grid1.Grid.get_vsize_hsize`` methods are removed.
57+
- ``AxesDivider.append_axes(..., add_to_figure=False)`` is removed. Use
58+
``ax.remove()`` to remove the Axes from the figure if needed.
59+
- ``FixedAxisArtistHelper.change_tick_coord`` is removed with no
60+
replacement.
61+
- ``floating_axes.GridHelperCurveLinear.get_boundary`` is removed with no
62+
replacement.
63+
- ``ParasiteAxesBase.get_images_artists`` is removed.
64+
- The "units finalize" signal (previously emitted by Axis instances) is
65+
removed. Connect to "units" instead.
66+
- Passing formatting parameters positionally to ``stem()`` is no longer
67+
possible.
68+
- ``axisartist.clip_path`` is removed with no replacement.

doc/api/prev_api_changes/api_changes_0.98.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Changes for 0.98.0
1212
rather than custom callback handling. Any users of
1313
``matplotlib.cm.ScalarMappable.add_observer`` of the
1414
:class:`~matplotlib.cm.ScalarMappable` should use the
15-
:attr:`matplotlib.cm.ScalarMappable.callbacksSM`
15+
``matplotlib.cm.ScalarMappable.callbacksSM``
1616
:class:`~matplotlib.cbook.CallbackRegistry` instead.
1717

1818
* New axes function and Axes method provide control over the plot

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Code changes
192192
by ``self.vline`` for vertical cursors lines and ``self.hline`` is added
193193
for the horizontal cursors lines.
194194

195-
* On POSIX platforms, the :func:`~matplotlib.cbook.report_memory` function
195+
* On POSIX platforms, the ``matplotlib.cbook.report_memory`` function
196196
raises :class:`NotImplementedError` instead of :class:`OSError` if the
197197
:command:`ps` command cannot be run.
198198

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ consistent with the behavior on Py2, where a buffer object was
389389
returned.
390390

391391

392-
`matplotlib.font_manager.win32InstalledFonts` return type
393-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394-
`matplotlib.font_manager.win32InstalledFonts` returns an empty list instead
392+
``matplotlib.font_manager.win32InstalledFonts`` return type
393+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394+
``matplotlib.font_manager.win32InstalledFonts`` returns an empty list instead
395395
of None if no fonts are found.
396396

397397
``Axes.fmt_xdata`` and ``Axes.fmt_ydata`` error handling

doc/api/toolkits/axisartist.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ You can find a tutorial describing usage of axisartist at the
3939
axisartist.axis_artist
4040
axisartist.axisline_style
4141
axisartist.axislines
42-
axisartist.clip_path
4342
axisartist.floating_axes
4443
axisartist.grid_finder
4544
axisartist.grid_helper_curvelinear

doc/users/explain/interactive_guide.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ Blocking functions
213213
------------------
214214

215215
If you only need to collect points in an Axes you can use
216-
`.Figure.ginput` or more generally the tools from
217-
`.blocking_input` the tools will take care of starting and stopping
218-
the event loop for you. However if you have written some custom event
216+
`.Figure.ginput`. However if you have written some custom event
219217
handling or are using `.widgets` you will need to manually run the GUI
220218
event loop using the methods described :ref:`above <cp_block_the_prompt>`.
221219

lib/matplotlib/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ class __getattr__:
187187
__version__ = property(lambda self: _get_version())
188188
__version_info__ = property(
189189
lambda self: _parse_to_version_info(self.__version__))
190-
# module-level deprecations
191-
URL_REGEX = _api.deprecated("3.5", obj_type="")(property(
192-
lambda self: re.compile(r'^http://|^https://|^ftp://|^file:')))
193190

194191

195192
def _check_versions():
@@ -732,12 +729,6 @@ def rc_params(fail_on_error=False):
732729
return rc_params_from_file(matplotlib_fname(), fail_on_error)
733730

734731

735-
@_api.deprecated("3.5")
736-
def is_url(filename):
737-
"""Return whether *filename* is an http, https, ftp, or file URL path."""
738-
return __getattr__("URL_REGEX").match(filename) is not None
739-
740-
741732
@functools.lru_cache()
742733
def _get_ssl_context():
743734
try:

lib/matplotlib/_tight_layout.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -157,48 +157,6 @@ def _auto_adjust_subplotpars(
157157
return kwargs
158158

159159

160-
@_api.deprecated("3.5")
161-
def auto_adjust_subplotpars(
162-
fig, renderer, nrows_ncols, num1num2_list, subplot_list,
163-
ax_bbox_list=None, pad=1.08, h_pad=None, w_pad=None, rect=None):
164-
"""
165-
Return a dict of subplot parameters to adjust spacing between subplots
166-
or ``None`` if resulting axes would have zero height or width.
167-
168-
Note that this function ignores geometry information of subplot
169-
itself, but uses what is given by the *nrows_ncols* and *num1num2_list*
170-
parameters. Also, the results could be incorrect if some subplots have
171-
``adjustable=datalim``.
172-
173-
Parameters
174-
----------
175-
nrows_ncols : tuple[int, int]
176-
Number of rows and number of columns of the grid.
177-
num1num2_list : list[tuple[int, int]]
178-
List of numbers specifying the area occupied by the subplot
179-
subplot_list : list of subplots
180-
List of subplots that will be used to calculate optimal subplot_params.
181-
pad : float
182-
Padding between the figure edge and the edges of subplots, as a
183-
fraction of the font size.
184-
h_pad, w_pad : float
185-
Padding (height/width) between edges of adjacent subplots, as a
186-
fraction of the font size. Defaults to *pad*.
187-
rect : tuple
188-
(left, bottom, right, top), default: None.
189-
"""
190-
nrows, ncols = nrows_ncols
191-
span_pairs = []
192-
for n1, n2 in num1num2_list:
193-
if n2 is None:
194-
n2 = n1
195-
span_pairs.append((slice(n1 // ncols, n2 // ncols + 1),
196-
slice(n1 % ncols, n2 % ncols + 1)))
197-
return _auto_adjust_subplotpars(
198-
fig, renderer, nrows_ncols, num1num2_list, subplot_list,
199-
ax_bbox_list, pad, h_pad, w_pad, rect)
200-
201-
202160
def get_subplotspec_list(axes_list, grid_spec=None):
203161
"""
204162
Return a list of subplotspec from the given list of axes.

0 commit comments

Comments
 (0)
0