[TYP] Reduce stubtest ignores by ksunden · Pull Request #25844 · matplotlib/matplotlib · GitHub
Skip to content
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
18 changes: 3 additions & 15 deletions ci/mypy-stubtest-allowlist.txt
4 changes: 2 additions & 2 deletions lib/matplotlib/_path.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import numpy as np
from .transforms import BboxBase

def affine_transform(points: np.ndarray, trans: np.ndarray) -> np.ndarray: ...
def count_bboxes_overlapping_bbox(a: BboxBase, bboxes: Sequence[BboxBase]) -> int: ...
def update_path_extents(*args, **kwargs): ...
def count_bboxes_overlapping_bbox(bbox: BboxBase, bboxes: Sequence[BboxBase]) -> int: ...
def update_path_extents(path, trans, rect, minpos, ignore): ...
10 changes: 9 additions & 1 deletion lib/matplotlib/projections/polar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from matplotlib.ticker import _DummyAxis
import numpy as np
from numpy.typing import ArrayLike
from collections.abc import Sequence
from typing import Any, Literal, overload
from typing import Any, ClassVar, Literal, overload

class PolarTransform(mtransforms.Transform):
input_dims: int
Expand Down Expand Up @@ -84,6 +84,14 @@ class _WedgeBbox(mtransforms.Bbox):
) -> None: ...

class PolarAxes(Axes):

PolarTransform: ClassVar[type] = PolarTransform
PolarAffine: ClassVar[type] = PolarAffine
InvertedPolarTransform: ClassVar[type] = InvertedPolarTransform
ThetaFormatter: ClassVar[type] = ThetaFormatter
RadialLocator: ClassVar[type] = RadialLocator
ThetaLocator: ClassVar[type] = ThetaLocator

name: str
use_sticky_edges: bool
def __init__(
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/text.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@ class Annotation(Text, _AnnotationBase):
| Callable[[RendererBase], Bbox | Transform],
) -> None: ...
def update_positions(self, renderer: RendererBase) -> None: ...
# Drops `dpi` parameter from superclass
def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ... # type: ignore[override]
5 changes: 4 additions & 1 deletion lib/matplotlib/ticker.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class PercentFormatter(Formatter):
class Locator(TickHelper):
MAXTICKS: int
def tick_values(self, vmin: float, vmax: float) -> Sequence[float]: ...
# Implementation accepts **kwargs, but is a no-op other than a warning
# Typing as **kwargs would require each subclass to accept **kwargs for mypy
def set_params(self) -> None: ...
def __call__(self) -> Sequence[float]: ...
def raise_if_exceeds(self, locs: Sequence[float]) -> Sequence[float]: ...
Expand Down Expand Up @@ -211,7 +213,8 @@ class LinearLocator(Locator):

class MultipleLocator(Locator):
def __init__(self, base: float = ...) -> None: ...
def set_params(self, base: float | None = ...) -> None: ...
# Makes set_params `base` argument mandatory
def set_params(self, base: float | None) -> None: ... # type: ignore[override]
def view_limits(self, dmin: float, dmax: float) -> tuple[float, float]: ...

class _Edge_integer:
Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/transforms.pyi