Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 518b268

Browse files
authored
Merge pull request #27217 from ksunden/contour_type
Fix type hints for undeprecated contour APIs
2 parents dbebe96 + 44c57b4 commit 518b268

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ matplotlib.figure.Figure.set_tight_layout
4141
matplotlib.cm.register_cmap
4242
matplotlib.cm.unregister_cmap
4343

44-
# 3.8 deprecations
45-
matplotlib.contour.ContourSet.allkinds
46-
matplotlib.contour.ContourSet.allsegs
47-
matplotlib.contour.ContourSet.tcolors
48-
matplotlib.contour.ContourSet.tlinewidths
49-
5044
# positional-only argument name lacking leading underscores
5145
matplotlib.axes._base._AxesBase.axis
5246

lib/matplotlib/contour.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ class ContourSet(ContourLabeler, Collection):
103103
clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None
104104
labelTexts: list[Text]
105105
labelCValues: list[ColorType]
106-
allkinds: list[np.ndarray]
107-
tcolors: list[tuple[float, float, float, float]]
106+
@property
107+
def tcolors(self) -> list[tuple[tuple[float, float, float, float]]]: ...
108108

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

113+
@property
114+
def allkinds(self) -> list[list[np.ndarray | None]]: ...
115+
@property
116+
def allsegs(self) -> list[list[np.ndarray]]: ...
112117
@property
113118
def alpha(self) -> float | None: ...
114119
@property

lib/matplotlib/path.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Path:
3030
@vertices.setter
3131
def vertices(self, vertices: ArrayLike) -> None: ...
3232
@property
33-
def codes(self) -> ArrayLike: ...
33+
def codes(self) -> ArrayLike | None: ...
3434
@codes.setter
3535
def codes(self, codes: ArrayLike) -> None: ...
3636
@property

0 commit comments

Comments
 (0)