Skip to content

Commit ec3c8be

Browse files
committed
Remaining mpl3.6 deprecations
pending deprecations remain in axis3D and in Figure
1 parent 2c4f552 commit ec3c8be

File tree

7 files changed

+5
-32
lines changed

7 files changed

+5
-32
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,10 @@ matplotlib.transforms.TransformWrapper.input_dims
8484
matplotlib.transforms.TransformWrapper.is_separable
8585
matplotlib.transforms.TransformWrapper.output_dims
8686

87-
# 3.6 deprecations
88-
matplotlib.colorbar.Colorbar.__init__
89-
matplotlib.figure.Figure.callbacks
87+
# 3.6 Pending deprecations
9088
matplotlib.figure.Figure.set_constrained_layout
9189
matplotlib.figure.Figure.set_constrained_layout_pads
9290
matplotlib.figure.Figure.set_tight_layout
93-
matplotlib.figure.SubFigure.callbacks
9491

9592
# 3.7 deprecations
9693
matplotlib.cm.register_cmap
@@ -103,7 +100,6 @@ matplotlib.widgets.Slider.__init__
103100
matplotlib.widgets.RangeSlider.__init__
104101
matplotlib.widgets.TextBox.__init__
105102
matplotlib.widgets.Cursor.__init__
106-
matplotlib.widgets.MultiCursor.__init__
107103
matplotlib.widgets.SpanSelector.__init__
108104
matplotlib.widgets.ToolLineHandles.__init__
109105
matplotlib.widgets.ToolHandles.__init__

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ class Colorbar:
278278

279279
n_rasterize = 50 # rasterize solids if number of colors >= n_rasterize
280280

281-
@_api.delete_parameter("3.6", "filled")
282281
def __init__(self, ax, mappable=None, *, cmap=None,
283282
norm=None,
284283
alpha=None,
@@ -291,7 +290,6 @@ def __init__(self, ax, mappable=None, *, cmap=None,
291290
ticks=None,
292291
format=None,
293292
drawedges=False,
294-
filled=True,
295293
extendfrac=None,
296294
extendrect=False,
297295
label='',
@@ -305,6 +303,7 @@ def __init__(self, ax, mappable=None, *, cmap=None,
305303
cmap = mappable.cmap
306304
norm = mappable.norm
307305

306+
filled = True
308307
if isinstance(mappable, contour.ContourSet):
309308
cs = mappable
310309
alpha = cs.get_alpha()

lib/matplotlib/colorbar.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class Colorbar:
5757
ticks: Sequence[float] | Locator | None = ...,
5858
format: str | Formatter | None = ...,
5959
drawedges: bool = ...,
60-
filled: bool = ...,
6160
extendfrac: Literal["auto"] | float | Sequence[float] | None = ...,
6261
extendrect: bool = ...,
6362
label: str = ...,

lib/matplotlib/figure.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,10 +2142,6 @@ class SubFigure(FigureBase):
21422142
21432143
See :doc:`/gallery/subplots_axes_and_figures/subfigures`
21442144
"""
2145-
callbacks = _api.deprecated(
2146-
"3.6", alternative=("the 'resize_event' signal in "
2147-
"Figure.canvas.callbacks")
2148-
)(property(lambda self: self._fig_callbacks))
21492145

21502146
def __init__(self, parent, subplotspec, *,
21512147
facecolor=None,
@@ -2194,7 +2190,6 @@ def __init__(self, parent, subplotspec, *,
21942190
self._subplotspec = subplotspec
21952191
self._parent = parent
21962192
self.figure = parent.figure
2197-
self._fig_callbacks = parent._fig_callbacks
21982193

21992194
# subfigures use the parent axstack
22002195
self._axstack = parent._axstack
@@ -2355,12 +2350,6 @@ class Figure(FigureBase):
23552350
depending on the renderer option_image_nocomposite function. If
23562351
*suppressComposite* is a boolean, this will override the renderer.
23572352
"""
2358-
# Remove the self._fig_callbacks properties on figure and subfigure
2359-
# after the deprecation expires.
2360-
callbacks = _api.deprecated(
2361-
"3.6", alternative=("the 'resize_event' signal in "
2362-
"Figure.canvas.callbacks")
2363-
)(property(lambda self: self._fig_callbacks))
23642353

23652354
def __str__(self):
23662355
return "Figure(%gx%g)" % tuple(self.bbox.size)
@@ -2501,7 +2490,6 @@ def __init__(self,
25012490
# everything is None, so use default:
25022491
self.set_layout_engine(layout=layout)
25032492

2504-
self._fig_callbacks = cbook.CallbackRegistry(signals=["dpi_changed"])
25052493
# Callbacks traditionally associated with the canvas (and exposed with
25062494
# a proxy property), but that actually need to be on the figure for
25072495
# pickling.
@@ -2750,7 +2738,6 @@ def _set_dpi(self, dpi, forward=True):
27502738
self.dpi_scale_trans.clear().scale(dpi)
27512739
w, h = self.get_size_inches()
27522740
self.set_size_inches(w, h, forward=forward)
2753-
self._fig_callbacks.process('dpi_changed', self)
27542741

27552742
dpi = property(_get_dpi, _set_dpi, doc="The resolution in dots per inch.")
27562743

lib/matplotlib/tri/_tripcolor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
8080
"tripcolor() missing 1 required positional argument: 'c'; or "
8181
"1 required keyword-only argument: 'facecolors'")
8282
elif len(args) > 1:
83-
_api.warn_deprecated(
84-
"3.6", message=f"Additional positional parameters "
85-
f"{args[1:]!r} are ignored; support for them is deprecated "
86-
f"since %(since)s and will be removed %(removal)s")
83+
raise TypeError(f"Unexpected positional parameters: {args[1:]!r}")
8784
c = np.asarray(args[0])
8885
if len(c) == len(tri.x):
8986
# having this before the len(tri.triangles) comparison gives

lib/matplotlib/widgets.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,13 +2429,9 @@ def get_visible(self):
24292429

24302430
@property
24312431
def visible(self):
2432+
_api.warn_deprecated("3.6", alternative="get_visible")
24322433
return self.get_visible()
24332434

2434-
@visible.setter
2435-
def visible(self, visible):
2436-
_api.warn_deprecated("3.6", alternative="set_visible")
2437-
self.set_visible(visible)
2438-
24392435
def clear(self):
24402436
"""Clear the selection and set the selector ready to make a new one."""
24412437
self._clear_without_update()

lib/matplotlib/widgets.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class MultiCursor(Widget):
259259
self,
260260
canvas: Any,
261261
axes: Sequence[Axes],
262+
*,
262263
useblit: bool = ...,
263264
horizOn: bool = ...,
264265
vertOn: bool = ...,
@@ -297,8 +298,6 @@ class _SelectorWidget(AxesWidget):
297298
def get_visible(self) -> bool: ...
298299
@property
299300
def visible(self) -> bool: ...
300-
@visible.setter
301-
def visible(self, visible: bool) -> None: ...
302301
def clear(self) -> None: ...
303302
@property
304303
def artists(self) -> tuple[Artist]: ...

0 commit comments

Comments
 (0)