Skip to content

Fix type hints for undeprecated contour APIs #27217

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
Oct 28, 2023
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
6 changes: 0 additions & 6 deletions ci/mypy-stubtest-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ matplotlib.figure.Figure.set_tight_layout
matplotlib.cm.register_cmap
matplotlib.cm.unregister_cmap

# 3.8 deprecations
matplotlib.contour.ContourSet.allkinds
matplotlib.contour.ContourSet.allsegs
matplotlib.contour.ContourSet.tcolors
matplotlib.contour.ContourSet.tlinewidths

# positional-only argument name lacking leading underscores
matplotlib.axes._base._AxesBase.axis

Expand Down
11 changes: 8 additions & 3 deletions lib/matplotlib/contour.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,17 @@ class ContourSet(ContourLabeler, Collection):
clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None
labelTexts: list[Text]
labelCValues: list[ColorType]
allkinds: list[np.ndarray]
tcolors: list[tuple[float, float, float, float]]
@property
def tcolors(self) -> list[tuple[tuple[float, float, float, float]]]: ...

# only for not filled
tlinewidths: list[tuple[float]]
@property
def tlinewidths(self) -> list[tuple[float]]: ...

@property
def allkinds(self) -> list[list[np.ndarray | None]]: ...
@property
def allsegs(self) -> list[list[np.ndarray]]: ...
@property
def alpha(self) -> float | None: ...
@property
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/path.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Path:
@vertices.setter
def vertices(self, vertices: ArrayLike) -> None: ...
@property
def codes(self) -> ArrayLike: ...
def codes(self) -> ArrayLike | None: ...
@codes.setter
def codes(self, codes: ArrayLike) -> None: ...
@property
Expand Down