8000 Merge branch 'main' into ghc-gridspec-deprecation · matplotlib/matplotlib@680d95d · GitHub
[go: up one dir, main page]

Skip to content

Commit 680d95d

Browse files
authored
Merge branch 'main' into ghc-gridspec-deprecation
2 parents 61b66f4 + 7d2acfd commit 680d95d

File tree

12 files changed

+66
-224
lines changed

12 files changed

+66
-224
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ matplotlib.figure.Figure.set_tight_layout
5353
matplotlib.cm.register_cmap
5454
matplotlib.cm.unregister_cmap
5555
matplotlib.collections.PolyCollection.span_where
56-
matplotlib.widgets.MultiCursor.needclear
5756

5857
# 3.8 deprecations
5958
matplotlib.cbook.get_sample_data
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Most arguments to widgets have been made keyword-only
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Passing all but the very few first arguments positionally in the constructors
5+
of Widgets is now keyword-only. In general, all optional arguments are keyword-only.
6+
7+
``RadioButtons.circles``
8+
~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
... is removed. (``RadioButtons`` now draws itself using `~.Axes.scatter`.)
11+
12+
``CheckButtons.rectangles`` and ``CheckButtons.lines``
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
``CheckButtons.rectangles`` and ``CheckButtons.lines`` are removed.
16+
(``CheckButtons`` now draws itself using `~.Axes.scatter`.)
17+
18+
Remove unused parameter *x* to ``TextBox.begin_typing``
19+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20+
21+
This parameter was unused in the method, but was a required argument.
22+
23+
``MultiCursor.needclear``
24+
~~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
... is removed.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``matplotlib.axis.Axis.set_ticklabels``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... a param was renamed to labels from ticklabels.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
``repeat``
2+
~~~~~~~~~~
3+
... of `.TimedAnimation` is removed without replacements.
4+
``save_count``
5+
~~~~~~~~~~~~~~
6+
... of `.FuncAnimation` is removed without replacements.

doc/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ def _parse_skip_subdirs_file():
4747
but you can skip subdirectories of 'users'. Doing this
4848
can make partial builds very fast.
4949
"""
50-
default_skip_subdirs = ['users/prev_whats_new/*', 'api/*', 'gallery/*',
51-
'tutorials/*', 'plot_types/*', 'devel/*']
50+
default_skip_subdirs = [
51+
'users/prev_whats_new/*', 'users/explain/*', 'api/*', 'gallery/*',
52+
'tutorials/*', 'plot_types/*', 'devel/*']
5253
try:
5354
with open(".mpl_skip_subdirs.yaml", 'r') as fin:
5455
print('Reading subdirectories to skip from',

lib/matplotlib/animation.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,8 +1446,6 @@ def _step(self, *args):
14461446
self.event_source.interval = self._interval
14471447
return True
14481448

1449-
repeat = _api.deprecate_privatize_attribute("3.7")
1450-
14511449

14521450
class ArtistAnimation(TimedAnimation):
14531451
"""
@@ -1788,8 +1786,6 @@ def _draw_frame(self, framedata):
17881786
for a in self._drawn_artists:
17891787
a.set_animated(self._blit)
17901788

1791-
save_count = _api.deprecate_privatize_attribute("3.7")
1792-
17931789

17941790
def _validate_grabframe_kwargs(savefig_kwargs):
17951791
if mpl.rcParams['savefig.bbox'] == 'tight':

lib/matplotlib/animation.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ class Animation:
188188
def resume(self) -> None: ...
189189

