Skip to content

Commit 3cb6036

Browse files
committed
Bring existing parameter keyword only deprecations in line with documentation
1 parent 5cb06e9 commit 3cb6036

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,14 @@ matplotlib.cm.register_cmap
5454
matplotlib.cm.unregister_cmap
5555
matplotlib.collections.PolyCollection.span_where
5656
matplotlib.gridspec.GridSpecBase.get_grid_positions
57-
matplotlib.widgets.Lasso.__init__
58-
matplotlib.widgets.PolygonSelector.__init__
59-
matplotlib.widgets.Slider.__init__
60-
matplotlib.widgets.RangeSlider.__init__
61-
matplotlib.widgets.TextBox.__init__
62-
matplotlib.widgets.Cursor.__init__
63-
matplotlib.widgets.SpanSelector.__init__
64-
matplotlib.widgets.ToolLineHandles.__init__
65-
matplotlib.widgets.ToolHandles.__init__
66-
matplotlib.widgets.LassoSelector.__init__
6757
matplotlib.widgets.MultiCursor.needclear
6858

6959
# 3.8 deprecations
70-
matplotlib.axes._base._AxesBase.get_tightbbox
7160
matplotlib.cbook.get_sample_data
7261
matplotlib.contour.ContourSet.allkinds
7362
matplotlib.contour.ContourSet.allsegs
7463
matplotlib.contour.ContourSet.tcolors
7564
matplotlib.contour.ContourSet.tlinewidths
76-
matplotlib.figure.FigureBase.get_tightbbox
7765
matplotlib.ticker.LogLocator.__init__
7866
matplotlib.ticker.LogLocator.set_params
7967

lib/matplotlib/axes/_base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ class _AxesBase(martist.Artist):
367367
def get_tightbbox(
368368
self,
369369
renderer: RendererBase | None = ...,
370+
*,
370371
call_axes_locator: bool = ...,
371372
bbox_extra_artists: Sequence[Artist] | None = ...,
372-
*,
373373
for_layout_only: bool = ...
374374
) -> Bbox | None: ...
375375
def twinx(self) -> _AxesBase: ...

lib/matplotlib/figure.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ class FigureBase(Artist):
223223
def get_tightbbox(
224224
self,
225225
renderer: RendererBase | None = ...,
226+
*,
226227
bbox_extra_artists: Iterable[Artist] | None = ...,
227228
) -> Bbox: ...
228229

lib/matplotlib/widgets.pyi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class Slider(SliderBase):
9696
label: str,
9797
valmin: float,
9898
valmax: float,
99+
*,
99100
valinit: float = ...,
100101
valfmt: str | None = ...,
101102
closedmin: bool = ...,
@@ -105,7 +106,6 @@ class Slider(SliderBase):
105106
dragging: bool = ...,
106107
valstep: float | ArrayLike | None = ...,
107108
orientation: Literal["horizontal", "vertical"] = ...,
108-
*,
109109
initcolor: ColorType = ...,
110110
track_color: ColorType = ...,
111111
handle_style: dict[str, Any] | None = ...,
@@ -127,6 +127,7 @@ class RangeSlider(SliderBase):
127127
label: str,
128128
valmin: float,
129129
valmax: float,
130+
*,
130131
valinit: tuple[float, float] | None = ...,
131132
valfmt: str | None = ...,
132133
closedmin: bool = ...,
@@ -181,6 +182,7 @@ class TextBox(AxesWidget):
181182
ax: Axes,
182183
label: str,
183184
initial: str = ...,
185+
*,
184186
color: ColorType = ...,
185187
hovercolor: ColorType = ...,
186188
label_pad: float = ...,
@@ -236,6 +238,7 @@ class Cursor(AxesWidget):
236238
def __init__(
237239
self,
238240
ax: Axes,
241+
*,
239242
horizOn: bool = ...,
240243
vertOn: bool = ...,
241244
useblit: bool = ...,
@@ -317,6 +320,7 @@ class SpanSelector(_SelectorWidget):
317320
ax: Axes,
318321
onselect: Callable[[float, float], Any],
319322
direction: Literal["horizontal", "vertical"],
323+
*,
320324
minspan: float = ...,
321325
useblit: bool = ...,
322326
props: dict[str, Any] | None = ...,
@@ -348,6 +352,7 @@ class ToolLineHandles:
348352
ax: Axes,
349353
positions: ArrayLike,
350354
direction: Literal["horizontal", "vertical"],
355+
*,
351356
line_props: dict[str, Any] | None = ...,
352357
useblit: bool = ...,
353358
) -> None: ...
@@ -370,6 +375,7 @@ class ToolHandles:
370375
ax: Axes,
371376
x: ArrayLike,
372377
y: ArrayLike,
378+
*,
373379
marker: str = ...,
374380
marker_props: dict[str, Any] | None = ...,
375381
useblit: bool = ...,
@@ -436,6 +442,7 @@ class LassoSelector(_SelectorWidget):
436442
self,
437443
ax: Axes,
438444
onselect: Callable[[list[tuple[float, float]]], Any],
445+
*,
439446
useblit: bool = ...,
440447
props: dict[str, Any] | None = ...,
441448
button: MouseButton | Collection[MouseButton] | None = ...,
@@ -447,11 +454,11 @@ class PolygonSelector(_SelectorWidget):
447454
self,
448455
ax: Axes,
449456
onselect: Callable[[ArrayLike, ArrayLike], Any],
457+
*,
450458
useblit: bool = ...,
451459
props: dict[str, Any] | None = ...,
452460
handle_props: dict[str, Any] | None = ...,
453461
grab_range: float = ...,
454-
*,
455462
draw_bounding_box: bool = ...,
456463
box_handle_props: dict[str, Any] | None = ...,
457464
box_props: dict[str, Any] | None = ...
@@ -473,6 +480,7 @@ class Lasso(AxesWidget):
473480
ax: Axes,
474481
xy: tuple[float, float],
475482
callback: Callable[[list[tuple[float, float]]], Any],
483+
*,
476484
useblit: bool = ...,
477485
) -> None: ...
478486
def onrelease(self, event: Event) -> None: ...

0 commit comments

Comments
 (0)