8000 Review and CI warnings · matplotlib/matplotlib@d832950 · GitHub
[go: up one dir, main page]

Skip to content

Commit d832950

Browse files
committed
Review and CI warnings
1 parent 5b02469 commit d832950

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ exclude_lines =
1212
def __str__
1313
def __repr__
1414
if __name__ == .__main__.:
15+
if TYPE_CHECKING:
16+
if typing.TYPE_CHECKING:

doc/missing-references.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@
137137
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.vlines:1"
138138
],
139139
"Axes": [
140+
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.axes:1",
140141
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.colorbar:1",
142+
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.delaxes:1",
143+
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.subplot2grid:1",
141144
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.subplot_mosaic:1",
142145
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.subplots:1",
143146
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.twinx:1",

lib/matplotlib/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@
103103
104104
"""
105105

106-
__all__ = [
106+
__all_ignore__ = [
107107
"__bibtex__",
108+
"__version__",
108109
"__version_info__",
109110
"set_loglevel",
110111
"ExecutableNotFoundError",

lib/matplotlib/__init__.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__all__ = [
22
"__bibtex__",
3+
"__version__",
34
"__version_info__",
45
"set_loglevel",
56
"ExecutableNotFoundError",
@@ -49,8 +50,8 @@ class _VersionInfo(NamedTuple):
4950
releaselevel: str
5051
serial: int
5152

52-
class __getattr__:
53-
__version_info__: _VersionInfo
53+
__version__: str
54+
__version_info__: _VersionInfo
5455

5556
def set_loglevel(level: str) -> None: ...
5657

lib/matplotlib/pyplot.py

Lines changed: 9 additions & 7 deletions
1194
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ def sca(ax: Axes) -> None:
11891189
Set the current Axes to *ax* and the current Figure to the parent of *ax*.
11901190
"""
11911191
figure(ax.figure)
1192+
# Mypy sees ax.figure as potentially None,
1193+
# but if you are calling this, it won't be None
11921194
ax.figure.sca(ax) # type: ignore
11931195

1196

@@ -1201,7 +1203,7 @@ def cla() -> None:
12011203
## More ways of creating axes ##
12021204

12031205
@_docstring.dedent_interpd
1204-
def subplot(*args, **kwargs) -> matplotlib.axes.Axes:
1206+
def subplot(*args, **kwargs) -> Axes:
12051207
"""
12061208
Add an Axes to the current figure or retrieve an existing Axes.
12071209
@@ -1411,7 +1413,7 @@ def subplots(
14111413
subplot_kw: dict[str, Any] | None = None,
14121414
gridspec_kw: dict[str, Any] | None = None,
14131415
**fig_kw
1414-
) -> tuple[Figure, matplotlib.axes.Axes | np.ndarray | SubplotBase]:
1416+
) -> tuple[Figure, Axes | np.ndarray | SubplotBase]:
14151417
"""
14161418
Create a figure and a set of subplots.
14171419
@@ -1575,7 +1577,7 @@ def subplot_mosaic(
15751577
gridspec_kw: dict[str, Any] | None = None,
15761578
per_subplot_kw: dict[Any, dict[str, Any]] | None = None,
15771579
**fig_kw
1578-
) -> tuple[Figure, dict[Any, matplotlib.axes.Axes]]:
1580+
) -> tuple[Figure, dict[Any, Axes]]:
15791581
"""
15801582
Build a layout of Axes based on ASCII art or nested lists.
15811583
@@ -1754,7 +1756,7 @@ def subplot2grid(
17541756
return ax
17551757

17561758

1757-
def twinx(ax: matplotlib.axes.Axes | None = None) -> _AxesBase:
1759+
def twinx(ax: Axes | None = None) -> _AxesBase:
17581760
"""
17591761
Make and return a second axes that shares the *x*-axis. The new axes will
17601762
overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be
@@ -1770,7 +1772,7 @@ def twinx(ax: matplotlib.axes.Axes | None = None) -> _AxesBase:
17701772
return ax1
17711773

17721774

1773-
def twiny(ax: matplotlib.axes.Axes | None = None) -> _AxesBase:
1775+
def twiny(ax: Axes | None = None) -> _AxesBase:
17741776
"""
17751777
Make and return a second axes that shares the *y*-axis. The new axes will
17761778
overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be
@@ -2225,8 +2227,8 @@ def _get_pyplot_commands() -> list[str]:
22252227
@_copy_docstring_and_deprecators(Figure.colorbar)
22262228
def colorbar(
22272229
mappable: ScalarMappable | None = None,
2228-
cax: matplotlib.axes.Axes | None = None,
2229-
ax: matplotlib.axes.Axes | Iterable[matplotlib.axes.Axes] | None = None,
2230+
cax: Axes | None = None,
2231+
ax: Axes | Iterable[Axes] | None = None,
22302232
**kwargs
22312233
) -> Colorbar:
22322234
if mappable is None:

0 commit comments

Comments
 (0)
0