Skip to content

MNT: remove draw method args and kwargs #27819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/mypy-stubtest-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ matplotlib.pyplot.*
matplotlib.typing.*

# Other decorator modifying signature
# Runtime picks up *args **kwargs, but only decorated by a decorator that uses @wraps so?
matplotlib.axis.Axis.draw
# Backcompat decorator which does not modify runtime reported signature
matplotlib.offsetbox.*Offset[Bb]ox.get_offset

Expand Down
5 changes: 0 additions & 5 deletions doc/api/next_api_changes/deprecations/27768-REC.rst

This file was deleted.

4 changes: 1 addition & 3 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1373,10 +1373,8 @@ def get_tick_padding(self):
values.append(self.minorTicks[0].get_tick_padding())
return max(values, default=0)

@_api.delete_parameter('3.9', 'args')
@_api.delete_parameter('3.9', 'kwargs')
@martist.allow_rasterization
def draw(self, renderer, *args, **kwargs):
def draw(self, renderer):
# docstring inherited

if not self.get_visible():
Expand Down
4 changes: 1 addition & 3 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,8 @@ def _check_unsampled_image(self):
"""
return False

@_api.delete_parameter('3.9', 'args')
@_api.delete_parameter('3.9', 'kwargs')
@martist.allow_rasterization
def draw(self, renderer, *args, **kwargs):
def draw(self, renderer):
# if not visible, declare victory and return
if not self.get_visible():
self.stale = False
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/image.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _ImageBase(martist.Artist, cm.ScalarMappable):
def make_image(
self, renderer: RendererBase, magnification: float = ..., unsampled: bool = ...
) -> tuple[np.ndarray, float, float, Affine2D]: ...
def draw(self, renderer: RendererBase, *args, **kwargs) -> None: ...
def draw(self, renderer: RendererBase) -> None: ...
def write_png(self, fname: str | pathlib.Path | BinaryIO) -> None: ...
def set_data(self, A: ArrayLike | None) -> None: ...
def set_array(self, A: ArrayLike | None) -> None: ...
Expand Down