190190
class TimedAnimation(Animation):
191-
repeat: bool
192191
def __init__(
193192
self,
194193
fig: Figure,
@@ -204,7 +203,6 @@ class ArtistAnimation(TimedAnimation):
204203
def __init__(self, fig: Figure, artists: Sequence[Collection[Artist]], *args, **kwargs) -> None: ...
205204

206205
class FuncAnimation(TimedAnimation):
207-
save_count: int
208206
def __init__(
209207
self,
210208
fig: Figure,

lib/matplotlib/axis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,6 @@ def set_pickradius(self, pickradius):
19411941
def _format_with_dict(tickd, x, pos):
19421942
return tickd.get(x, "")
19431943

1944-
@_api.rename_parameter("3.7", "ticklabels", "labels")
19451944
def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
19461945
r"""
19471946
[*Discouraged*] Set this Axis' tick labels with list of string labels.
Loading

lib/matplotlib/tests/test_widgets.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import matplotlib.colors as mcolors
88
import matplotlib.widgets as widgets
99
import matplotlib.pyplot as plt
10-
from matplotlib.patches import Rectangle
11-
from matplotlib.lines import Line2D
1210
from matplotlib.testing.decorators import check_figures_equal, image_comparison
1311
from matplotlib.testing.widgets import (click_and_drag, do_event, get_ax,
1412
mock_event, noop)
@@ -1055,16 +1053,10 @@ def test_check_radio_buttons_image():
10551053

10561054
rax1 = fig.add_axes((0.05, 0.7, 0.2, 0.15))
10571055
rb1 = widgets.RadioButtons(rax1, ('Radio 1', 'Radio 2', 'Radio 3'))
1058-
with pytest.warns(DeprecationWarning,
1059-
match='The circles attribute was deprecated'):
1060-
rb1.circles # Trigger the old-style elliptic radiobuttons.
10611056

10621057
rax2 = fig.add_axes((0.05, 0.5, 0.2, 0.15))
10631058
cb1 = widgets.CheckButtons(rax2, ('Check 1', 'Check 2', 'Check 3'),
10641059
(False, True, True))
1065-
with pytest.warns(DeprecationWarning,
1066-
match='The rectangles attribute was deprecated'):
1067-
cb1.rectangles # Trigger old-style Rectangle check boxes
10681060

10691061
rax3 = fig.add_axes((0.05, 0.3, 0.2, 0.15))
10701062
rb3 = widgets.RadioButtons(
@@ -1164,57 +1156,6 @@ def test_check_button_props(fig_test, fig_ref):
11641156
cb.set_check_props({**check_props, 's': (24 / 2)**2})
11651157

11661158

1167-
@check_figures_equal(extensions=["png"])
1168-
def test_check_buttons_rectangles(fig_test, fig_ref):
1169-
# Test should be removed once .rectangles is removed
1170-
cb = widgets.CheckButtons(fig_test.subplots(), ["", ""],
1171-
[False, False])
1172-
with pytest.warns(DeprecationWarning,
1173-
match='The rectangles attribute was deprecated'):
1174-
cb.rectangles
1175-
ax = fig_ref.add_subplot(xticks=[], yticks=[])
1176-
ys = [2/3, 1/3]
1177-
dy = 1/3
1178-
w, h = dy / 2, dy / 2
1179-
rectangles = [
1180-
Rectangle(xy=(0.05, ys[i] - h / 2), width=w, height=h,
1181-
edgecolor="black",
1182-
facecolor="none",
1183-
transform=ax.transAxes
1184-
)
1185-
for i, y in enumerate(ys)
1186-
]
1187-
for rectangle in rectangles:
1188-
ax.add_patch(rectangle)
1189-
1190-
1191-
@check_figures_equal(extensions=["png"])
1192-
def test_check_buttons_lines(fig_test, fig_ref):
1193-
# Test should be removed once .lines is removed
1194-
cb = widgets.CheckButtons(fig_test.subplots(), ["", ""], [True, True])
1195-
with pytest.warns(DeprecationWarning,
1196-
match='The lines attribute was deprecated'):
1197-
cb.lines
1198-
for rectangle in cb._rectangles:
1199-
rectangle.set_visible(False)
1200-
ax = fig_ref.add_subplot(xticks=[], yticks=[])
1201-
ys = [2/3, 1/3]
1202-
dy = 1/3
1203-
w, h = dy / 2, dy / 2
1204-
lineparams = {'color': 'k', 'linewidth': 1.25,
1205-
'transform': ax.transAxes,
1206-
'solid_capstyle': 'butt'}
1207-
for i, y in enumerate(ys):
1208-
x, y = 0.05, y - h / 2
1209-
l1 = Line2D([x, x + w], [y + h, y], **lineparams)
1210-
l2 = Line2D([x, x + w], [y, y + h], **lineparams)
1211-
1212-
l1.set_visible(True)
1213-
l2.set_visible(True)
1214-
ax.add_line(l1)
1215-
ax.add_line(l2)
1216-
1217-
12181159
def test_slider_slidermin_slidermax_invalid():
12191160
fig, ax = plt.subplots()
12201161
# test min/max with floats

0 commit comments

Comments
 (0)
0